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

add experimental module federation support #11125

Closed
wants to merge 4 commits into from

Conversation

hasanayan
Copy link
Contributor

@hasanayan hasanayan commented Jun 19, 2021

I re-enabled @raix's code to enable module-federation and added the necessary changes to the webpack config. Tested the changes by making the same modifications using craco in apps that both run as standalone or remote apps and it works fine.

With this PR, to enable Module Federation, you'll need a file named .modulefederationrc.js which exports ModuleFederationPlugin parameters as json.

const deps = require("./package.json").dependencies;

module.exports = {
  name: "my_app",
  exposes: {
    "./App": "./src/App",
  },
  filename: "remoteEntry.js",
  shared: {
    ///...
  }
}

@facebook-github-bot
Copy link

Hi @hasanayan!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@hasanayan hasanayan changed the title added module federation support add experimental module federation support Jun 19, 2021
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@hasanayan
Copy link
Contributor Author

hasanayan commented Jun 21, 2021

if anyone is interested in testing things in an app, just put these in package.json dependencies and hit npm install.

    "react-error-overlay": "^6.0.9",
    "react-scripts": "https://gitpkg.now.sh/hasanayan/create-react-app/packages/react-scripts?wp5-module-federation",

you'll need a file named .modulefederationrc.js which exports ModuleFederationPlugin parameters as json.

const deps = require("./package.json").dependencies;

module.exports = {
  name: "my_app",
  exposes: {
    "./App": "./src/App",
  },
  filename: "remoteEntry.js",
  shared: {
///...
}}

@hasanayan hasanayan mentioned this pull request Jun 21, 2021
25 tasks
@hasanayan
Copy link
Contributor Author

@ianschmitz @mrmckeb can we get this into wp5 branch before #11201 merged into main?

@raix
Copy link
Contributor

raix commented Jul 21, 2021

@hasanayan Im wondering why only 7 checks have run, should be 15 (seems like integration tests have not run)

(I would be pro merging this, would like to review and qa locally - feature is marked experimental and only active if configured so low risk/impact)

@hasanayan
Copy link
Contributor Author

@raix I have no idea why there are missing checks, should I re-create the source branch from create-react-app/wp5 ?

@hasanayan
Copy link
Contributor Author

Opened another PR (#11241) for the same purpose since some checks are missing in this one

@hasanayan hasanayan closed this Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants