Skip to content

fix(ivy): explicitly compile ngModuleDef for RootScopeModule in R3TestBed#30037

Closed
AndrewKushnir wants to merge 1 commit intoangular:masterfrom
AndrewKushnir:FW-1280_root_scope_module_compile
Closed

fix(ivy): explicitly compile ngModuleDef for RootScopeModule in R3TestBed#30037
AndrewKushnir wants to merge 1 commit intoangular:masterfrom
AndrewKushnir:FW-1280_root_scope_module_compile

Conversation

@AndrewKushnir
Copy link
Contributor

This commit unifies the way auxiliary RootScopeModule and DynamicTestModule are compiled in R3TestBed by calling compileNgModuleDefs explicitly for RootScopeModule. This change also resolves the problem where TestBed's code was used from the @angular/core NPM package: due to the "jit" flag, the @NgModule decorator on the RootScopeModule was transformed to RootScopeModule.decorators = [...], but actual ngModuleDef was never defined.

This PR resolves FW-1280.

PR Type

What kind of change does this PR introduce?

  • Bugfix

Does this PR introduce a breaking change?

  • Yes
  • No

…tBed

This commit unifies the way auxillary RootScopeModule and DynamicTestModule are compiled in R3TestBed by calling `compileNgModuleDefs` explicitly for RootScopeModule. This change also resolves the problem where TestBed's code was used from the @angular/core NPM package: due to the "jit" flag, the @NgModule decorator on the RootScopeModule was transformed to RootScopeModule.decorators = [...], but actual ngModuleDef was never defined.
@AndrewKushnir AndrewKushnir added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release comp: ivy labels Apr 22, 2019
@AndrewKushnir AndrewKushnir requested a review from a team April 22, 2019 22:49
@ngbot ngbot bot added this to the needsTriage milestone Apr 22, 2019
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kara kara added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 23, 2019
@kara
Copy link
Contributor

kara commented Apr 23, 2019

presubmit

@kara kara added action: presubmit The PR is in need of a google3 presubmit and removed action: presubmit The PR is in need of a google3 presubmit labels Apr 23, 2019
@gkalpak gkalpak mentioned this pull request Apr 23, 2019
16 tasks
@benlesh benlesh closed this in 00ce9aa Apr 23, 2019
gkalpak added a commit to gkalpak/angular that referenced this pull request May 1, 2019
Previously, `R3TestBedCompiler` was dynamically defining an
`@NgModule`-decorated `CompilerModule` class inside a method call.
Since ngcc only processes top-level classes, this class was not
transformed causing failures in unit tests (see angular#30121 for details).

This commit fixes it by using `compileNgModuleDefs()` directly (similar
to the fix in angular#30037).

Fixes angular#30121
kara pushed a commit that referenced this pull request May 1, 2019
…28530)

Previously, `R3TestBedCompiler` was dynamically defining an
`@NgModule`-decorated `CompilerModule` class inside a method call.
Since ngcc only processes top-level classes, this class was not
transformed causing failures in unit tests (see #30121 for details).

This commit fixes it by using `compileNgModuleDefs()` directly (similar
to the fix in #30037).

Fixes #30121

PR Close #28530
kara pushed a commit that referenced this pull request May 1, 2019
…28530)

Previously, `R3TestBedCompiler` was dynamically defining an
`@NgModule`-decorated `CompilerModule` class inside a method call.
Since ngcc only processes top-level classes, this class was not
transformed causing failures in unit tests (see #30121 for details).

This commit fixes it by using `compileNgModuleDefs()` directly (similar
to the fix in #30037).

Fixes #30121

PR Close #28530
BioPhoton pushed a commit to BioPhoton/angular that referenced this pull request May 21, 2019
…tBed (angular#30037)

This commit unifies the way auxillary RootScopeModule and DynamicTestModule are compiled in R3TestBed by calling `compileNgModuleDefs` explicitly for RootScopeModule. This change also resolves the problem where TestBed's code was used from the @angular/core NPM package: due to the "jit" flag, the @NgModule decorator on the RootScopeModule was transformed to RootScopeModule.decorators = [...], but actual ngModuleDef was never defined.

PR Close angular#30037
BioPhoton pushed a commit to BioPhoton/angular that referenced this pull request May 21, 2019
…ngular#28530)

Previously, `R3TestBedCompiler` was dynamically defining an
`@NgModule`-decorated `CompilerModule` class inside a method call.
Since ngcc only processes top-level classes, this class was not
transformed causing failures in unit tests (see angular#30121 for details).

This commit fixes it by using `compileNgModuleDefs()` directly (similar
to the fix in angular#30037).

Fixes angular#30121

PR Close angular#28530
@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 Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes target: major This PR is targeted for the next major release type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants