Skip to content

Proposal: ngc for JIT #18664

@trotyl

Description

@trotyl

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Currently most Angular projects are using JIT for development and AOT for production as suggested in JIT in development, AOT in production. This works well in most cases (as AOT compiler not being smart enough), but introduce inconsistency between development and release, like we need to provide different sets of polyfills configuration for them.

But given that:

It's possible to get rid of that problem by using ngc for JIT as well.

Expected behavior

Technically ngc for JIT is already fully supported in current implementation, but it would be better to:

  • Well documented about the process, currently the ngc is hard-coded with AOT process in documentation;
  • Allow angularCompilerOptions to work with extends in tsconfig.json, as we may need to change its setting in different environment;
  • Making Angular CLI to use Angular compiler (but not AOT) in all conditions, and remove Metadata Reflection API entry in polyfills.ts. (AOT should still be made easy to use in all conditions, but not within this proposal);
  • Remove the last dependency of Metadata Reflection API. (Will be a breaking change, should be done in a later version)

(All of the aboves could be made separate proposal if needed.)

Minimal reproduction of the problem with instructions

Nil.

What is the motivation / use case for changing the behavior?

  • Fully remove the dependency of Metadata Reflection API (Unified polyfills);
  • Do not break any JIT or AOT user;
  • Easy to migrate in most build tools.

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions