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

fix(hydration): force native shadow when synthetic exists #3907

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

nolanlawson
Copy link
Collaborator

@nolanlawson nolanlawson commented Dec 15, 2023

Details

This PR makes it so that, when synthetic shadow DOM is loaded on the page, hydrateComponent still works, but it forces any hydrated components into native mode (since synthetic shadow mode is not supported for SSR+hydration). This means that SSR+hydration+native can work even when synthetic shadow is loaded on the page.

It also adds a test to confirm that this works.

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

@nolanlawson nolanlawson requested a review from a team as a code owner December 15, 2023 23:47
Copy link

@lpomerleau lpomerleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to use this on a page which contains both SSRed and CSRed content, we:

  • include the synthetic shadow polyfill in the base doc
  • set ENABLE_MIXED_SHADOW_MODE to true
    ? Or do we not need mixed shadow mode at all?

@nolanlawson
Copy link
Collaborator Author

@lpomerleau You do not need to set a flag for mixed mode. The current flag is for legacy behavior with static shadowSupportMode = 'any' and should be removed eventually.

Copy link
Contributor

@divmain divmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is unfortunate that synthetic continues to live on. But this PR looks reasonable.

@nolanlawson nolanlawson merged commit 4dceddb into master Feb 5, 2024
9 checks passed
@nolanlawson nolanlawson deleted the nolan/synthetic-in-hydration branch February 5, 2024 18:51
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.

3 participants