-
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
ESM rollout plan #226260
Comments
ESM code changes landed in |
ℹ moving to October just to have it off the current milestone, plan is still as it was proposed. |
VS Code stable |
Closing, it looks like ESM has not caused regressions in our stable release. We will move https://vscode.dev to use ESM only in early November (https://insiders.vscode.dev is already serving ESM). The AMD-ESM bridge is still maintained for as long as we have to. As for the Monaco editor release: the plan is to ship a ESM release including localization support soon. |
Refs: #160416
Synopsis
We are now able to build a ESM variant of VS Code with a build flag that will run a migration script (
node migrate.mjs
). This script convertssrc
into a ESM compatible format, specifically:.js
suffix (for exampleimport { untildify } from '../../../../base/common/labels.js';
)vs/css!
loader plugin removed (for exampleimport './media/anythingQuickAccess.css';
)// ESM-comment-begin
/// ESM-comment-end
block gets commented out// ESM-uncomment-begin
/// ESM-uncomment-end
block gets commented inpackage.json
with{"type": "module"}
is added tosrc
folder to mark it as ESM (this is temporary)tsconfig.base.json
compiler options are changed to havees2022
asmodule
The migration ends up with around 3862 outgoing changes that we would like to bring to
main
in a single commit to mark the beginning of ESM and end of AMD.Note: these changes are purely transformations, they are not removing any AMD related pieces from our source tree.
AMD Compatibility
We are aware that this transition comes with risks, so we will have support to convert back from ESM to AMD with a new migration script that we can run on-demand. The idea is that we should always be able to build the current state of
main
in AMD to have a recovery option, especially when we come to release this to stable.This script will:
.js
suffix which our AMD loader does not understandvs/css!
to CSS importssrc/package.json
that was addedtsconfig.base.json
back toamd
asmodule
Web: ESM-to-AMD Bridge
We are also aware that upstream components depend on our web standalone deliverable where moving to ESM is not an option right now. For that purpose we will ship our web standalone bits in an AMD compatible way. We will host this solution on vscode.dev for selfhosting.
Impact on PRs and Branches
Once the migration has run on
main
, we will enforce certain ESM related rules via ESLint, for example all imports have to be relative and have a file extension.All opened PRs and branches will still run in the old format. We have to manually go into these and update them with
main
to get the ESLint checks in place so that a transformation can be done on the PRs as needed.Monaco Editor
We ship the Monaco editor as AMD and ESM already for a long time. We should be able to ship the Monaco editor in a AMD compatible way, even if ESM is our only choice by providing a wrapper script. We can also decide to discontinue support for AMD and only ship a ESM variant (aka Monaco Editor
1.0
).Timeline
Our goal is to ship ESM enabled insiders in September and stable in October. Our goal is to do this with minimal disruption of engineering.
release/1.93
butmain
will remain closed for the ESM merge>3k
changes lands inmain
enabling ESM and new ESLint rulesmain
is declared open for September work1.93.x
as AMD to the world1.94.x
as ESM to the world1.94.x
as ESM to the worldThe text was updated successfully, but these errors were encountered: