-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IVY][9.0.0] Adding additional inputs in directive built by ng-packagr is not recognized by consuming app in watch mode #16921
Comments
Possibly an issue with the Angular compiler's incremental mode. It would be good to see if the CLI is triggering the Angular compiler correctly when this change occurs, which could help to narrow it down... |
I can provide a reproduction case in our example app (Webpack+Angular Compiler Plugin), but I don't have the knowledge to setup the same example with Angular CLI unfortunately. |
Hi I got a couple of question;
|
We're using Webpack and AngularCompilerPlugin new AngularCompilerPlugin({
tsConfigPath: helpers.rootPath('tsconfig.build.json'),
mainPath: helpers.rootPath('src/main.ts'),
sourceMap: true
}),
//main.ts
platformBrowserDynamic().bootstrapModule(AppModule)
.then(module => {
if (!environment.production) {
const applicationRef = module.injector.get(ApplicationRef);
const appComponent = applicationRef.components[0];
enableDebugTools(appComponent);
}
})
.catch(err => console.error(err));
We're using Webpack Dev Server in watch mode. It detects when library's files has changed.
We're using path mappings for TS and Webpack's Resolve Alias for JS/CSS/etc
Library is built using IVY.
ng-packagr is building with the following code:
|
Hi @JonWallsten, I tried this on a CLI project and I am unable to replicate this issue. Can you please share a repro? Thanks Edit: I actually just managed to replicate it. |
@alan-agius4 Yes! I'll do it tomorrow and send you an invite to the repo and write some instructions here. |
@JonWallsten, No need I managed to replicate it, thanks. |
@alan-agius4 : Great! Let me know if you need more info. It's probably related to this as well: https://github.com/angular/angular-cli/issues/16914 |
it seems that we are not watching all the dts files, which in turn causes certain files not to be removed from cached when they are changed. |
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex: ```ts export declare class FooComponent implements OnInit { constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDef<FooComponent>; static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>; } ``` Previously such files were not being added as dependency and such files didn't get invalidated when changed. Closes #16920 and closes #16921
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex: ```ts export declare class FooComponent implements OnInit { constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDef<FooComponent>; static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>; } ``` Previously such files were not being added as dependency and such files didn't get invalidated when changed. Closes #16920 and closes #16921
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex: ```ts export declare class FooComponent implements OnInit { constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDef<FooComponent>; static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>; } ``` Previously such files were not being added as dependency and such files didn't get invalidated when changed. Closes angular#16920 and closes angular#16921
🐞 Bug report
Command (mark with an
x
)Description
We are building a library with ng-packagr and then consuming it in our Angular 9 application.
When I added a new input in my directive it wasn't recognized until after I stopped my build completely and started from scratch.
After the first initial build, when in watch mode, I added the input
resizeElement
After the library was rebuilt by the watcher, and then the app was rebuilt, also by a watcher, the input was not recognized by the Angular compiler.
🔬 Minimal Reproduction
As usual I can provide an example but it takes time. Let me know if it's needed.
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: