Comments (16)
@R-Bower yep, that should be the problem, thank you, I'll check and fix it tomorrow! But it's still interesting why it doesn't work only for esbuild 🤔
from ng-doc.
I have been thinking about this, but currently esbuild
only works for the ng build
command and not for ng serve
. However, the Angular team is planning to add Vite
support in Angular 16, which would make it possible to use the combination of Vite
+ esbuild
, and thus make esbuild
work for the ng serve
command as well. For NgDoc 16 I plan to test the new builder, and if there are no issues with it, I will start using it by default to build the application. This means that all you will need to do is update to Angular and NgDoc 16 versions.
As for the complexity, everything should be very easy. All I will need to do is replace a couple of lines of code.
from ng-doc.
@R-Bower I added support for esbuild
, and it wasn't as easy as I thought. 🤣 It seems that the builder is still quite raw, but I managed to get it working with NgDoc. I will release 16.1.0 version soon, so feel free to give it a try. You will be able to find instructions on how to run it here.
from ng-doc.
🎉 This issue has been resolved in version 16.1.0 🎉
The release is available on:
v16.1.0
- GitHub release
Your semantic-release bot 📦🚀
from ng-doc.
@R-Bower I added support for
esbuild
, and it wasn't as easy as I thought. 🤣 It seems that the builder is still quite raw, but I managed to get it working with NgDoc. I will release 16.1.0 version soon, so feel free to give it a try. You will be able to find instructions on how to run it here.
Not sure why, but I'm getting a ton of TypeScript compilation errors. I upgraded everything to Angular 16 and am using the latest 16.1.1 version of ng-doc. For whatever reason, it seems to be trying to compile the .ng-doc files and is throwing errors. It seems to be ignoring the // @ts-nocheck
at the top of each file.
from ng-doc.
@R-Bower I added support for
esbuild
, and it wasn't as easy as I thought. 🤣 It seems that the builder is still quite raw, but I managed to get it working with NgDoc. I will release 16.1.0 version soon, so feel free to give it a try. You will be able to find instructions on how to run it here.Not sure why, but I'm getting a ton of TypeScript compilation errors. I upgraded everything to Angular 16 and am using the latest 16.1.1 version of ng-doc. For whatever reason, it seems to be trying to compile the .ng-doc files and is throwing errors. It seems to be ignoring the
// @ts-nocheck
at the top of each file.
Hmm, it's interesting, could you send me the list of errors you have and your tsconfig.json
? I just need to reproduce it first
from ng-doc.
There are so many errors it's difficult to list. Here are a few:
✘ [ERROR] TS1128: Declaration or statement expected. [plugin angular-compiler]
@qui/angular-docs:dev:
@qui/angular-docs:dev: .ng-doc/app/guides/components/text-input/component-assets.ts:262:2:
@qui/angular-docs:dev: 262 │ }
@qui/angular-docs:dev: ╵ ^
@qui/angular-docs:dev:
@qui/angular-docs:dev:
@qui/angular-docs:dev: ✘ [ERROR] TS1128: Declaration or statement expected. [plugin angular-compiler]
@qui/angular-docs:dev:
@qui/angular-docs:dev: .ng-doc/app/guides/components/text-input/component-assets.ts:263:0:
@qui/angular-docs:dev: 263 │ }
@qui/angular-docs:dev: ╵ ^
tsconfig:
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictPropertyInitialization": false,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"importHelpers": true,
"target": "ESNext",
"module": "ESNext",
"lib": [
"ESNext",
"DOM"
],
"paths": {
"~ng-doc/generated": [
".ng-doc/app/index.ts"
],
"~ng-doc/generated/*": [
".ng-doc/app/*"
],
"~components/*": ["src/app/components/*"],
"~pages/*": ["src/app/pages/*"],
"~shared/*": ["src/app/shared/*"],
"~shared": ["src/app/shared/index.ts"]
}
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"angularCompilerOptions": {
"allowSyntheticDefaultImports": true,
"enableI18nLegacyMessageIdFormat": false,
"noPropertyAccessFromIndexSignature": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
from ng-doc.
Should also note that the compiler works fine if I don't use esbuild
as the angularBuilder
.
from ng-doc.
Should also note that the compiler works fine if I don't use
esbuild
as theangularBuilder
.
Sorry, again, but could you show me that generated file with the error?
from ng-doc.
Sorry, don't have time at the moment. I'll try to get you something tomorrow. Last I checked, every TS file within the generated ng-doc/app directory is causing compilation errors
from ng-doc.
@R-Bower no problem! I just can't reproduce it with your tsconfig
, so I started thinking that the problem in the generated files, just they were changed a bit to start supporting webpack
and esbuild
together
from ng-doc.
I think I've narrowed down the issue. I'm using dynamic HTML props for one of my components. It looks like ng-doc is attempting to escape or format the string contents of the property, but fails.
Here's an example source file:
import {Component} from "@angular/core"
import {QTooltipPlacement} from "@qui/base"
import {CssTableModel} from "~shared"
@Component({
selector: "tooltip-css-table",
template: `
<css-table [model]="model"></css-table>
`,
})
export class TooltipCssComponent {
model: CssTableModel[] = [
{
classes: ["q-tooltip--bottom"],
description: `Class applied to the root element when <code>qTooltipPlacement=${
"bottom" satisfies QTooltipPlacement
}</code>.`,
},
]
}
The section of the css-table
component that consumes this model:
<tr *ngFor="let css of model">
<td class="whitespace-nowrap font-mono">
{{ this.formatClasses(css.classes) }}
</td>
<td class="q-body-m" [innerHTML]="css.description"></td>
</tr>
The generated ng-doc code at .ng-doc/app/guides/components/tooltip/component-assets.ts
<span class="hljs-attr ngde">model</span>: <span class="hljs-title class_ ngde">CssTableModel</span>[] = [
{
<span class="hljs-attr ngde">classes</span>: [<span class="hljs-string ngde">"q-tooltip--bottom"</span>],
<span class="hljs-attr ngde">description</span>: <span class="hljs-string ngde">\`Class applied to the root element when <code>qTooltipPlacement=<span class="hljs-subst ngde">${
<span class="hljs-string ngde">"bottom"</span> satisfies QTooltipPlacement
}</span></code>.\`</span>,
},
]
from ng-doc.
I just verified and it's also failing for webpack. What's odd is that sometimes it compiles, but most of the time it fails.
from ng-doc.
@R-Bower Now it makes sense! 👍🏻 Yes, the problem is with the escape function I'm using to inject template code directly into TypeScript code. Previously, I used the raw-loader
for webpack
and imported the template file directly through import statements. However, for esbuild
to work with this setup, another plugin needs to be added. Since esbuild's support for Angular is still in its early stages, I can't make that work. Therefore, I've decided to move the template code directly into the TypeScript code, eliminating the differences between esbuild
and webpack
.
Anyway, 16.2.1 has been released and should fix that errors, thank you for your help!
from ng-doc.
🎉 This issue has been resolved in version 16.3.0-beta.1 🎉
The release is available on:
v16.3.0-beta.1
- GitHub release
Your semantic-release bot 📦🚀
from ng-doc.
🎉 This issue has been resolved in version 16.3.0 🎉
The release is available on:
v16.3.0
- GitHub release
Your semantic-release bot 📦🚀
from ng-doc.
Related Issues (20)
- [Feature] Remove Google Fonts HOT 4
- [Bug] ng-doc.routing.ts incorrect generated import HOT 10
- [Bug] input aliasing decorator selector not rendered correctly HOT 4
- [Feature] Support template variables for inputs HOT 11
- [Bug] hidden: true in NgDocPage-Config does not avoid displaying a component in the navigation. HOT 7
- [Bug] Table of contents link does not work properly with basehref HOT 4
- [Bug] Unable to leverage Keywords to create custom links in a reusable macro template HOT 8
- [Feature] Unable to leverage Custom Angular Components in the Markdown file HOT 5
- Support for Mermaid HOT 7
- [Bug] Unable to build docs when Playground refers components from angular library HOT 3
- [Bug] Extra /docs is introduced in the home icon of the breadcrumb during configuration of NgDoc route prefix HOT 4
- [Bug] Unable to display demo details of the components from angular library HOT 3
- [Query] Is it possible to import macros from angular library? HOT 4
- [Bug]Unable to customize the title of the API page HOT 1
- [Bug] The id of the html header is not serialized HOT 2
- Support for native i18n / $localize + localized markdown HOT 3
- [Feature] Demo Pane viewport and theme support
- [Feature] Custom Tabs in Demo HOT 5
- [Feature] Display Component Properties in Component Tabs and on Page HOT 1
- [Bug] Configure Home icon route path of breadcrumb
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-doc.