-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@schematics/angular): update compiler options target and module settings #17630
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
Conversation
…settings With this change we update the target and module settings of various compilation units. - We replace ES5 target in protractor. Protractor runs on Node.Js which support ES2018 - For applications we now use `ES2020` instead of `ESNext` as a module to avoid unexpected changes in behaviour - For application we now use `ES2016` as a syntax target instead of `ES2015` This changes also adds a migration to update existing projects and also removes `module` from the Universal tsconfig as per #17352 to enable lazy loading on the server.
//cc @IgorMinar |
@@ -32,7 +32,8 @@ export enum ThresholdSeverity { | |||
} | |||
|
|||
enum DifferentialBuildType { | |||
ORIGINAL = 'es2015', | |||
// FIXME: this should match the actual file suffix and not hardcoded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soo.. I'm terribly sorry about this, but as I mentioned in one of the comments we can't land target=es2016 part of this PR (which is ironically most of this PR). I'm sorry. It's simply too disruptive and we need more time to evaluate the full impact of renaming the files in the dist/.
Can you please extract the modules=es2020 part of this PR into a new PR and let's land that one in v10, and keep this PR open and plan on getting this in v11.
Thanks for understanding.
@@ -3,7 +3,7 @@ | |||
"compilerOptions": { | |||
"outDir": "../out-tsc/e2e", | |||
"module": "commonjs", | |||
"target": "es5", | |||
"target": "es2018", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you verified that the oldest version of node that we support is compatible with full es2018? I think it might be but I'm not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The oldest Node version that we support is 10.13.x
, it seems that the only thing which is not supported is https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
@@ -126,7 +126,7 @@ describe('bundle-calculator', () => { | |||
{ | |||
name: '0', | |||
original: { | |||
filename: 'foo-es2015.js', | |||
filename: 'foo-es2016.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh uh. I didn't realize that we will start renaming the files in dist/ as well. Hmm. This file rename will break a lot of stuff in angular/angular (e.g size tracking) and invalidate docs guides.
Let's back off on the es2016 change and keep only the modules change.
In v11 we can create a proper plan for target=es2016 or maybe even higher (zones!).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might want to name the files something more generic maybe instead of the syntax version.
New PR #17637 |
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. |
With this change we update the target and module settings of various compilation units.
ES2020
instead ofESNext
as a module to avoid unexpected changes in behaviourES2016
as a syntax target instead ofES2015
This changes also adds a migration to update existing projects and also removes
module
from the Universal tsconfig as per #17352 to enable lazy loading on the server.