feat(ivy): add ngcc ivy switch#25238
Conversation
IgorMinar
left a comment
There was a problem hiding this comment.
This seems to be heading in the right direction, but it appears incomplete and as I commented I think we can do this without ngcc rewriting stuff.
I left a bunch of notes. Please respond inline. thanks!
There was a problem hiding this comment.
should this flag also get modified when you turn on the mode?
There was a problem hiding this comment.
who calls this? the developer before the bootstrap?
There was a problem hiding this comment.
I don't see these arrays being filled anywhere. is that left as todo? I assume the decorators would do this. right?
There was a problem hiding this comment.
Why do you need ngcc to rename anything? if the decorators add stuff to the queue and the code just below this line does the compilation then nothing alive in the system refers to the ivy compiler unless you call enableIvyJitCompiler.
Unless I'm looking at this wrong, if you call the method from your app, you get ivy, otherwise ivy is dead code eliminated.
There was a problem hiding this comment.
how will the queues get drained for lazy loaded code?
There was a problem hiding this comment.
what's the relationship between enableIvyBootstrap and enableIvyJitCompiler? when would I use which?
enableIvyBootstrap() and enableIvyJitCompiler() switchngcc ivy switch
IgorMinar
left a comment
There was a problem hiding this comment.
LGTM but please note that CI is currently very unhappy.
|
You can preview a206f5a at https://pr25238-a206f5a.ngbuilds.io/. |
|
@mhevery can you please update the commit message? it still mentions the api that we decided not to expose. |
Provides a runtime and compile time switch for ivy including `ApplicationRef.bootstrapModule`. This is done by naming the symbols such that `ngcc` (angular Compatibility compiler) can rename symbols in such a way that running `ngcc` command will switch the `@angular/core` module from `legacy` to `ivy` mode. This is done as follows: ``` const someToken__PRE_NGCC__ = ‘legacy mode’; const someToken__POST_NGCC__ = ‘ivy mode’; export someSymbol = someToken__PRE_NGCC__; ``` The `ngcc` will search for any token which ends with `__PRE_NGCC__` and replace it with `__POST_NGCC__`. This allows the `@angular/core` package to be rewritten to ivy mode post `ngcc` execution.
|
You can preview c8e9145 at https://pr25238-c8e9145.ngbuilds.io/. |
|
You can preview ada15d0 at https://pr25238-ada15d0.ngbuilds.io/. |
|
You can preview 8204725 at https://pr25238-8204725.ngbuilds.io/. |
|
You can preview 265573a at https://pr25238-265573a.ngbuilds.io/. |
This method will be used to find all the places where the "ivy switch" will occur. See angular#25238
This supports the "ngcc ivy switch" specified in angular#25238.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feat(ivy): add
ngccivy switchProvides a runtime and compile time switch for ivy including
ApplicationRef.bootstrapModule.This is done by naming the symbols such that
ngcc(angularCompatibility compiler) can rename symbols in such a way that running
ngcccommand will switch the@angular/coremodule fromlegacytoivymode.This is done as follows:
The
ngccwill search for any token which ends with__PRE_NGCC__and replace it with
__POST_NGCC__. This allows the@angular/corepackage to be rewritten to ivy mode post
ngccexecution.