Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Test with an extension chain #5

Closed
blink1073 opened this issue Jul 7, 2020 · 7 comments · Fixed by jupyterlab/jupyterlab#8847
Closed

Test with an extension chain #5

blink1073 opened this issue Jul 7, 2020 · 7 comments · Fixed by jupyterlab/jupyterlab#8847

Comments

@blink1073
Copy link
Contributor

Make sure that we can have one extension depend on something provided by another. The classic use case is a Jupyter widget that depends on the widget manager, but we can test something similar.

@blink1073
Copy link
Contributor Author

Minimal repro (perhaps):

  • Package has two JS files

  • Shares itself as { requiredVersion: ~data.version }

  • Entry point loads the second JS file

  • remoteEntry.js should register() both files

More basic, I should be able to register myself even if I have one module.
In the shared config, I should be able to give my own top level name, and see it registered in remoteEntry.js

@blink1073
Copy link
Contributor Author

cf webpack/webpack#10352 (comment)

Worst case is that extensions have to be different npm packages from token providers.

@blink1073
Copy link
Contributor Author

blink1073 commented Jul 22, 2020

Big hammer workaround:

  • Create a new npm package on the fly
  • Use the metadata and dependencies from the source package
  • Have it link to the source package and share its index and also bootstrap its extension entry point
  • Run the webpack build against this new package

@blink1073
Copy link
Contributor Author

I'm going to set this aside for now and focus on #20

@jasongrout
Copy link
Contributor

Big hammer workaround:

Just came up with this thought too. I also think this would work around the issue. Glad to see you thought of it a few days ago :).

@jasongrout
Copy link
Contributor

cf also the repo to reproduce the issue: https://github.com/blink1073/module-federation-share-self

@blink1073
Copy link
Contributor Author

blink1073 commented Jul 31, 2020

Next steps:

  • Import the middle package token here and add a console.log of middleToken here
  • Update the logic in webpack.config.ext.js to:
    • Create a package in the target build directory
    • Add a file path dependency on the source package
    • Use the dependencies and metadata from the source package
    • Create an entry point and bootstrap file
    • Target that entry point for the build
  • Build and launch the app and make sure the console log says "hello"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants