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

Pull dynamic extension loading data from the webpack compilation #8913

Merged
merged 3 commits into from Aug 27, 2020

Conversation

jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Aug 27, 2020

References

Fixes #8842

Code changes

Tweaked the webpack config several ways:

  1. Use the new content hashing algorithm and better default module id generation for file names.
  2. Embed the information needed to load a dynamic extension in the extension's bundled package.json. This means we can change the build process and the generated build metadata will continue to tell the frontend how to load the extension.
  3. Generate a content hash for remoteEntry so it can be cached.

User-facing changes

Hopefully none

Backwards-incompatible changes

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@jasongrout jasongrout added this to In progress in Extension System rework via automation Aug 27, 2020
@jasongrout jasongrout added this to the 3.0 milestone Aug 27, 2020
@jasongrout jasongrout requested review from mnowacki-b and removed request for mnowacki-b August 27, 2020 04:45
@jasongrout
Copy link
Contributor Author

@blink1073 - if we could get this into the beta, that would be great.

@jasongrout
Copy link
Contributor Author

jasongrout commented Aug 27, 2020

I think with this change, we can cache things in the labextensions handler, i.e., delete this line: https://github.com/jupyterlab/jupyterlab_server/blob/0f8bb54c0badc6570ab2263c78fd1141dc316f9a/jupyterlab_server/handlers.py#L293

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one question about the log output

]
})
].concat(extras);

const logPath = path.join(outputPath, 'build_log.json');
fs.writeFileSync(logPath, JSON.stringify(module.exports, null, ' '));
// const logPath = path.join(outputPath, 'build_log.json');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the log? I've used several times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll put in another PR that only saves it in development mode. Does that sound good to you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. There is a conflict here, I'm afk for the next couple hours but I can rebase and release then.

Also, the default module ids in webpack 5 uses deterministic numbers in production mode, so we do not need the HashedModuleIdsPlugin anymore.
@blink1073 blink1073 merged commit 27d1cc6 into jupyterlab:master Aug 27, 2020
Extension System rework automation moved this from In progress to Done Aug 27, 2020
@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 24, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Examples
Projects
Development

Successfully merging this pull request may close these issues.

Make module federation remoteEntry.js use hashes
2 participants