-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
targeting es6 as a base (without transpiling to es5) #5902
Comments
To my surprise it caused issues only in browser code, in Node.js es5 classes seem to extend es6 classes without issues. I would leave it out from Monaco migration, could be done separately. |
What does that mean? Would it really be an issue when using
You mean that from es6 we can extend es5 classes? In the browser, TypeScript seems to complain, yet runtime looks fine: playground |
Many VS Code extensions are compiled against es5 if we recompile plugin host types to es6, they won't work. We should make sure that these classes remain es5 compatible. |
Apparently VS Code slightly transforms some classes to be compatible with es5 code while writing es6: https://github.com/microsoft/vscode/blob/15beb36ccf0d70bf26c8e308e17093902b71e927/src/vs/workbench/api/common/extHostTypes.ts#L18-L27 |
I experimented with it on the TS Playground, this |
Related: #6761 |
I am currently looking into this and have a few questions, regarding your comments. Mainly i was wondering what regressions you might expect/experience with |
Motivated by #5901:
There is no issue with supporting es6 in browsers right now, but:
Object.keys
for Theia and inversifyjs. TS compiles it to be compatible withes3
when a target ises5
, notes6
. So switching breaks its semantic. We can fix it though and propose PR for invesifyjs.phosphorjs
transpiled to es5, with es6 code where is no way to extend them with es6 code. We can propose a PR to distribute phosphorjs for different targets or transpile to es6 in our fork.Moving to es6 will reduce amount of generated code and reduce bundle sizes as consequences. Also some features as classes will be implemented natively by browsers.
The text was updated successfully, but these errors were encountered: