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): @Component should support entry components from another module #29566

Closed
wants to merge 2 commits into from

Conversation

marclaval
Copy link
Contributor

Spotted while analysing failures in ng-bootstrap tests

@marclaval marclaval requested a review from a team as a code owner March 28, 2019 13:51
@@ -158,6 +158,7 @@ function verifySemanticsOfNgModuleDef(moduleType: NgModuleType): void {
const errors: string[] = [];
const declarations = maybeUnwrapFn(ngModuleDef.declarations);
const imports = maybeUnwrapFn(ngModuleDef.imports);
flatten(imports, unwrapModuleWithProvidersImports).forEach(verifySemanticsOfNgModuleDef);

Choose a reason for hiding this comment

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

not: we've got another flatten here:

export function flatten(list: any[]): any[] {

I know that the code duplication was here before but maybe a good occasion to remove it? (just note that the flatten I'm referring to returns a new array instead of writing to the out one - which I find easier to follow!)

@marclaval
Copy link
Contributor Author

Without the fix, the test would fail with:

Message:
    Error: Component OtherComponent is not part of any NgModule or the module has not been imported into your module.
  Stack:
    Error: Component OtherComponent is not part of any NgModule or the module has not been imported into your module.
        at verifySemanticsOfNgModuleDef (packages/core/src/render3/jit/module.ts:183:11)
        at Function.get (packages/core/src/render3/jit/module.ts:132:22)
        at R3TestBedCompiler.applyProviderOverridesToModule (packages/core/testing/src/r3_test_bed_compiler.ts:352:49)
        at R3TestBedCompiler.compileTestModule (packages/core/testing/src/r3_test_bed_compiler.ts:538:10)
        at R3TestBedCompiler.finalize (packages/core/testing/src/r3_test_bed_compiler.ts:228:10)
        at TestBedRender3.get [as testModuleRef] (packages/core/testing/src/r3_test_bed.ts:364:43)
        at TestBedRender3.get (packages/core/testing/src/r3_test_bed.ts:261:25)
        at TestBedRender3.createComponent (packages/core/testing/src/r3_test_bed.ts:330:63)
        at Function.TestBedRender3.createComponent (packages/core/testing/src/r3_test_bed.ts:175:33)
        at UserContext.<anonymous> (packages/core/test/acceptance/component_spec.ts:84:29)

@marclaval marclaval added 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 Mar 28, 2019
@ngbot ngbot bot added this to the needsTriage milestone Mar 28, 2019
Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

LGTM, but please take care of @pkozlowski-opensource comment.

@mhevery mhevery added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Mar 28, 2019
@mhevery
Copy link
Contributor

mhevery commented Mar 28, 2019

@marclaval marclaval removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 24, 2019
@marclaval
Copy link
Contributor Author

@pkozlowski-opensource @mhevery I've updated the PR to remove the code duplication, PTAL

@marclaval marclaval added target: patch This PR is targeted for the next patch release and removed target: major This PR is targeted for the next major release labels Apr 26, 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 action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: presubmit The PR is in need of a google3 presubmit labels Apr 26, 2019
@AndrewKushnir
Copy link
Contributor

Presubmit

@AndrewKushnir AndrewKushnir added target: major This PR is targeted for the next major release target: patch This PR is targeted for the next patch release and removed target: patch This PR is targeted for the next patch release target: major This PR is targeted for the next major release labels Apr 26, 2019
BioPhoton pushed a commit to BioPhoton/angular that referenced this pull request May 21, 2019
@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 15, 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: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants