Skip to content

Ivy backwards compatible bootstrap - #13382

Merged
kyliau merged 2 commits into
angular:masterfrom
alan-agius4:feat_ivy_backwards_compat
Jan 11, 2019
Merged

kyliau merged 2 commits into
angular:masterfrom
alan-agius4:feat_ivy_backwards_compat

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Jan 8, 2019 •

Copy link
Copy Markdown
Collaborator

feat(@schematics/angular): experimentalIvy should generates backwards compatible solution

Usage:

ng new foo --experimentalIvy

Users will need to use ngcc so to process code coming from NPM and produce the equivalent Ivy version. This needs to be done once after installing the node packages.

node_modules/.bin/ivy-ngcc

ngtsc compilter will then be used when building using the --aot or --prod flag.

feat(@ngtools/webpack): add support for Ivy compatible solution
Ivy compatible solution still uses the 'standard' bootstrapping code, however the difference is that there are no factories.

Using a similar approach for ngc but without factories and instead of bootstrapModuleFactory it uses bootstrapModule.

More context: #13024 (comment)

TODO check with Framework:

  • Confirm that using bootstrapModule is the right approach
  • How to retrieve lazy loaded modules as it seems that listLazyRoutes is not returning anything, - feat(ivy): implement listing lazy routes in ngtsc angular#27697
  • TBD - Should we add ivy-ngcc as a post install script
  • TBD - Should we turn on factory shimming by default in tsconfig via allowEmptyCodegenFiles

Fixes: #13024

@alan-agius4 alan-agius4 changed the title Feat ivy backwards compat Ivy backwards compatible bootstrap Jan 8, 2019
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Jan 8, 2019
@alan-agius4
alan-agius4 requested a review from IgorMinar January 8, 2019 15:43
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

Still need angular/angular#27848 to get prod build working correctly.

@alan-agius4
alan-agius4 requested a review from robwormald January 8, 2019 18:30

@IgorMinar IgorMinar 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.

lgtm! thanks

@alan-agius4

alan-agius4 commented Jan 10, 2019 •

Copy link
Copy Markdown
Collaborator Author

@IgorMinar, 2 questions please:

Should we add ivy-ngcc as a post install script or we leave it up to the user?
Should we turn on factory shimming by default in tsconfig via allowEmptyCodegenFiles?

@IgorMinar

Copy link
Copy Markdown
Contributor

let's try not to turn on factoryShimming and see if we can get away with that without causing too much disruption. It would be better if we avoided factories and left it as a backup option for people that absolutely need them.

ivy-ngcc as a postinstall script sounds good. let's try that.

Alan Agius added 2 commits January 11, 2019 07:46
…ds compatible solution

Usage:
```
ng new foo --experimentalIvy
```

Users will need to use `ngcc` so to process code coming from NPM and produce the equivalent Ivy version. This needs to be done once after installing the node packages.

```
node_modules/.bin/ivy-ngcc
```

`ngtsc` compilter will then be used when building using the `--aot` or `--prod` flag.

Fixes #13024
Ivy compatible solution still uses the 'standard' bootstrapping code, however the difference is that there are no factories.

Using a similar approach for `ngc` but without factories and instead of `bootstrapModuleFactory` it uses `bootstrapModule`.
@alan-agius4
alan-agius4 requested review from filipesilva and removed request for robwormald January 11, 2019 07:02
@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed target: major This PR is targeted for the next major release labels Jan 11, 2019
@kyliau
kyliau merged commit 7347d88 into angular:master Jan 11, 2019
@alan-agius4
alan-agius4 deleted the feat_ivy_backwards_compat branch January 12, 2019 08:40
@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 Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ivy]: experimentalIvy flag generates an app with no change detection

5 participants