-
Notifications
You must be signed in to change notification settings - Fork 12k
Different handling of EcmaScript version specific features in JS and TS code #23126
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
Comments
Javascript code is only down levelled when targeting ES5. I think while this is confusing and probably should be changed for consistence. It's important to point out that Chrome 83 is not a supposed browser. See https://angular.io/guide/browser-support |
Is this documented somewhere?
Yes, I think so, because for me it's a bug that JS and TS behave differently.
I know :) Just wanted to explain, how we detected it. |
We discussed this during our yesterday's meeting and we agreed that this is inconsistent and there is no standard for library authors to ship their library in different ES versions. Therefore, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. The TypeScript |
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targetting ES 5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES 5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES 5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES 5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES 5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES 5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…he browserlist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…browserslist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…browserslist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…browserslist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes angular#23126
…browserslist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes #23126
…browserslist configurations There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports. With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5. The TypeScript target option will not effect how the libraries get downlevelled. Closes #23126 (cherry picked from commit cd2250f)
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. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
I don't know.
Description
I have a problem with Logical OR assignments:
When I use a Logical OR assignment in a TypeScript file and compile it with Angular Cli it is converted from
a ||= b
toa || (a = b)
up to ES2020. With ES2021 it stays unchanged.If such a Logical OR assignment is used in a JS lib (in my case pdfjs-dist) it is converted until ES5, but from ES6/ES2015 on it stays unchanged.
ES5

ES2015

The browserlist setting seem's to have no impact.
🔬 Minimal Reproduction
Create a plain Angular project, install a lib that contains a logical or assignment like pdfjs-dist, play around with the target property in tsconfig.json.
🔥 Exception or Error
Generated TS and JS code differs in usage of EcmaScript features. We detected it, because we have used an older Chrome version (83) for testing, which suddenly failed, because the
||=
was unkown.🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: