Skip to content

Commit 076327c

Browse files
committed
Update
[ghstack-poisoned]
2 parents 0929e18 + c23e432 commit 076327c

File tree

4 files changed

+48
-29
lines changed

4 files changed

+48
-29
lines changed

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ function codegenReactiveScope(
673673
t.expressionStatement(
674674
t.callExpression(t.identifier(detectionFunction), [
675675
t.identifier(loadName),
676-
name,
676+
t.cloneNode(name, true),
677677
t.stringLiteral(name.name),
678678
t.stringLiteral(cx.fnName),
679679
t.stringLiteral("cached"),
@@ -684,8 +684,8 @@ function codegenReactiveScope(
684684
idempotenceDetectionStatements.push(
685685
t.expressionStatement(
686686
t.callExpression(t.identifier(detectionFunction), [
687-
slot,
688-
name,
687+
t.cloneNode(slot, true),
688+
t.cloneNode(name, true),
689689
t.stringLiteral(name.name),
690690
t.stringLiteral(cx.fnName),
691691
t.stringLiteral("recomputed"),
@@ -698,6 +698,7 @@ function codegenReactiveScope(
698698
);
699699
}
700700
const condition = cx.synthesizeName("condition");
701+
const recomputationBlock = t.cloneNode(computationBlock, true);
701702
memoStatement = t.blockStatement([
702703
...computationBlock.body,
703704
t.variableDeclaration("let", [
@@ -714,7 +715,7 @@ function codegenReactiveScope(
714715
t.ifStatement(
715716
t.identifier(condition),
716717
t.blockStatement([
717-
...computationBlock.body,
718+
...recomputationBlock.body,
718719
...idempotenceDetectionStatements,
719720
])
720721
),

fixtures/flight/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@babel/core": "^7.16.0",
1111
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
1212
"@babel/preset-react": "^7.22.5",
13-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.7",
13+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
1414
"@svgr/webpack": "^5.5.0",
1515
"@testing-library/jest-dom": "^5.14.1",
1616
"@testing-library/react": "^13.0.0",

fixtures/flight/playwright.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default defineConfig({
2424
},
2525
],
2626
webServer: {
27-
command: 'FAST_REFRESH=false yarn dev',
27+
command: 'yarn dev',
2828
url: 'http://localhost:3000',
2929
reuseExistingServer: !isCI,
3030
},

fixtures/flight/yarn.lock

+41-23
Original file line numberDiff line numberDiff line change
@@ -2696,19 +2696,17 @@
26962696
dependencies:
26972697
playwright "1.41.2"
26982698

2699-
"@pmmmwh/[email protected].7":
2700-
version "0.5.7"
2701-
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz#58f8217ba70069cc6a73f5d7e05e85b458c150e2"
2702-
integrity sha512-bcKCAzF0DV2IIROp9ZHkRJa6O4jy7NlnHdWL3GmcUxYWNjLXkK5kfELELwEfSP5hXPfVL/qOGMAROuMQb9GG8Q==
2699+
"@pmmmwh/[email protected].15":
2700+
version "0.5.15"
2701+
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.15.tgz#f126be97c30b83ed777e2aeabd518bc592e6e7c4"
2702+
integrity sha512-LFWllMA55pzB9D34w/wXUCf8+c+IYKuJDgxiZ3qMhl64KRMBHYM1I3VdGaD2BV5FNPV2/S2596bppxHbv2ZydQ==
27032703
dependencies:
2704-
ansi-html-community "^0.0.8"
2705-
common-path-prefix "^3.0.0"
2706-
core-js-pure "^3.8.1"
2704+
ansi-html "^0.0.9"
2705+
core-js-pure "^3.23.3"
27072706
error-stack-parser "^2.0.6"
2708-
find-up "^5.0.0"
27092707
html-entities "^2.1.0"
2710-
loader-utils "^2.0.0"
2711-
schema-utils "^3.0.0"
2708+
loader-utils "^2.0.4"
2709+
schema-utils "^4.2.0"
27122710
source-map "^0.7.3"
27132711

27142712
"@sinclair/typebox@^0.24.1":
@@ -3323,7 +3321,7 @@ ajv-keywords@^3.5.2:
33233321
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
33243322
integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==
33253323

3326-
ajv-keywords@^5.0.0:
3324+
ajv-keywords@^5.0.0, ajv-keywords@^5.1.0:
33273325
version "5.1.0"
33283326
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16"
33293327
integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==
@@ -3350,6 +3348,16 @@ ajv@^8.0.0, ajv@^8.8.0:
33503348
require-from-string "^2.0.2"
33513349
uri-js "^4.2.2"
33523350

3351+
ajv@^8.9.0:
3352+
version "8.16.0"
3353+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4"
3354+
integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==
3355+
dependencies:
3356+
fast-deep-equal "^3.1.3"
3357+
json-schema-traverse "^1.0.0"
3358+
require-from-string "^2.0.2"
3359+
uri-js "^4.4.1"
3360+
33533361
ansi-escapes@^4.2.1:
33543362
version "4.2.1"
33553363
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.2.1.tgz#4dccdb846c3eee10f6d64dea66273eab90c37228"
@@ -3363,11 +3371,16 @@ ansi-escapes@^4.3.1:
33633371
dependencies:
33643372
type-fest "^0.11.0"
33653373

3366-
[email protected], ansi-html-community@^0.0.8:
3374+
33673375
version "0.0.8"
33683376
resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41"
33693377
integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==
33703378

3379+
ansi-html@^0.0.9:
3380+
version "0.0.9"
3381+
resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.9.tgz#6512d02342ae2cc68131952644a129cb734cd3f0"
3382+
integrity sha512-ozbS3LuenHVxNRh/wdnN16QapUHzauqSomAl1jwwJRRsGwFwtj644lIhxfWu0Fy0acCij2+AEgHvjscq3dlVXg==
3383+
33713384
ansi-regex@^4.1.0:
33723385
version "4.1.0"
33733386
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
@@ -3978,11 +3991,6 @@ commander@^8.3.0:
39783991
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
39793992
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
39803993

3981-
common-path-prefix@^3.0.0:
3982-
version "3.0.0"
3983-
resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0"
3984-
integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==
3985-
39863994
commondir@^1.0.1:
39873995
version "1.0.1"
39883996
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
@@ -4057,10 +4065,10 @@ core-js-compat@^3.30.1, core-js-compat@^3.30.2:
40574065
dependencies:
40584066
browserslist "^4.21.5"
40594067

4060-
core-js-pure@^3.8.1:
4061-
version "3.36.0"
4062-
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.36.0.tgz#ffb34330b14e594d6a9835cf5843b4123f1d95db"
4063-
integrity sha512-cN28qmhRNgbMZZMc/RFu5w8pK9VJzpb2rJVR/lHuZJKwmXnoWOpXmMkxqBB514igkp1Hu8WGROsiOAzUcKdHOQ==
4068+
core-js-pure@^3.23.3:
4069+
version "3.37.1"
4070+
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.37.1.tgz#2b4b34281f54db06c9a9a5bd60105046900553bd"
4071+
integrity sha512-J/r5JTHSmzTxbiYYrzXg9w1VpqrYt+gexenBE9pugeyhwPZTAEJddyiReJWsLO6uNQ8xJZFbod6XC7KKwatCiA==
40644072

40654073
cosmiconfig@^6.0.0:
40664074
version "6.0.0"
@@ -6031,7 +6039,7 @@ loader-runner@^4.2.0:
60316039
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1"
60326040
integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==
60336041

6034-
loader-utils@^2.0.0:
6042+
loader-utils@^2.0.0, loader-utils@^2.0.4:
60356043
version "2.0.4"
60366044
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
60376045
integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==
@@ -7705,6 +7713,16 @@ schema-utils@^4.0.0:
77057713
ajv-formats "^2.1.1"
77067714
ajv-keywords "^5.0.0"
77077715

7716+
schema-utils@^4.2.0:
7717+
version "4.2.0"
7718+
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b"
7719+
integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==
7720+
dependencies:
7721+
"@types/json-schema" "^7.0.9"
7722+
ajv "^8.9.0"
7723+
ajv-formats "^2.1.1"
7724+
ajv-keywords "^5.1.0"
7725+
77087726
[email protected], semver@~7.0.0:
77097727
version "7.0.0"
77107728
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
@@ -8368,7 +8386,7 @@ update-browserslist-db@^1.0.5:
83688386
escalade "^3.1.1"
83698387
picocolors "^1.0.0"
83708388

8371-
uri-js@^4.2.2:
8389+
uri-js@^4.2.2, uri-js@^4.4.1:
83728390
version "4.4.1"
83738391
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
83748392
integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==

0 commit comments

Comments
 (0)