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

Next.js sidecar with hooks #155

Closed
wants to merge 48 commits into from
Closed

Next.js sidecar with hooks #155

wants to merge 48 commits into from

Conversation

Kinbaum
Copy link
Contributor

@Kinbaum Kinbaum commented Jul 7, 2020

This example addresses the issue with using hooks in federated components and consuming them in a Next.js application. There is no need to mark React or ReactDOM as external with this example.

jacob-ebey and others added 30 commits June 27, 2020 01:18
* Adding a sidecar to get Rollup to expose header

* Removing package.json
@Kinbaum Kinbaum changed the title build: Initial build of Next.js sidecar with hooks Next.js sidecar with hooks Jul 7, 2020
@ScriptedAlchemy
Copy link
Member

Are you also able to fix the externalized react issue on the original sidecar example?

@Kinbaum
Copy link
Contributor Author

Kinbaum commented Jul 7, 2020

Yes for sure. Would you like me to open another PR for that one, or replace this one with that change?

@ScriptedAlchemy
Copy link
Member

Could the two be merged? showcase hooks and class-based components? It also reduces my maintenance burden as the examples are getting quite long haha

@Kinbaum
Copy link
Contributor Author

Kinbaum commented Jul 7, 2020

Yeah no problem. I'll combine the two examples and submit them as one in this PR. Thanks

@ScriptedAlchemy
Copy link
Member

Appreciate it!

@Kinbaum
Copy link
Contributor Author

Kinbaum commented Jul 7, 2020

@ScriptedAlchemy I have consolidated the examples. Ready for you to check it out.

@CLAassistant
Copy link

CLAassistant commented Jul 8, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 6 committers have signed the CLA.

✅ jacob-ebey
✅ ScriptedAlchemy
✅ Kinbaum
❌ remanation
❌ jherr
❌ hanford
You have signed the CLA already but the status is still pending? Let us recheck it.

@ScriptedAlchemy
Copy link
Member

Will check it out! 🙏

@Kinbaum
Copy link
Contributor Author

Kinbaum commented Jul 8, 2020

@ScriptedAlchemy Something got messed up. I'm gonna close this and reopen a new one that's cleaner.

@Kinbaum Kinbaum closed this Jul 8, 2020
@ScriptedAlchemy
Copy link
Member

thanks

@Ruchika-saini
Copy link

@Kinbaum @ScriptedAlchemy
Is this issue fixed? As I am still facing the issue with hooks.
I am using this package @module-federation/nextjs-mf@2.3.1 in Next JS application to federate a page. But whenever I have React hooks in remote module, I am getting this error "Uncaught Error: Invalid hook call".
Even I have this configuration as well

shared: {
'styled-jsx': {
requiredVersion: false,
singleton: true,
eager: true,
},
react: {
singleton: true,
eager: true,
requiredVersion: false,
},
'react-dom': {
singleton: true,
eager: true,
requiredVersion: false,
},
},

Please help on this issue and clarify if this fix is available in v2.3.1 of @module-federation/nextjs-mf (the latest that is available on the public npm registry).

@ScriptedAlchemy
Copy link
Member

@Ruchika-saini you need the commercial version from privjs registry. Not npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants