Hydration fails when a component is used on multiple pages
See original GitHub issueVersion: 1.1.0-next.3
Steps to reproduce
- Render a hydrated component on multiple pages
- Build/serve
- Load in browser
Expected behavior
The component will hydrate on each page.
Observed behavior
No JS is loaded at all.
Apparent cause
Any shared component with hydration is bundled as a shared chunk, but the shared chunk is excluded from hydrateBindings
, and doesn’t appear to be referenced anywhere else. If I comment out that check it does hydrate as expected.
I was tempted to offer a PR removing that check, but I can’t shake the feeling that there’s a reason it’s there and the intent was to handle that case differently.
Related side note: in terms of contribution, my usual approach is to write a failing test exercising my bug, then fix to make the test pass. But at present Microsite doesn’t appear to have a test suite. Is that something you’d be interested in? If so do you have a preferred test framework? I’d be happy to look into setting up CI for any tests I contribute, and to try to increase coverage as I contribute.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:16 (5 by maintainers)
Without getting too hung up on the big testing question, I strongly suspect the resolution of this is pretty simple:
Great news! I got a little proof of concept with Estrella working, and goodness it is fast! And it took very little fuss to get going. I’m going to clean up some mess, setup a GitHub Action, and push up a PR. It’s not a huge diff, but I think I’d like to keep test setup separate from fixing this issue to get a meaningful win. Hopefully ready within the hour!