Skip to content

Conversation

@frandiox
Copy link
Contributor

Description

With the changes in #1452 and #1473 , Hydrogen is not compatible with the experimental version of React anymore (only stable version) because the getCacheForType method is also implemented in the Fizz/SSR dispatcher.

This PR updates the RSC plugin to inject an isRsc boolean variable in the Flight/RSC dispatcher that we can read later.


Before submitting the PR, please make sure you do the following:

  • Read the Contributing Guidelines
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
  • Update docs in this repository according to your change
  • Run yarn changeset add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

@frandiox frandiox requested a review from a team June 13, 2022 03:14
Copy link
Contributor

@blittle blittle left a comment

Choose a reason for hiding this comment

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

We should maybe provide feedback to React core that there should be a more official way to determine RSC mode vs SSR mode.

Copy link
Contributor

@jplhomer jplhomer left a comment

Choose a reason for hiding this comment

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

Slick. To your point @blittle, I'm guessing this is possible if we switched to use the Node conditions flag (where react-server package exports only execute in the RSC runtime), and we could more cleanly inject some flag or logic at that point. I think we'll end up switching to that in our next iteration.

@frandiox frandiox merged commit 4fde81f into v1.x-2022-07 Jun 14, 2022
@frandiox frandiox deleted the fd-support-react-experimental branch June 14, 2022 07:17
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