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

Ivy backwards compatible bootstrap #13382

Merged
merged 2 commits into from Jan 11, 2019

Conversation

Projects
None yet
5 participants
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jan 8, 2019

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, - angular/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

@googlebot googlebot added the cla: yes label Jan 8, 2019

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch from 25a9495 to d0745db Jan 8, 2019

@alan-agius4 alan-agius4 changed the title Feat ivy backwards compat Ivy backwards compatible bootstrap Jan 8, 2019

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch from d0745db to 00630ce Jan 8, 2019

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch 2 times, most recently from 6e83d91 to 5f769c1 Jan 8, 2019

@alan-agius4 alan-agius4 requested a review from IgorMinar Jan 8, 2019

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch 2 times, most recently from b6e22f6 to 03a2f26 Jan 8, 2019

@alan-agius4

This comment has been minimized.

Copy link
Collaborator

alan-agius4 commented Jan 8, 2019

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

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch from 03a2f26 to 4b9f1e8 Jan 8, 2019

@alan-agius4 alan-agius4 requested a review from robwormald Jan 8, 2019

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch 2 times, most recently from 49de7c4 to c4ab6c5 Jan 8, 2019

@IgorMinar
Copy link
Member

IgorMinar left a comment

lgtm! thanks

@alan-agius4

This comment has been minimized.

Copy link
Collaborator

alan-agius4 commented Jan 10, 2019

@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

This comment has been minimized.

Copy link
Member

IgorMinar commented Jan 10, 2019

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-agius4 added some commits Jan 8, 2019

feat(@schematics/angular): `experimentalIvy` should generates backwar…
…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
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`.

@alan-agius4 alan-agius4 force-pushed the alan-agius4:feat_ivy_backwards_compat branch from c4ab6c5 to 3f3d40d Jan 11, 2019

@alan-agius4 alan-agius4 requested review from filipesilva and removed request for robwormald Jan 11, 2019

@kyliau kyliau merged commit 7347d88 into angular:master Jan 11, 2019

13 checks passed

ci/angular: merge status All checks passed!
ci/angular: size cli/new-production/test-project/polyfills.js increased by 3.51KB.
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build-bazel Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli Your tests passed on CircleCI!
Details
ci/circleci: e2e-node-8 Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test-large Your tests passed on CircleCI!
Details
ci/circleci: validate Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@alan-agius4 alan-agius4 deleted the alan-agius4:feat_ivy_backwards_compat branch Jan 12, 2019

filipesilva added a commit to filipesilva/ivy-bundle-size that referenced this pull request Jan 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment