-
Notifications
You must be signed in to change notification settings - Fork 29.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
Explore AMD to ESM migration #160416
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Hey @jrieken where would this leave extensions? Would there be a path for them to export esm? I believe right now they still export to commonjs because electron does not support esm |
@jasonwilliams For now extensions aren't affected by this and for the time being commonjs is how they roll. Tho, I am learning a ton and there will be a path for ESM extensions. We ignore this to keep this already large effort smaller. Also, if you wonder why this is complex: when extensions call |
@jrieken thanks for your response on this, looking forward to seeing what solution you come up with. I agree keeping extensions out makes things a lot easier.
Would import maps not help with this? Extensions already don’t bundle “vscode” and leave it as an external reference. |
Yeah, import maps is our only viable option for this. Fingers crossed for Safari landing this in time for us |
If Safari doesn't support this, is core team blocked by the few months it takes for browser updates to percolate to userland? See Google Chrome 110 popularity vs Google Chrome 109 here: https://www.stetic.com/market-share/browser/ |
Thanks for the insights, maybe I am missing something but in the |
Thanks for the reply. I thought it might still be required, e.g. when an extension uses But I think you're also right that the same issue applies to the amdX loader. Before, A possible workaround could be to manually overwrite the jschardet code: var $jscomp = { scope: {}, global: globalThis }, // change here
Symbol;
$jscomp.initSymbol = function () {
$jscomp.global.Symbol || (Symbol = $jscomp.Symbol);
$jscomp.initSymbol = function () {};
}; |
We fake |
@SimonSiefke The I didn't get to the bottom of this yet, it is a really weird error. Things work when using the non-minified version which I'll do for now |
@jrieken you're right. It looks like It seems only the |
With xtermjs/xterm.js#5092 xterm.js now ships an ESM module. |
Re For now I think its OK to use the non-minified release. Eventually we should consider to minify all our node module dependencies in our pipeline and not depend on how others do it. Reported as aadsm/jschardet#97 |
After meeting with @jrieken some next steps and notes. Active:
Up for Grabs:
Done:
|
🚀 Developing locally from
Tests in ESM:
|
And we are happy for people willing to test our VS Code exploration builds that run with ESM. These builds can be side-by-side installed to VS Code and will update daily like insiders:
Feel free to report any issues you see, thanks! |
We have finished the majority of this work and this issue is closed with 2 follow up issues: Thanks for being patient with us 🙏 |
The VS Code project uses AMD (asynchronous module definition) which is somewhat of a pre-runner of native JS modules (ESM). AMD is mostly dead technology and we should migrate away from it. Our TypeScript sources are written with ESM imports/exports but we took a few dependencies on AMD as a "runtime" and we need to understand what it takes to move towards ESM.
High-level topics:
require.toUrl
to locate sibling resources, like images, this needs to migrate ontoimport.meta.url
Backlog Plan: #160416 (comment)
Test Builds that run on ESM:
The text was updated successfully, but these errors were encountered: