Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Upgrade React Compiler (take two) (#6460)

* Revert "Revert "React compiler beta and reenable rule (#5898)" (#6071)"

This reverts commit 7111e38cd48c1c7e2b35ae978708fcb7a60a5dd7.

* Update the compiler

* Don't inline compiler runtime import

authored by

dan and committed by
GitHub
2f74a8db dd9a2f60

+32 -126
+1 -2
.eslintrc.js
··· 79 79 }, 80 80 ], 81 81 'simple-import-sort/exports': 'error', 82 - // TODO: Reenable when we figure out why it gets stuck on CI. 83 - // 'react-compiler/react-compiler': 'error', 82 + 'react-compiler/react-compiler': 'warn', 84 83 'no-restricted-imports': [ 85 84 'error', 86 85 {
+1 -6
babel.config.js
··· 17 17 ], 18 18 plugins: [ 19 19 'macros', 20 - [ 21 - 'babel-plugin-react-compiler', 22 - { 23 - runtimeModule: 'react-compiler-runtime', 24 - }, 25 - ], 20 + ['babel-plugin-react-compiler', {target: '18'}], 26 21 [ 27 22 'module:react-native-dotenv', 28 23 {
-21
lib/react-compiler-runtime/index.js
··· 1 - const React = require('react') 2 - const $empty = Symbol.for('react.memo_cache_sentinel') 3 - /** 4 - * DANGER: this hook is NEVER meant to be called directly! 5 - * 6 - * Note that this is a temporary userspace implementation of this function 7 - * from React 19. It is not as efficient and may invalidate more frequently 8 - * than the official API. Please upgrade to React 19 as soon as you can. 9 - **/ 10 - export function c(size) { 11 - // eslint-disable-next-line react-hooks/rules-of-hooks 12 - return React.useState(() => { 13 - const $ = new Array(size) 14 - for (let ii = 0; ii < size; ii++) { 15 - $[ii] = $empty 16 - } 17 - // @ts-ignore 18 - $[$empty] = true 19 - return $ 20 - })[0] 21 - }
-9
lib/react-compiler-runtime/package.json
··· 1 - { 2 - "name": "react-compiler-runtime", 3 - "version": "0.0.1", 4 - "license": "MIT", 5 - "main": "index.js", 6 - "peerDependencies": { 7 - "react": "^18.2.0" 8 - } 9 - }
+2 -1
metro.config.js
··· 38 38 inlineRequires: true, 39 39 nonInlinedRequires: [ 40 40 // We can remove this option and rely on the default after 41 - // https://github.com/facebook/metro/pull/1126 is released. 41 + // https://github.com/facebook/metro/pull/1390 is released. 42 42 'React', 43 43 'react', 44 + 'react-compiler-runtime', 44 45 'react/jsx-dev-runtime', 45 46 'react/jsx-runtime', 46 47 'react-native',
+3 -3
package.json
··· 166 166 "postinstall-postinstall": "^2.1.0", 167 167 "psl": "^1.9.0", 168 168 "react": "18.2.0", 169 - "react-compiler-runtime": "file:./lib/react-compiler-runtime", 169 + "react-compiler-runtime": "^19.0.0-beta-a7bf2bd-20241110", 170 170 "react-dom": "^18.2.0", 171 171 "react-image-crop": "^11.0.7", 172 172 "react-keyed-flatten-children": "^3.0.0", ··· 243 243 "babel-loader": "^9.1.2", 244 244 "babel-plugin-macros": "^3.1.0", 245 245 "babel-plugin-module-resolver": "^5.0.0", 246 - "babel-plugin-react-compiler": "^0.0.0-experimental-592953e-20240517", 246 + "babel-plugin-react-compiler": "^19.0.0-beta-a7bf2bd-20241110", 247 247 "babel-plugin-react-native-web": "^0.18.12", 248 248 "babel-preset-expo": "^10.0.0", 249 249 "eslint": "^8.19.0", ··· 251 251 "eslint-plugin-ft-flow": "^2.0.3", 252 252 "eslint-plugin-lingui": "^0.2.0", 253 253 "eslint-plugin-react": "^7.33.2", 254 - "eslint-plugin-react-compiler": "^0.0.0-experimental-c8b3f72-20240517", 254 + "eslint-plugin-react-compiler": "^19.0.0-beta-a7bf2bd-20241110", 255 255 "eslint-plugin-react-native-a11y": "^3.3.0", 256 256 "eslint-plugin-simple-import-sort": "^12.0.0", 257 257 "file-loader": "6.2.0",
+25 -84
yarn.lock
··· 1253 1253 eslint-visitor-keys "^2.1.0" 1254 1254 semver "^6.3.1" 1255 1255 1256 - "@babel/generator@7.2.0": 1257 - version "7.2.0" 1258 - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.2.0.tgz#eaf3821fa0301d9d4aef88e63d4bcc19b73ba16c" 1259 - integrity sha512-BA75MVfRlFQG2EZgFYIwyT1r6xSkwfP2bdkY/kLZusEYWiJs4xCowab/alaEaT0wSvmVuXGqiefeBlP+7V1yKg== 1260 - dependencies: 1261 - "@babel/types" "^7.2.0" 1262 - jsesc "^2.5.1" 1263 - lodash "^4.17.10" 1264 - source-map "^0.5.0" 1265 - trim-right "^1.0.1" 1266 - 1267 1256 "@babel/generator@^7.20.0", "@babel/generator@^7.22.10", "@babel/generator@^7.7.2": 1268 1257 version "7.22.10" 1269 1258 resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722" ··· 3086 3075 "@babel/helper-validator-identifier" "^7.22.5" 3087 3076 to-fast-properties "^2.0.0" 3088 3077 3089 - "@babel/types@^7.19.0", "@babel/types@^7.2.0", "@babel/types@^7.24.0", "@babel/types@^7.24.5": 3078 + "@babel/types@^7.19.0", "@babel/types@^7.24.0", "@babel/types@^7.24.5": 3090 3079 version "7.24.5" 3091 3080 resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.5.tgz#7661930afc638a5383eb0c4aee59b74f38db84d7" 3092 3081 integrity sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ== ··· 4557 4546 slash "^3.0.0" 4558 4547 write-file-atomic "^4.0.2" 4559 4548 4560 - "@jest/types@^24.9.0": 4561 - version "24.9.0" 4562 - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" 4563 - integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== 4564 - dependencies: 4565 - "@types/istanbul-lib-coverage" "^2.0.0" 4566 - "@types/istanbul-reports" "^1.1.1" 4567 - "@types/yargs" "^13.0.0" 4568 - 4569 4549 "@jest/types@^26.6.2": 4570 4550 version "26.6.2" 4571 4551 resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" ··· 6826 6806 dependencies: 6827 6807 "@types/istanbul-lib-coverage" "*" 6828 6808 6829 - "@types/istanbul-reports@^1.1.1": 6830 - version "1.1.2" 6831 - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz#e875cc689e47bce549ec81f3df5e6f6f11cfaeb2" 6832 - integrity sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw== 6833 - dependencies: 6834 - "@types/istanbul-lib-coverage" "*" 6835 - "@types/istanbul-lib-report" "*" 6836 - 6837 6809 "@types/istanbul-reports@^3.0.0": 6838 6810 version "3.0.1" 6839 6811 resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" ··· 7107 7079 resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" 7108 7080 integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== 7109 7081 7110 - "@types/yargs@^13.0.0": 7111 - version "13.0.12" 7112 - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.12.tgz#d895a88c703b78af0465a9de88aa92c61430b092" 7113 - integrity sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ== 7114 - dependencies: 7115 - "@types/yargs-parser" "*" 7116 - 7117 7082 "@types/yargs@^15.0.0": 7118 7083 version "15.0.15" 7119 7084 resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.15.tgz#e609a2b1ef9e05d90489c2f5f45bbfb2be092158" ··· 7564 7529 resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" 7565 7530 integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== 7566 7531 7567 - ansi-regex@^4.0.0, ansi-regex@^4.1.0: 7532 + ansi-regex@^4.1.0: 7568 7533 version "4.1.1" 7569 7534 resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" 7570 7535 integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== ··· 8002 7967 dependencies: 8003 7968 "@babel/helper-define-polyfill-provider" "^0.4.2" 8004 7969 8005 - babel-plugin-react-compiler@^0.0.0-experimental-592953e-20240517: 8006 - version "0.0.0-experimental-592953e-20240517" 8007 - resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-0.0.0-experimental-592953e-20240517.tgz#e800fa1550d03573cd5637218dc711f12f642249" 8008 - integrity sha512-OjG1SVaeQZaJrqkMFJatg8W/MTow8Ak5rx2SI0ETQBO1XvOk/XZGMbltNCPdFJLKghBYoBjC+Y3Ap/Xr7B01mA== 7970 + babel-plugin-react-compiler@^19.0.0-beta-a7bf2bd-20241110: 7971 + version "19.0.0-beta-a7bf2bd-20241110" 7972 + resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-19.0.0-beta-a7bf2bd-20241110.tgz#9e7abf2d9b6d0908cca7df010695678b830b36ae" 7973 + integrity sha512-WdxXtLxsV4gh/GlEK4fuFDGkcED0Wb9UJEBB6Uc1SFqRFEmJNFKboW+Z4NUS5gYrPImqrjh4IwHAmgS6ZBg4Cg== 8009 7974 dependencies: 8010 - "@babel/generator" "7.2.0" 8011 7975 "@babel/types" "^7.19.0" 8012 - chalk "4" 8013 - invariant "^2.2.4" 8014 - pretty-format "^24" 8015 - zod "^3.22.4" 8016 - zod-validation-error "^2.1.0" 8017 7976 8018 7977 babel-plugin-react-native-web@^0.18.12, babel-plugin-react-native-web@~0.18.10: 8019 7978 version "0.18.12" ··· 8502 8461 resolved "https://registry.yarnpkg.com/cborg/-/cborg-4.2.6.tgz#7491c29986a87c647d6e2c232e64c82214ca660e" 8503 8462 integrity sha512-77vo4KlSwfjCIXcyZUVei4l2gdjesSCeYSx4U/Upwix7pcWZq8uw21sVRpjwn7mjEi//ieJPTj1MRWDHmud1Rg== 8504 8463 8505 - chalk@4, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: 8506 - version "4.1.2" 8507 - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" 8508 - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== 8509 - dependencies: 8510 - ansi-styles "^4.1.0" 8511 - supports-color "^7.1.0" 8512 - 8513 8464 chalk@5.3.0: 8514 8465 version "5.3.0" 8515 8466 resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" ··· 8528 8479 version "3.0.0" 8529 8480 resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" 8530 8481 integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== 8482 + dependencies: 8483 + ansi-styles "^4.1.0" 8484 + supports-color "^7.1.0" 8485 + 8486 + chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: 8487 + version "4.1.2" 8488 + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" 8489 + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== 8531 8490 dependencies: 8532 8491 ansi-styles "^4.1.0" 8533 8492 supports-color "^7.1.0" ··· 10068 10027 dependencies: 10069 10028 prettier-linter-helpers "^1.0.0" 10070 10029 10071 - eslint-plugin-react-compiler@^0.0.0-experimental-c8b3f72-20240517: 10072 - version "0.0.0-experimental-c8b3f72-20240517" 10073 - resolved "https://registry.yarnpkg.com/eslint-plugin-react-compiler/-/eslint-plugin-react-compiler-0.0.0-experimental-c8b3f72-20240517.tgz#56b512aa0d6dbf051be0d297bde1d696e412bc50" 10074 - integrity sha512-cxUTFNMEKiLX6uFaRfrr2GHnB7KUHDMYLjEGzDec82ka6WyBCHg906nGSf3JvVnQKHaBDfUk7Mmv/JMvdgQB8Q== 10030 + eslint-plugin-react-compiler@^19.0.0-beta-a7bf2bd-20241110: 10031 + version "19.0.0-beta-a7bf2bd-20241110" 10032 + resolved "https://registry.yarnpkg.com/eslint-plugin-react-compiler/-/eslint-plugin-react-compiler-19.0.0-beta-a7bf2bd-20241110.tgz#b03c043cc70cc9297e4f79f3370900aacd013d13" 10033 + integrity sha512-b5/hRnOQlnH9CEnJQ6UrPoIAG4y/wIGv+OVEHTeAkbq+1uojfcuQyLToYvK1T9a6vz5WQHeMjQqFOZk3mtWorg== 10075 10034 dependencies: 10076 10035 "@babel/core" "^7.24.4" 10077 10036 "@babel/parser" "^7.24.4" ··· 13592 13551 resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" 13593 13552 integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== 13594 13553 13595 - lodash@^4.17.10, lodash@^4.17.13, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21: 13554 + lodash@^4.17.13, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21: 13596 13555 version "4.17.21" 13597 13556 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" 13598 13557 integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== ··· 15593 15552 lodash "^4.17.20" 15594 15553 renderkid "^3.0.0" 15595 15554 15596 - pretty-format@^24: 15597 - version "24.9.0" 15598 - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" 15599 - integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== 15600 - dependencies: 15601 - "@jest/types" "^24.9.0" 15602 - ansi-regex "^4.0.0" 15603 - ansi-styles "^3.2.0" 15604 - react-is "^16.8.4" 15605 - 15606 15555 pretty-format@^26.5.2, pretty-format@^26.6.2: 15607 15556 version "26.6.2" 15608 15557 resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" ··· 16001 15950 minimist "^1.2.0" 16002 15951 strip-json-comments "~2.0.1" 16003 15952 16004 - "react-compiler-runtime@file:./lib/react-compiler-runtime": 16005 - version "0.0.1" 15953 + react-compiler-runtime@^19.0.0-beta-a7bf2bd-20241110: 15954 + version "19.0.0-beta-a7bf2bd-20241110" 15955 + resolved "https://registry.yarnpkg.com/react-compiler-runtime/-/react-compiler-runtime-19.0.0-beta-a7bf2bd-20241110.tgz#58587b1a05d50f78f0a72f5e857d541f5dcb5cd1" 15956 + integrity sha512-cSkrfz2eGcC9UZ/83mLf3aqKKDVjFkWJeA/kiYLwKTNp7B0Lq5M1FQ3vTfgSC027fK5ZutXU/JsCS5KxTwk8Mg== 16006 15957 16007 15958 react-devtools-core@^5.0.0: 16008 15959 version "5.2.0" ··· 16035 15986 resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" 16036 15987 integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== 16037 15988 16038 - react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.4: 15989 + react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0: 16039 15990 version "16.13.1" 16040 15991 resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" 16041 15992 integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== ··· 17336 17287 resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" 17337 17288 integrity sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA== 17338 17289 17339 - source-map@^0.5.0, source-map@^0.5.6: 17290 + source-map@^0.5.6: 17340 17291 version "0.5.7" 17341 17292 resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" 17342 17293 integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== ··· 18182 18133 resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.7.tgz#46961cd2d57dd8706c36664acde06a248f1173fe" 18183 18134 integrity sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg== 18184 18135 18185 - trim-right@^1.0.1: 18186 - version "1.0.1" 18187 - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" 18188 - integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== 18189 - 18190 18136 ts-interface-checker@^0.1.9: 18191 18137 version "0.1.13" 18192 18138 resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" ··· 19308 19254 "@radix-ui/react-context-menu" "^2.0.1" 19309 19255 "@radix-ui/react-dropdown-menu" "^2.0.1" 19310 19256 sf-symbols-typescript "^1.0.0" 19311 - 19312 - zod-validation-error@^2.1.0: 19313 - version "2.1.0" 19314 - resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-2.1.0.tgz#208eac75237dfed47c0018d2fe8fd03501bfc9ac" 19315 - integrity sha512-VJh93e2wb4c3tWtGgTa0OF/dTt/zoPCPzXq4V11ZjxmEAFaPi/Zss1xIZdEB5RD8GD00U0/iVXgqkF77RV7pdQ== 19316 19257 19317 19258 zod-validation-error@^3.0.3: 19318 19259 version "3.3.0"