You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional Details
I have a large-scale Webpack Module Federation application. It has old React, new React, and even some legacy code. I'm trying to migrate it to Vite or RsPack for a better DX. My migration might show some rough edges in this plugin and I'm happy to try and help with some PRs when I'm used to this code base.
The problem I'm having right now is a blocker because we use this pattern a lot. So I tried creating the most minimal project to reproduce the bug. I also made a README with a step-by-step guide on how to arrive at the faulty state.
Steps to reproduce
Create 2 Vite apps with a basic React template host and counter
Add vite federation plugin to both of them
Expose a simple hook from counter
Add counter as remote in host
Create a new hook in a host file that uses the hook from counter
Use the newly created hook in a component in host.
Use the raw counter hook in a child component.
Hot Reload should not work.
// ./counter/src/useCountexportfunctionuseCounter(){const[count,setCount]=useState(0);return{...}}// ./host/src/useMoreCounterexportfunctionuseMoreCounter(){constcounter=useCounter();
....}// ./host/src/AppexportfunctionApp(){useMoreCounter();return<NotReloadedWhenChanged/>;}// ./host/src/NotReloadedWhenChangedexportfunctionNotReloadedWhenChanged(){// The use of useCounter here will cause the component to not hot reloadconstcounter=useCounter();return<h2>Not Reloaded When Changed</h2>;}
What is Expected?
When the child component changes, the Hot Reload should be triggered and the browser should update its state.
What is actually happening?
The Hot Reload seems to be triggered, but the browser state doesn't update.
The text was updated successfully, but these errors were encountered:
Versions
Reproduction
https://github.com/irwinarruda/vite-federation-hmr
Additional Details
I have a large-scale Webpack Module Federation application. It has old React, new React, and even some legacy code. I'm trying to migrate it to Vite or RsPack for a better DX. My migration might show some rough edges in this plugin and I'm happy to try and help with some PRs when I'm used to this code base.
The problem I'm having right now is a blocker because we use this pattern a lot. So I tried creating the most minimal project to reproduce the bug. I also made a README with a step-by-step guide on how to arrive at the faulty state.
Steps to reproduce
host
andcounter
counter
counter
as remote inhost
host
file that uses the hook fromcounter
host
.counter
hook in a child component.What is Expected?
When the child component changes, the Hot Reload should be triggered and the browser should update its state.
What is actually happening?
The Hot Reload seems to be triggered, but the browser state doesn't update.
The text was updated successfully, but these errors were encountered: