-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
ngc --watch ignores changes in templates (ivy, 9.0.0-next.8) #32869
Comments
The changes on html aren't being affected by the serve build. For more details please visit the open (at the time of this commit) issue: angular/angular#32869
When the Angular compiler is operated through the ngc binary in watch mode, changing a template in an external file would not cause the component to be recompiled if Ivy is enabled. There was a problem with how a cached compiler host was present that was unaware of the changed resources, therefore failing to trigger a recompilation of a component whenever its template changes. This commit fixes the issue by ensuring that information about modified resources is correctly available to the cached compiler host. Fixes angular#32869
…#33551) When the Angular compiler is operated through the ngc binary in watch mode, changing a template in an external file would not cause the component to be recompiled if Ivy is enabled. There was a problem with how a cached compiler host was present that was unaware of the changed resources, therefore failing to trigger a recompilation of a component whenever its template changes. This commit fixes the issue by ensuring that information about modified resources is correctly available to the cached compiler host. Fixes #32869 PR Close #33551
@stefanocke just FYI the fix had to be reverted because of an issue with running the tests on Windows. I will follow up with a fix for that so that we can get it landed again. Sorry for the inconvenience. |
@JoostK , thanks for looking into this, nevertheless. |
When the Angular compiler is operated through the ngc binary in watch mode, changing a template in an external file would not cause the component to be recompiled if Ivy is enabled. There was a problem with how a cached compiler host was present that was unaware of the changed resources, therefore failing to trigger a recompilation of a component whenever its template changes. This commit fixes the issue by ensuring that information about modified resources is correctly available to the cached compiler host. Fixes angular#32869
…#33551) When the Angular compiler is operated through the ngc binary in watch mode, changing a template in an external file would not cause the component to be recompiled if Ivy is enabled. There was a problem with how a cached compiler host was present that was unaware of the changed resources, therefore failing to trigger a recompilation of a component whenever its template changes. This commit fixes the issue by ensuring that information about modified resources is correctly available to the cached compiler host. Fixes #32869 PR Close #33551
@stefanocke :( Let me check to see what's going on. I did test the PR for your repro, will have another go using rc.2 (I see that you already updated in the repro repo, thanks!) |
@stefanocke With your latest commit using rc.2 I cannot reproduce. Could it be that I'm missing something? If I edit just a single template I do see the corresponding .js file being updated with the template changes applied. |
@JoostK thank you, I will try again. Maybe I am missing something myself... |
@JoostK , still no success. I deleted node_modules and started freshly. Would you mind to give me some details of your successful test?
(I know, most of that is obvious. But just to see if there is subtle different detail...) |
OS X using Node 12
Mostly
No worries. Hopefully you spot something different. Let me know what else I can try :-) |
This new part of the code results in
|
Okay, if I add |
Can you place strategic breakpoints in these locations:
and possible here as well:
|
Hmm, thanks for finding the culprit. This is surprising to me, as the test I added is also run on Windows (we had to revert it initially because it wasn't working). I'll have a look! |
Thank you again. Since it somehow get lost during markup formatting, I would like to emphasize that I replaced double-backslash by slash in the path. |
@JoostK , could you please re-open. I cannot... |
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869
works as expected with 9.0.0 👍 |
…ngular#34015) In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869 PR Close angular#34015
…ngular#34015) In angular#33551, a bug in `ngc --watch` mode was fixed so that a component is recompiled when its template file is changed. Due to insufficient normalization of files paths, this fix did not have the desired effect on Windows. Fixes angular#32869 PR Close angular#34015
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. |
This is a repost of #31982, since:
🐞 bug report
Affected Package
The issue is caused by package @angular/compiler-cli
Is this a regression?
Yes, the previous version in which this bug was not present was: 8.1.2
(But, due to #31322, it only worked on every second change of a template.)
Description
I run ngc in watch mode. Output directory is out-tsc.
Ivy is enabled.
I change a component's template.
ngc says "File change detected. Starting incremental compilation."
However, the template change does not result in an according change in the *.js file in out-tsc directory.
For changes in *.ts files, it works.
🔬 Minimal Reproduction
Example project is at: https://github.com/stefanocke/angular-cli-app-with-rollup
Please run:
npm i
npm run ngc-app-watch
(This is nothing more than running ngc in watch mode, as the title of this bug says.)
Then, change app.component.html and look for app.component.js in tsc-out.
You will see that, although the console says correctly "File change detected. Starting incremental compilation.", nothing has changed in app.component.js.
🌍 Your Environment
Angular Version:
Angular CLI: 8.3.6
Node: 10.16.0
OS: win32 x64
Angular: 9.0.0-next.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, router
Package Version
@angular-devkit/architect 0.900.0-next.6
@angular-devkit/build-angular 0.900.0-next.6
@angular-devkit/build-optimizer 0.900.0-next.6
@angular-devkit/build-webpack 0.900.0-next.6
@angular-devkit/core 9.0.0-next.6
@angular-devkit/schematics 8.3.6
@angular/cli 8.3.6
@ngtools/webpack 9.0.0-next.6
@schematics/angular 8.3.6
@schematics/update 0.803.6
rxjs 6.5.2
typescript 3.5.3
Anything else relevant?
Ivy is enabled
The text was updated successfully, but these errors were encountered: