Skip to content

Commit

Permalink
feat: add support for react-compiler-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Jan 31, 2025
1 parent e227c81 commit b5d9b4d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion packages/react/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,21 @@ const config: StorybookConfig = {
},
}

config.plugins = [...(config.plugins ?? []), react()]
config.plugins = [
...(config.plugins ?? []),
react({
babel: {
plugins: [
[
'babel-plugin-react-compiler',
{
target: '18',
},
],
],
},
}),
]

return config
},
Expand Down
6 changes: 6 additions & 0 deletions packages/react/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ function replacementPlugin(env) {

const sharedPlugins = [
'macros',
[
'babel-plugin-react-compiler',
{
target: '18',
},
],
'dev-expression',
'add-react-displayname',
'babel-plugin-styled-components',
Expand Down
2 changes: 2 additions & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"hsluv": "1.0.1",
"lodash.isempty": "^4.4.0",
"lodash.isobject": "^3.0.2",
"react-compiler-runtime": "19.0.0-beta-27714ef-20250124",
"react-intersection-observer": "^9.4.3",
"react-is": "^18.2.0",
"styled-system": "^5.1.5"
Expand Down Expand Up @@ -159,6 +160,7 @@
"babel-plugin-dev-expression": "0.2.3",
"babel-plugin-macros": "3.1.0",
"babel-plugin-open-source": "1.3.4",
"babel-plugin-react-compiler": "19.0.0-beta-27714ef-20250124",
"babel-plugin-styled-components": "2.1.4",
"babel-plugin-transform-replace-expressions": "0.2.0",
"babel-polyfill": "6.26.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ const baseConfig = {
],
plugins: [
'macros',
[
'babel-plugin-react-compiler',
{
target: '18',
},
],
'add-react-displayname',
'dev-expression',
'babel-plugin-styled-components',
Expand Down

0 comments on commit b5d9b4d

Please sign in to comment.