fix: enable React Compiler for @lifi/widget and @lifi/wallet-management#768
Open
smrnjeet222 wants to merge 1 commit into
Open
fix: enable React Compiler for @lifi/widget and @lifi/wallet-management#768smrnjeet222 wants to merge 1 commit into
smrnjeet222 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: c21414c The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
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.
Which Linear task is linked to this PR?
N/A - outside contributor
Why was it implemented this way?
Enables the React Compiler (
babel-plugin-react-compiler@^1.0.0, target19) across the widget toolchain. The widget already runs on React 19, this PR turns on the compiler's automatic memoization.Wiring
@lifi/widget,@lifi/wallet-management) : added@rolldown/plugin-babel+@babel/coreand registeredbabel-plugin-react-compilerin theirtsdown.config.tsso the compiler runs at publish build time. Consumers receive pre-compiled output and don't need to add the plugin themselves.widget-embedded,widget-playground-vite) : registered the plugin via@vitejs/plugin-react'sbabel.pluginsoption so the playground / iframe host benefit too.knip.json: ignorebabel-plugin-react-compiler(only referenced as a string by Babel, not imported).Picked the
tsdown+@rolldown/plugin-babelroute over swc/oxc because the React Compiler currently ships only as a Babel plugin, running it through Babel during the rolldown build is the supported path and keeps the rest of the pipeline (rolldown/oxc) untouched.Codebase implications (no refactor in this PR)
useMemo/useCallback/React.memo/forwardRefunless there's a measured reason, the compiler handles it.forwardRefis also unnecessary on React 19 (refis a regular prop), same "don't add new ones, clean up later" rule.Visual showcase (Screenshots or Videos)
N/A - build-time change, no runtime/UI behavior change.
Checklist before requesting a review