Skip to content
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: restore support for ASAR #228064

Open
bpasero opened this issue Sep 10, 2024 · 0 comments
Open

ESM: restore support for ASAR #228064

bpasero opened this issue Sep 10, 2024 · 0 comments
Assignees
Labels
confirmed Issue has been confirmed by VS Code Team member debt Code quality issues electron Issues and items related to Electron ESM Issues caused by our AMD => ESM work upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Sep 10, 2024

For ESM we have disabled ASAR but we should investigate bringing it back.

We used to have this code to inject the lookup path:

module.exports.enableASARSupport = function () {
// ESM-comment-begin
// const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
// const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`;
//
// // @ts-ignore
// const originalResolveLookupPaths = Module._resolveLookupPaths;
//
// // @ts-ignore
// Module._resolveLookupPaths = function (request, parent) {
// const paths = originalResolveLookupPaths(request, parent);
// if (Array.isArray(paths)) {
// for (let i = 0, len = paths.length; i < len; i++) {
// if (paths[i] === NODE_MODULES_PATH) {
// paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
// break;
// }
// }
// }
//
// return paths;
// };
// ESM-comment-end
};

But going forward, Electron should expose a way for us to enlist a path as ASAR path so that it can internally handle this as early as possible.

@bpasero bpasero added debt Code quality issues electron Issues and items related to Electron ESM Issues caused by our AMD => ESM work upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Sep 10, 2024
@bpasero bpasero added this to the On Deck milestone Sep 10, 2024
@bpasero bpasero added the confirmed Issue has been confirmed by VS Code Team member label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue has been confirmed by VS Code Team member debt Code quality issues electron Issues and items related to Electron ESM Issues caused by our AMD => ESM work upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants