-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Description
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:
- Angular have removed all the dependency of Metadata Reflection API in all Decorators (d9d00bd, fcadbf4, cac130e), making the tsc
emitDecoratorMetadatathe only place using it. (Which will still be consumed by Angular compiler); - Angular compiler has been fully refactored by using TypeScript transformer API for compilation process (8054adf, e772479, 679608d, 27d901a), it would be easy to integrate
ngcwith other build tools (support custom transformers for ts 2.3 TypeStrong/ts-loader#535, getCustomTransformers s-panferov/awesome-typescript-loader#418); - Angular compiler already supports metadata-only / non-AOT mode (
skipTemplateCodegen), making it compatible with JIT process.
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
ngcis hard-coded with AOT process in documentation; - Allow
angularCompilerOptionsto work withextendsintsconfig.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
Labels
No labels