-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Fix/prerender hydration #895
Conversation
🦋 Changeset detectedLatest commit: ac05e3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: 0 B Total Size: 6.31 kB ℹ️ View Unchanged
|
There's a couple of flakey tests that seem to be taking turns on failing, reran the CI a few times now with no luck. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, we never actually finished making this change.
The idea was that isodata
should be specific to preact-iso
(though there's not currently an API exposed for generating it). WMR should also inject data into a script if given result.data
, but it needs to use a different name.
My preference:
<script type="wmrdata"></script>
gets appended to HTML by WMR ifresult.data
is provided.preact-iso
'sprerender()
appends<script type="isodata"></script>
to the HTML it generates.preact-iso
'shydrate()
usesscript[type="isodata"]
to trigger hydration.
That makes sense. Should be corrected now, assuming I'm not missing something. CI gods finally graced me with a pass too. |
Hydration vs rendering is determined by whether
script[type=isodata]
can be found, however, #585 limited this to only existing when returning prerender data.I attempted to pick through the slack as noted here , though I'm still not sure I haven't missed something that would indicate this is intentional, so let me know. This just seemed like the simplest solution to bring this up with.
If we don't want
preact-iso
to returnisodata
we'll probably need some other marker to decide whether to hydrate or not?