-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Track extension es6 output migration #68698
Comments
Types that are being extended by functions (this includes only extension code, not code that is in node_modules programmed against vscode-API)
|
Done. Good luck! |
I think your detection method might be flawed and there might actually be more extensions affected. The Haxe extension (naturally) uses Haxe-generated JS, which uses this pattern: vshaxe.view.dependencies.Node = function(parent,label,path,type) {
vscode.TreeItem.call(this,label);
...
}
vshaxe.view.dependencies.Node.prototype = $extend(vscode.TreeItem.prototype,{
...
} Where Haxe defines function $extend(from, fields) {
var proto = Object.create(from);
for (var name in fields) proto[name] = fields[name];
if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
return proto;
}
I'm a bit confused by this - does that mean that with that workaround in place, extensions using ES5 style JS should continue to work fine (but you're looking to remove the compatibility layer soon)? That already seems to not be the case, there's an error when expanding a node in the Haxe Dependencies View with current Insider's Builds (a509265). |
Good catch @Gama11. I obviously don't know all patterns how functions extend classes/function. I have created a tracking item for the haxe extension.
Yes, everything should still work (your code won't load if not) but we are keen on removing the workaround because so few extensions rely on it. |
We have changed our compile to emit ES6 JavaScript, instead of ES5. That means
let
orconst
don't becomevar
etc, it also means that classes are emitted as classes, not as functions.There are extensions that emit ES5 JavaScript and that extend from our API types. The code usually looks like this:
The challenge is that calling a
class
-constructor from afunction
extending it, isn't possible and requires a workaround. We have thees5ClassCompat
-util for that. However, there are only eight extensions that use this pattern and this issue track the migration to emitting ES6 code.Calling static functions using the
new
keyword (see #69533)new vscode.Uri.file
inu1255/vscode-easy-greenjs#1new vscode.Uri.file
Gruntfuggly/todo-tree#133new vscode.TextEdit.replace
mikeburgh/vscode-xml-format#5The text was updated successfully, but these errors were encountered: