Skip to content

refactor(compiler-cli): implement ɵɵngDeclareNgModule and ɵɵngDeclareInjector - #41080

Closed
petebacondarwin wants to merge 10 commits into
angular:masterfrom
petebacondarwin:linker-ngmodule
Closed

petebacondarwin wants to merge 10 commits into
angular:masterfrom
petebacondarwin:linker-ngmodule

Conversation

@petebacondarwin

Copy link
Copy Markdown
Contributor

This commit changes the partial compilation so that it outputs declaration
calls rather than definition calls for NgModules and Injectors.

The JIT compiler and the linker are updated to be able to handle these
new declarations.


This sits on top of #41022 so only commits after refactor(compiler-cli): implement ɵɵngDeclareNgModule and ɵɵngDeclareInjector need to be considered.


Note that this creates a new LinkerOption called linkerJitMode, which I think needs to be made available on tsconfig.json angularCompilerOptions. Open for discussion.

@google-cla google-cla Bot added the cla: yes label Mar 4, 2021
@petebacondarwin petebacondarwin added compiler: linker refactoring Issue that involves refactoring or code-cleanup state: WIP target: patch This PR is targeted for the next patch release labels Mar 4, 2021
@petebacondarwin
petebacondarwin marked this pull request as ready for review March 5, 2021 18:15
@pullapprove
pullapprove Bot requested a review from AndrewKushnir March 5, 2021 18:15
@petebacondarwin petebacondarwin added action: review The PR is still awaiting reviews from at least one requested reviewer state: blocked and removed state: WIP labels Mar 5, 2021
@petebacondarwin

petebacondarwin commented Mar 5, 2021 •

Copy link
Copy Markdown
Contributor Author

This PR is blocked on top of #41022

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed-for: public-api
Reviewed-for: size-tracking

The only file affected by the change from the public-api standpoint: goldens/public-api/core/core.d.ts

(similar to #41022)

@pullapprove
pullapprove Bot requested a review from IgorMinar March 8, 2021 17:48

@jessicajaniuk jessicajaniuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a couple of nits / questions, but otherwise looks good. LGTM!

reviewed-for: public-api

@petebacondarwin
petebacondarwin force-pushed the linker-ngmodule branch 2 times, most recently from 16e1812 to 2396157 Compare March 9, 2021 10:40
@AndrewKushnir

Copy link
Copy Markdown
Contributor

Presubmit.

@AndrewKushnir AndrewKushnir added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: presubmit The PR is in need of a google3 presubmit labels Mar 15, 2021
@AndrewKushnir

Copy link
Copy Markdown
Contributor

FYI, presubmits are successful for the changes in this PR.

Note to Caretaker: GitHub UI and NgBot indicate 3 pending code reviews, but it looks like everyone on that list already reviewed and approved these changes, so this PR should be ready to go.

…n()`

By consistently using the `DefinitionMap` class there is no longer
any need for the `mapToMapExpression()` function.
This function is declared in multiple places. The instances inside
`compiler` are slightly different to those in `compiler-cli`. So this
commit consolidates them into two reusable functions.
…rface

All interfaces that extend `R3PartialDeclaration` require a `type`
property so it makes sense to put it in the base interface.
These functions are not used so can be removed.
There were a number of almost identical interfaces used in
the same way throughout the Render3 compiler code.
This commit changes the compiler to use the same interface
throughout.
…areInjector`

This commit changes the partial compilation so that it outputs declaration
calls rather than definition calls for NgModules and Injectors.

The JIT compiler and the linker are updated to be able to handle these
new declarations.
@jessicajaniuk

Copy link
Copy Markdown
Contributor

There are conflicts with 11.2.x branch. So this has been rebased and CI is re-running. I'll try to merge again after CI finishes, but we might need a patch-only PR.

@jessicajaniuk

Copy link
Copy Markdown
Contributor

@petebacondarwin The merge conflicts with 11.2.x still exist after rebase. I'm switching this to target: minor and merging. Please create a patch-only PR to get this fully merged into 11.2.x.

@jessicajaniuk jessicajaniuk added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Mar 15, 2021
jessicajaniuk pushed a commit that referenced this pull request Mar 15, 2021
This function is declared in multiple places. The instances inside
`compiler` are slightly different to those in `compiler-cli`. So this
commit consolidates them into two reusable functions.

PR Close #41080
jessicajaniuk pushed a commit that referenced this pull request Mar 15, 2021
…rface (#41080)

All interfaces that extend `R3PartialDeclaration` require a `type`
property so it makes sense to put it in the base interface.

PR Close #41080
jessicajaniuk pushed a commit that referenced this pull request Mar 15, 2021
These functions are not used so can be removed.

PR Close #41080
jessicajaniuk pushed a commit that referenced this pull request Mar 15, 2021
There were a number of almost identical interfaces used in
the same way throughout the Render3 compiler code.
This commit changes the compiler to use the same interface
throughout.

PR Close #41080
jessicajaniuk pushed a commit that referenced this pull request Mar 15, 2021
…areInjector` (#41080)

This commit changes the partial compilation so that it outputs declaration
calls rather than definition calls for NgModules and Injectors.

The JIT compiler and the linker are updated to be able to handle these
new declarations.

PR Close #41080
jessicajaniuk pushed a commit that referenced this pull request Mar 15, 2021
@petebacondarwin

Copy link
Copy Markdown
Contributor Author

Thanks @jessicajaniuk - since the next PR in the sequence is major-only anyway, and all PRs following that one will only go in major, there is not much benefit in this one landing in patch by itself. So I think we are good.

@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Apr 15, 2021
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 area: compiler Issues related to `ngc`, Angular's template compiler cla: yes compiler: linker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note refactoring Issue that involves refactoring or code-cleanup target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants