feat(react): use SSR transform of React Compiler for server envs - #1438
Draft
sapphi-red wants to merge 1 commit into
Draft
feat(react): use SSR transform of React Compiler for server envs#1438sapphi-red wants to merge 1 commit into
sapphi-red wants to merge 1 commit into
Conversation
sapphi-red
commented
Aug 27, 2026
Comment on lines
+96
to
+97
| expect(output.code).toContain('const count = 0') | ||
| expect(output.code).not.toContain('useState(0)') |
Member
Author
There was a problem hiding this comment.
The output looks like
import { jsxs as _jsxs } from "react/jsx-runtime";
export function App(t0) {
const { name } = t0;
const count = 0;
return /* @__PURE__ */ _jsxs("div", { children: [name, count] });
}
Contributor
|
Next has something similar and the one in the react compiler isn't likely directly usable (as in it may not be "production ready" for some edge cases). The agents dug up some history:
Currently it:
|
Contributor
In rsc environment, |
ArnaudBarre
approved these changes
Aug 27, 2026
| expect(output.code).toContain('react/jsx-runtime') | ||
| expect(output.code).not.toContain('react/compiler-runtime') | ||
| expect(output.code).toContain('const count = 0') | ||
| expect(output.code).not.toContain('useState(0)') |
Member
There was a problem hiding this comment.
Suggested change
| expect(output.code).not.toContain('useState(0)') | |
| expect(output.code).not.toContain('useState') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Set
outputMode=ssroption in React Compiler for server environments.This has two problems:
outputMode=ssris probably not meant to be public yet. It's not released in babel one (react/react@4cf770d, react/react@50e7ec8)consumer=serverdoes not necessarily mean SSR. It may be an environment for RSC.I found the option so I thought to fix it but found the problems above so I'm opening this PR as draft to discuss about these problems.