Skip to content

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

Closed
wants to merge 1 commit into from
Closed

feat(@schematics/angular): update compiler options target and module settings #17630

wants to merge 1 commit into from

Conversation

alan-agius4
Copy link
Collaborator

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.

…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.
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label May 5, 2020
@alan-agius4 alan-agius4 added this to the V10-candidates milestone May 5, 2020
@alan-agius4 alan-agius4 requested a review from clydin May 5, 2020 14:09
@alan-agius4 alan-agius4 marked this pull request as ready for review May 5, 2020 14:09
@alan-agius4
Copy link
Collaborator Author

//cc @IgorMinar

@@ -32,7 +32,8 @@ export enum ThresholdSeverity {
}

enum DifferentialBuildType {
ORIGINAL = 'es2015',
// FIXME: this should match the actual file suffix and not hardcoded.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮

Copy link
Contributor

@IgorMinar IgorMinar left a 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",
Copy link
Contributor

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.

Copy link
Collaborator Author

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

See: https://node.green/#ES2018

@@ -126,7 +126,7 @@ describe('bundle-calculator', () => {
{
name: '0',
original: {
filename: 'foo-es2015.js',
filename: 'foo-es2016.js',
Copy link
Contributor

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!).

Copy link
Collaborator Author

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.

@alan-agius4 alan-agius4 removed this from the V10-candidates milestone May 5, 2020
@alan-agius4 alan-agius4 marked this pull request as draft May 5, 2020 14:42
@alan-agius4
Copy link
Collaborator Author

New PR #17637

@angular-automatic-lock-bot
Copy link

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 27, 2020
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.

3 participants