Skip to content
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

fix(ivy): avoid using stale cache in TestBed if module overrides are defined #33787

Closed

Conversation

@AndrewKushnir
Copy link
Contributor

AndrewKushnir commented Nov 13, 2019

NgModule compilation in JIT mode (that is also used in TestBed) caches module scopes on NgModule defs (using transitiveCompileScopes field). Module overrides (defined via TestBed.overrideModule) may invalidate this data by adding/removing items in declarations list. This commit forces TestBed to recalculate transitive scopes in case module overrides are present, so TestBed always gets the most up-to-date information.

This PR resolves #33735.

PR Type

What kind of change does this PR introduce?

  • Bugfix

Does this PR introduce a breaking change?

  • Yes
  • No
@ngbot ngbot bot modified the milestone: needsTriage Nov 13, 2019
@googlebot googlebot added the cla: yes label Nov 13, 2019
@AndrewKushnir AndrewKushnir marked this pull request as ready for review Nov 13, 2019
@AndrewKushnir AndrewKushnir requested a review from angular/fw-core as a code owner Nov 13, 2019
@alxhub
alxhub approved these changes Nov 13, 2019
…defined

NgModule compilation in JIT mode (that is also used in TestBed) caches module scopes on NgModule defs (using `transitiveCompileScopes` field). Module overrides (defined via TestBed.overrideModule) may invalidate this data by adding/removing items in `declarations` list. This commit forces TestBed to recalculate transitive scopes in case module overrides are present, so TestBed always gets the most up-to-date information.
@AndrewKushnir AndrewKushnir force-pushed the AndrewKushnir:testbed_override_module branch from fb1f3bc to 4aa04de Nov 19, 2019
@AndrewKushnir

This comment has been minimized.

Copy link
Contributor Author

AndrewKushnir commented Nov 19, 2019

@alxhub alxhub closed this in fd83d94 Nov 20, 2019
alxhub added a commit that referenced this pull request Nov 20, 2019
…defined (#33787)

NgModule compilation in JIT mode (that is also used in TestBed) caches module scopes on NgModule defs (using `transitiveCompileScopes` field). Module overrides (defined via TestBed.overrideModule) may invalidate this data by adding/removing items in `declarations` list. This commit forces TestBed to recalculate transitive scopes in case module overrides are present, so TestBed always gets the most up-to-date information.

PR Close #33787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.