-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@ngtools/webpack): fix rebuilds for transitive and global type deps #16164
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
Conversation
a611d2e
to
49cec47
Compare
49cec47
to
b9e00b6
Compare
// Start all the source file names we care about. | ||
// Ignore matches to the regexp above, files we've already reported once before, and | ||
// node_modules. | ||
const sourceFiles = program.getSourceFiles() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be simpler to do something like?
this._typeDeps = newTsProgram
.getSourceFiles()
.filter(sf => sf.isDeclarationFile)
.map(({ fileName }) => fileName);
in _createOrUpdateProgram
which would also result for this fix to be available for VE compilations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried adding this at the end of the _createOrUpdateProgram
method:
console.log(newTsProgram!
.getSourceFiles()
.filter(sf => sf.isDeclarationFile && !sf.fileName.includes('node_modules'))
.map(({ fileName }) => fileName))
Then I ran this test. It logged the following:
[ 'D:/work/cli/tests/angular_devkit/build_angular/test-project-host-hello-world-app-moqnlwoki9/src/typings.d.ts' ]
[ 'D:/work/cli/tests/angular_devkit/build_angular/test-project-host-hello-world-app-moqnlwoki9/src/typings.d.ts' ]
[ 'D:/work/cli/tests/angular_devkit/build_angular/test-project-host-hello-world-app-moqnlwoki9/src/typings.d.ts' ]
[ 'D:/work/cli/tests/angular_devkit/build_angular/test-project-host-hello-world-app-moqnlwoki9/src/typings.d.ts' ]
[ 'D:/work/cli/tests/angular_devkit/build_angular/test-project-host-hello-world-app-moqnlwoki9/src/typings.d.ts' ]
The typings only file was detected, but not the interface files.
There's a merge conflict attempting to get this into the 9.0.x patch branch. It seems a commit got missed in #16148, I'm following up there and once someone confirms, I will include that and merge this PR as well. |
Confirmed that the extra commit in #16148 was an oversight. Merged that into the patch branch 9.0.x and was now able to merge this PR to it as well without any conflicts. |
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. |
Fix #15856