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

feat(eslint-plugin-react-hooks): merge rule from eslint-plugin-react-compiler into react-hooks plugin #32416

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

michaelfaith
Copy link
Contributor

@michaelfaith michaelfaith commented Feb 18, 2025

This change merges the react-compiler rule from eslint-plugin-react-compiler into the eslint-plugin-react-hooks plugin. In order to do the move in a way that keeps commit history with the moved files, but also no remove them from their origin until a future cleanup change can be done, I did the git mv first, and then recreated the files that were moved in their original places, as a separate commit. Unfortunately GH shows the moved files as new instead of the ones that are truly new. But in the IDE and git blame, commit history is intact with the moved files.

Since this change adds new dependencies, and one of those dependencies has a higher engines declaration for node than what the plugin currently has, this is technically a breaking change and will have to go out as part of a major release.

Related Changes

@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from 185347d to bf841c6 Compare February 19, 2025 22:49
@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from bf841c6 to 0b1f3a0 Compare February 19, 2025 23:08
@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from 0b1f3a0 to 1e2d02b Compare February 19, 2025 23:57
@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from 1e2d02b to dfd79bd Compare February 20, 2025 00:20
michaelfaith added a commit to michaelfaith/react that referenced this pull request Feb 22, 2025
In preparation for the merging of the compiler plugin into this one (facebook#32416), this change proactively updates the plugin's `engines` declaration to require Node versions greater than or equal to 18

BREAKING CHANGE
michaelfaith added a commit to michaelfaith/react that referenced this pull request Feb 22, 2025
In preparation for the merging of the compiler plugin into this one (facebook#32416), this change proactively updates the plugin's `engines` declaration to require Node versions greater than or equal to 18

BREAKING CHANGE
@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from 5261b0f to f920d88 Compare February 23, 2025 14:58
@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from f920d88 to 6cd87fc Compare February 23, 2025 17:19
@react-sizebot
Copy link

react-sizebot commented Feb 23, 2025

Comparing: d331ba0...e01260c

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 518.54 kB 518.54 kB = 92.45 kB 92.45 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 589.31 kB 589.31 kB = 104.91 kB 104.91 kB
facebook-www/ReactDOM-prod.classic.js = 642.76 kB 642.76 kB = 113.01 kB 113.01 kB
facebook-www/ReactDOM-prod.modern.js = 633.08 kB 633.08 kB = 111.44 kB 111.44 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +11.24% 134.23 kB 149.31 kB +11.62% 26.19 kB 29.24 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +11.24% 134.23 kB 149.31 kB +11.62% 26.19 kB 29.24 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +11.23% 134.31 kB 149.40 kB +11.59% 26.24 kB 29.29 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +11.23% 134.31 kB 149.40 kB +11.59% 26.24 kB 29.29 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +11.23% 134.38 kB 149.47 kB +11.55% 26.22 kB 29.24 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +11.22% 134.47 kB 149.56 kB +11.52% 26.27 kB 29.29 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +11.24% 134.23 kB 149.31 kB +11.62% 26.19 kB 29.24 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +11.24% 134.23 kB 149.31 kB +11.62% 26.19 kB 29.24 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +11.23% 134.31 kB 149.40 kB +11.59% 26.24 kB 29.29 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +11.23% 134.31 kB 149.40 kB +11.59% 26.24 kB 29.29 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +11.23% 134.38 kB 149.47 kB +11.55% 26.22 kB 29.24 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +11.22% 134.47 kB 149.56 kB +11.52% 26.27 kB 29.29 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.39% 95.86 kB 96.24 kB +0.70% 18.15 kB 18.28 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.39% 95.91 kB 96.29 kB +0.70% 18.18 kB 18.30 kB
oss-stable-semver/react-server-dom-parcel/cjs/react-server-dom-parcel-client.browser.development.js +0.39% 96.22 kB 96.60 kB +0.67% 18.12 kB 18.24 kB
oss-stable/react-server-dom-parcel/cjs/react-server-dom-parcel-client.browser.development.js +0.39% 96.27 kB 96.65 kB +0.67% 18.14 kB 18.26 kB
oss-stable-semver/react-client/cjs/react-client-flight.development.js +0.39% 97.20 kB 97.58 kB +0.68% 17.83 kB 17.96 kB
oss-stable/react-client/cjs/react-client-flight.development.js +0.39% 97.23 kB 97.60 kB +0.68% 17.86 kB 17.98 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.39% 98.05 kB 98.43 kB +0.69% 18.54 kB 18.67 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.39% 98.10 kB 98.48 kB +0.68% 18.56 kB 18.69 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.38% 98.61 kB 98.98 kB +0.69% 18.67 kB 18.80 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.38% 98.66 kB 99.03 kB +0.68% 18.70 kB 18.83 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.38% 99.49 kB 99.87 kB +0.63% 18.38 kB 18.49 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.38% 99.49 kB 99.87 kB +0.63% 18.38 kB 18.49 kB
oss-stable-semver/react-server-dom-parcel/cjs/react-server-dom-parcel-client.node.development.js +0.38% 99.67 kB 100.05 kB +0.66% 18.90 kB 19.03 kB
oss-stable/react-server-dom-parcel/cjs/react-server-dom-parcel-client.node.development.js +0.38% 99.67 kB 100.05 kB +0.66% 18.90 kB 19.03 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.38% 100.18 kB 100.56 kB +0.67% 18.92 kB 19.04 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.38% 100.18 kB 100.56 kB +0.67% 18.92 kB 19.04 kB
oss-stable-semver/react-server-dom-parcel/cjs/react-server-dom-parcel-client.edge.development.js +0.37% 101.47 kB 101.85 kB +0.64% 19.23 kB 19.36 kB
oss-stable/react-server-dom-parcel/cjs/react-server-dom-parcel-client.edge.development.js +0.37% 101.47 kB 101.85 kB +0.64% 19.23 kB 19.36 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.37% 102.82 kB 103.20 kB +0.67% 19.39 kB 19.52 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.37% 102.82 kB 103.20 kB +0.67% 19.39 kB 19.52 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.36% 104.57 kB 104.94 kB +0.65% 19.70 kB 19.83 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.36% 104.57 kB 104.94 kB +0.65% 19.70 kB 19.83 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.36% 104.66 kB 105.03 kB +0.65% 19.74 kB 19.87 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.36% 104.66 kB 105.03 kB +0.65% 19.74 kB 19.87 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.36% 105.56 kB 105.94 kB +0.66% 19.65 kB 19.78 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.36% 105.56 kB 105.94 kB +0.66% 19.65 kB 19.78 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.36% 105.74 kB 106.12 kB +0.64% 20.18 kB 20.31 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-client.browser.development.js +0.36% 106.10 kB 106.48 kB +0.61% 20.13 kB 20.26 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.36% 106.47 kB 106.85 kB +0.59% 19.63 kB 19.74 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.35% 106.89 kB 107.27 kB +0.64% 19.91 kB 20.04 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.35% 106.89 kB 107.27 kB +0.64% 19.91 kB 20.04 kB
oss-experimental/react-client/cjs/react-client-flight.development.js +0.35% 107.05 kB 107.43 kB +0.61% 19.91 kB 20.03 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.35% 107.93 kB 108.31 kB +0.63% 20.57 kB 20.70 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.35% 108.48 kB 108.86 kB +0.61% 20.71 kB 20.84 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-client.node.development.js +0.35% 109.48 kB 109.86 kB +0.60% 20.90 kB 21.03 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.34% 110.00 kB 110.38 kB +0.60% 20.92 kB 21.04 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-client.edge.development.js +0.34% 111.29 kB 111.66 kB +0.60% 21.26 kB 21.39 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.34% 112.64 kB 113.01 kB +0.60% 21.39 kB 21.52 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.33% 114.38 kB 114.76 kB +0.60% 21.75 kB 21.88 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.33% 114.47 kB 114.85 kB +0.59% 21.79 kB 21.91 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.33% 115.38 kB 115.76 kB +0.60% 21.66 kB 21.79 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.32% 116.71 kB 117.09 kB +0.58% 21.92 kB 22.05 kB
oss-stable-semver/react-server-dom-parcel/cjs/react-server-dom-parcel-server.browser.development.js +0.27% 137.46 kB 137.84 kB +0.46% 25.57 kB 25.69 kB
oss-stable/react-server-dom-parcel/cjs/react-server-dom-parcel-server.browser.development.js +0.27% 137.46 kB 137.84 kB +0.46% 25.57 kB 25.69 kB
oss-stable-semver/react-server-dom-parcel/cjs/react-server-dom-parcel-server.edge.development.js +0.27% 141.29 kB 141.67 kB +0.45% 26.17 kB 26.29 kB
oss-stable/react-server-dom-parcel/cjs/react-server-dom-parcel-server.edge.development.js +0.27% 141.29 kB 141.67 kB +0.45% 26.17 kB 26.29 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.27% 141.88 kB 142.26 kB +0.45% 26.45 kB 26.57 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.27% 141.88 kB 142.26 kB +0.45% 26.45 kB 26.57 kB
oss-stable-semver/react-server-dom-parcel/cjs/react-server-dom-parcel-server.node.development.js +0.27% 141.90 kB 142.28 kB +0.45% 26.43 kB 26.55 kB
oss-stable/react-server-dom-parcel/cjs/react-server-dom-parcel-server.node.development.js +0.27% 141.90 kB 142.28 kB +0.45% 26.43 kB 26.55 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-server.browser.development.js +0.26% 144.46 kB 144.84 kB +0.42% 26.78 kB 26.89 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.26% 145.20 kB 145.58 kB +0.44% 26.87 kB 26.99 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.26% 145.20 kB 145.58 kB +0.44% 26.87 kB 26.99 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.26% 145.75 kB 146.12 kB +0.43% 27.00 kB 27.11 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.26% 145.75 kB 146.12 kB +0.43% 27.00 kB 27.11 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.25% 148.57 kB 148.95 kB +0.42% 27.48 kB 27.59 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.25% 148.57 kB 148.95 kB +0.42% 27.48 kB 27.59 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-server.edge.development.js +0.25% 148.92 kB 149.30 kB +0.41% 27.51 kB 27.62 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.25% 149.07 kB 149.45 kB +0.40% 27.48 kB 27.59 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.25% 149.07 kB 149.45 kB +0.40% 27.48 kB 27.59 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.25% 149.13 kB 149.51 kB +0.40% 27.49 kB 27.60 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.25% 149.13 kB 149.51 kB +0.40% 27.49 kB 27.60 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.25% 149.17 kB 149.55 kB +0.43% 27.72 kB 27.84 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-server.node.development.js +0.25% 149.20 kB 149.57 kB +0.42% 27.74 kB 27.86 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.25% 149.71 kB 150.09 kB +0.42% 27.74 kB 27.86 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.25% 149.71 kB 150.09 kB +0.42% 27.74 kB 27.86 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.25% 149.78 kB 150.16 kB +0.42% 27.75 kB 27.87 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.25% 149.78 kB 150.16 kB +0.42% 27.75 kB 27.87 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.25% 152.20 kB 152.58 kB +0.41% 28.10 kB 28.21 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.25% 152.74 kB 153.12 kB +0.41% 28.22 kB 28.34 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.24% 155.87 kB 156.24 kB +0.39% 28.80 kB 28.92 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.24% 156.70 kB 157.08 kB +0.38% 28.87 kB 28.98 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.24% 156.77 kB 157.14 kB +0.38% 28.88 kB 28.99 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.24% 157.00 kB 157.38 kB +0.39% 29.10 kB 29.21 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.24% 157.07 kB 157.45 kB +0.39% 29.11 kB 29.22 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js +0.20% 313.98 kB 314.62 kB +0.34% 54.99 kB 55.17 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js +0.20% 314.06 kB 314.70 kB +0.34% 55.01 kB 55.19 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.js +0.20% 314.23 kB 314.87 kB +0.33% 55.04 kB 55.22 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js = 145.52 kB 145.13 kB +0.21% 34.11 kB 34.18 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js = 133.96 kB 133.56 kB +0.25% 31.23 kB 31.30 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js = 133.94 kB 133.54 kB +0.25% 31.20 kB 31.28 kB
oss-experimental/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js = 20.14 kB 20.07 kB = 4.97 kB 4.93 kB
oss-stable-semver/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js = 20.14 kB 20.07 kB = 4.97 kB 4.93 kB
oss-stable/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js = 20.14 kB 20.07 kB = 4.97 kB 4.93 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.js = 20.13 kB 20.06 kB = 4.97 kB 4.93 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.js = 20.13 kB 20.06 kB = 4.97 kB 4.93 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-node-loader.production.js = 20.13 kB 20.06 kB = 4.97 kB 4.93 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js = 83.13 kB 82.06 kB = 17.38 kB 17.21 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js = 82.40 kB 81.33 kB = 17.26 kB 17.09 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js = 82.40 kB 81.33 kB = 17.26 kB 17.09 kB

Generated by 🚫 dangerJS against b00503e

@michaelfaith
Copy link
Contributor Author

michaelfaith commented Feb 23, 2025

Looking into why some of the tests are failing in CI but not locally

screenshot of passing jest tests for eslint-plugin-react-hooks

@Alexectramagneta

This comment was marked as off-topic.

@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from fc91617 to 7773b5c Compare March 7, 2025 09:42
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations.

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations.

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It it is a little bit slower now because we also generate d.ts files, but it's still much faster than rollup which we used prior to esbuild.

```
# build all compiler packages
$ time yarn build

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It it is a little bit slower now because we also generate d.ts files, but it's still much faster than rollup which we used prior to esbuild.

```
# BEFORE: build all compiler packages
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# AFTER: build all compiler packages
$ time yarn build

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It is slower when generating d.ts files, but it's still much faster than rollup which we used prior to esbuild. For now, I have turned off `dts` by default, and it is only passed when publishing on npm.

If you want to also generate d.ts files you can run `yarn build --dts`.

```
# BEFORE: build all compiler packages
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# ---

# AFTER: build all compiler packages
$ time yarn build

✨  Done in 12.39s.
yarn build  12.58s user 1.68s system 106% cpu 13.350 total

# ---

# AFTER: build all compiler packages and type declarations
$ time yarn build --dts

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations. This is primarily because React's build process uses rollup + rollup-plugin-typescript, which runs tsc. So the merged plugin needs to typecheck properly in order to build. An alternative might be to migrate to something like babel with rollup instead to simply strip types rather than typecheck before building. The minor downside of that approach is that we would need to manually maintain a d.ts file for eslint-plugin-react-hooks. For now I would like to see if this PR helps us make progress rather than go for the slightly worse alternative.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It is slower when generating d.ts files, but it's still much faster than rollup which we used prior to esbuild. For now, I have turned off `dts` by default, and it is only passed when publishing on npm.

If you want to also generate d.ts files you can run `yarn build --dts`.

```
# BEFORE: build all compiler packages (esbuild)
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# ---

# AFTER: build all compiler packages (tsup)
$ time yarn build

✨  Done in 12.39s.
yarn build  12.58s user 1.68s system 106% cpu 13.350 total

# ---

# AFTER: build all compiler packages and type declarations (tsup)
$ time yarn build --dts

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations. This is primarily because React's build process uses rollup + rollup-plugin-typescript, which runs tsc. So the merged plugin needs to typecheck properly in order to build. An alternative might be to migrate to something like babel with rollup instead to simply strip types rather than typecheck before building. The minor downside of that approach is that we would need to manually maintain a d.ts file for eslint-plugin-react-hooks. For now I would like to see if this PR helps us make progress rather than go for the slightly worse alternative.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It is slower when generating d.ts files, but it's still much faster than rollup which we used prior to esbuild. For now, I have turned off `dts` by default, and it is only passed when publishing on npm.

If you want to also generate d.ts files you can run `yarn build --dts`.

```
# BEFORE: build all compiler packages (esbuild)
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# ---

# AFTER: build all compiler packages (tsup)
$ time yarn build

✨  Done in 12.39s.
yarn build  12.58s user 1.68s system 106% cpu 13.350 total

# ---

# AFTER: build all compiler packages and type declarations (tsup)
$ time yarn build --dts

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations. This is primarily because React's build process uses rollup + rollup-plugin-typescript, which runs tsc. So the merged plugin needs to typecheck properly in order to build. An alternative might be to migrate to something like babel with rollup instead to simply strip types rather than typecheck before building. The minor downside of that approach is that we would need to manually maintain a d.ts file for eslint-plugin-react-hooks. For now I would like to see if this PR helps us make progress rather than go for the slightly worse alternative.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It is slower when generating d.ts files, but it's still much faster than rollup which we used prior to esbuild. For now, I have turned off `dts` by default, and it is only passed when publishing on npm.

If you want to also generate d.ts files you can run `yarn build --dts`.

```
# BEFORE: build all compiler packages (esbuild)
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# ---

# AFTER: build all compiler packages (tsup)
$ time yarn build

✨  Done in 12.39s.
yarn build  12.58s user 1.68s system 106% cpu 13.350 total

# ---

# AFTER: build all compiler packages and type declarations (tsup)
$ time yarn build --dts

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to build most packages (with the exception of `snap`). This has been mostly fine, but does not allow us to do things like generate type declaration files.

I would like #32416 to be able to consume the merged eslint-plugin-react-compiler from source rather than via npm, and one of the things that has come up from my exploration in that stack using the compiler from source is that babel-plugin-react-compiler is missing type declarations. This is primarily because React's build process uses rollup + rollup-plugin-typescript, which runs tsc. So the merged plugin needs to typecheck properly in order to build. An alternative might be to migrate to something like babel with rollup instead to simply strip types rather than typecheck before building. The minor downside of that approach is that we would need to manually maintain a d.ts file for eslint-plugin-react-hooks. For now I would like to see if this PR helps us make progress rather than go for the slightly worse alternative.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build performance is comparable. It is slower when generating d.ts files, but it's still much faster than rollup which we used prior to esbuild. For now, I have turned off `dts` by default, and it is only passed when publishing on npm.

If you want to also generate d.ts files you can run `yarn build --dts`.

```
# BEFORE: build all compiler packages (esbuild)
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# ---

# AFTER: build all compiler packages (tsup)
$ time yarn build

✨  Done in 12.39s.
yarn build  12.58s user 1.68s system 106% cpu 13.350 total

# ---

# AFTER: build all compiler packages and type declarations (tsup)
$ time yarn build --dts

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be landed independently though as we could probably just release type declarations on npm. No one should be using the compiler directly, but if they really wanted to, lack of type declarations would not stop them (cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
poteto added a commit that referenced this pull request Mar 7, 2025
Currently in the `compiler` workspace, we invoke esbuild directly to
build most packages (with the exception of `snap`). This has been mostly
fine, but does not allow us to do things like generate type declaration
files.

I would like #32416 to be able to consume the merged
eslint-plugin-react-compiler from source rather than via npm, and one of
the things that has come up from my exploration in that stack using the
compiler from source is that babel-plugin-react-compiler is missing type
declarations. This is primarily because React's build process uses
rollup + rollup-plugin-typescript, which runs tsc. So the merged plugin
needs to typecheck properly in order to build. An alternative might be
to migrate to something like babel with rollup instead to simply strip
types rather than typecheck before building. The minor downside of that
approach is that we would need to manually maintain a d.ts file for
eslint-plugin-react-hooks. For now I would like to see if this PR helps
us make progress rather than go for the slightly worse alternative.

[`tsup`](https://github.com/egoist/tsup) is esbuild based so build
performance is comparable. It is slower when generating d.ts files, but
it's still much faster than rollup which we used prior to esbuild. For
now, I have turned off `dts` by default, and it is only passed when
publishing on npm.

If you want to also generate d.ts files you can run `yarn build --dts`.

```
# BEFORE: build all compiler packages (esbuild)
$ time yarn build

✨  Done in 15.61s.
yarn build  13.82s user 1.54s system 96% cpu 15.842 total

# ---

# AFTER: build all compiler packages (tsup)
$ time yarn build

✨  Done in 12.39s.
yarn build  12.58s user 1.68s system 106% cpu 13.350 total

# ---

# AFTER: build all compiler packages and type declarations (tsup)
$ time yarn build --dts

✨  Done in 30.69s.
yarn build  43.57s user 3.20s system 150% cpu 31.061 total
```

I still need to test if this unblocks #32416 but this stack can be
landed independently though as we could probably just release type
declarations on npm. No one should be using the compiler directly, but
if they really wanted to, lack of type declarations would not stop them
(cf React secret internals).

Note that I still kept esbuild as we still use it directly for forgive.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32550).
* #32551
* __->__ #32550
@michaelfaith michaelfaith force-pushed the feat/merge-compiler-eslint-plugin branch from 11bab0a to a5364eb Compare March 8, 2025 21:37
…e specific dep

This change reverts the attempt to use the compiler source directly as part of unit testing, and instead installs an already published version of the package.  The implication here is that it's not possible to consume unreleased / unpublished changes to the compiler in the eslint plugin.  There's a pretty big disconnect between packages in the `compiler` folder and everything.  So bridging that gap will take some additional work.

build(eslint-plugin-react-hooks): remove jest modulenamemapper and use specific dep

This change reverts the attempt to use the compiler source directly as part of unit testing, and instead installs an already published version of the package.  The implication here is that it's not possible to consume unreleased / unpublished changes to the compiler in the eslint plugin.  There's a pretty big disconnect between packages in the `compiler` folder and everything.  So bridging that gap will take some additional work.
…ion is on the left side of an AssignmentExpression before calling lowerAssignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants