Skip to content

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

Merged
merged 1 commit into from
Nov 19, 2019

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Nov 12, 2019

Fix #15856

@filipesilva filipesilva added state: blocked target: patch This PR is targeted for the next patch release labels Nov 12, 2019
// 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()
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@dgp1130
Copy link
Collaborator

dgp1130 commented Nov 19, 2019

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.

@dgp1130
Copy link
Collaborator

dgp1130 commented Nov 20, 2019

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.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"ng serve" doesn't react on changes in d.ts files.
5 participants