Skip to content

Commit

Permalink
Update to React 19 RC 0.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: f260dbaca9372c3aaf6c9ea34afc045847d3a77b
  • Loading branch information
cpojer committed Jun 14, 2024
1 parent 6bd9fa3 commit 1ed9a59
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 405 deletions.
4 changes: 2 additions & 2 deletions ares/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@stripe/stripe-js": "^3.5.0",
"fbt": "^1.0.2",
"framer-motion": "^11.2.10",
"react": "19.0.0-rc-915b914b3a-20240515",
"react-dom": "19.0.0-rc-915b914b3a-20240515",
"react": "19.0.0-rc.0",
"react-dom": "19.0.0-rc.0",
"react-error-boundary": "^4.0.13",
"react-relay": "^16.2.0",
"react-router-dom": "^6.23.1",
Expand Down
4 changes: 2 additions & 2 deletions deimos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"array-shuffle": "^3.0.0",
"fbt": "^1.0.2",
"framer-motion": "^11.2.10",
"react": "19.0.0-rc-915b914b3a-20240515",
"react-dom": "19.0.0-rc-915b914b3a-20240515",
"react": "19.0.0-rc.0",
"react-dom": "19.0.0-rc.0",
"react-error-boundary": "^4.0.13"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"fbt": "^1.0.2",
"framer-motion": "^11.2.10",
"licht-theme": "^1.7.1",
"react": "19.0.0-rc-915b914b3a-20240515",
"react-dom": "19.0.0-rc-915b914b3a-20240515",
"react": "19.0.0-rc.0",
"react-dom": "19.0.0-rc.0",
"vocs": "1.0.0-alpha.52"
}
}
4 changes: 2 additions & 2 deletions hera/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"array-shuffle": "^3.0.0",
"fbt": "^1.0.2",
"framer-motion": "^11.2.10",
"react": "19.0.0-rc-915b914b3a-20240515",
"react-dom": "19.0.0-rc-915b914b3a-20240515",
"react": "19.0.0-rc.0",
"react-dom": "19.0.0-rc.0",
"react-fps": "^1.0.6"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
]
},
"overrides": {
"react@^18.0.0": "19.0.0-rc-915b914b3a-20240515",
"react@^18.0.0": "19.0.0-rc.0",
"rollup@^2.0.0": "^4.16.4"
},
"patchedDependencies": {
Expand Down
56 changes: 39 additions & 17 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
diff --git a/dist/fbt.js b/dist/fbt.js
index 271853b2299af4bb36869c100a9b374de0157571..87bd30760621336790bab2d7de61cd915e6c6d61 100644
--- a/dist/fbt.js
+++ b/dist/fbt.js
@@ -487,7 +487,7 @@ module.exports = FbtQTOverrides;
* @noformat
* @nogrep
*/
-var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol["for"] && Symbol["for"]('react.element') || 0xeac7;
+var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol["for"] && Symbol["for"]('react.transitional.element') || 0xeac7;
var canDefineProperty = false;

if (true) {
diff --git a/lib/FbtReactUtil.js b/lib/FbtReactUtil.js
index becb60e893478abf6b5edf1baa176c69b009d33f..74eb840877e41b28b90c9e7785621f4534f3bb1a 100644
index becb60e893478abf6b5edf1baa176c69b009d33f..6a0b62f647f23a5688fed5c6e5b3df801af379d8 100644
--- a/lib/FbtReactUtil.js
+++ b/lib/FbtReactUtil.js
@@ -16,7 +16,7 @@
Expand All @@ -25,10 +12,45 @@ index becb60e893478abf6b5edf1baa176c69b009d33f..74eb840877e41b28b90c9e7785621f45

if (process.env.NODE_ENV !== "production") {
diff --git a/lib/substituteTokens.js b/lib/substituteTokens.js
index 144db1d6553417bb9ec67f537c40c0c4cc4f0067..95e6cca7bb4e87598c467420ce81d6a6d29536cf 100644
index 144db1d6553417bb9ec67f537c40c0c4cc4f0067..3061f41cf04dce35f5868c14bbfa2bd75cca10eb 100644
--- a/lib/substituteTokens.js
+++ b/lib/substituteTokens.js
@@ -66,12 +66,6 @@ function substituteTokens(template, args, errorListener) {
@@ -39,17 +39,28 @@ function markAsSafeForReact(object) {
if (process.env.NODE_ENV !== "production") {
// If this looks like a ReactElement, mark it as safe to silence any
// key warnings.
- // I use a string key to avoid any possible private variable transforms.
- var storeKey = '_store';
- var store = object[storeKey];

- if (object.type != null && object.type != '' && typeof object.props === 'object' && store != null && typeof store === 'object' && typeof store.validated === 'boolean') {
- store.validated = true;
+ // I use a string key to avoid any possible private variable transforms.
+ const storeKey = '_store';
+
+ const store = object[storeKey];
+ if (
+ object.type != null &&
+ object.type != '' &&
+ typeof object.props === 'object' &&
+ store != null &&
+ typeof store === 'object'
+ ) {
+ if (typeof store.validated === 'number') {
+ store.validated = 1;
+ } else if (typeof store.validated === 'boolean') {
+ store.validated = true;
+ }
}
}
-
return object;
}
+
/**
* Does the token substitution fbt() but without the string lookup.
* Used for in-place substitutions in translation mode.
@@ -66,12 +77,6 @@ function substituteTokens(template, args, errorListener) {
var objectPieces = [];
var argNames = [];
var stringPieces = template.replace(parameterRegexp, function (_match, parameter, punctuation) {
Expand All @@ -41,7 +63,7 @@ index 144db1d6553417bb9ec67f537c40c0c4cc4f0067..95e6cca7bb4e87598c467420ce81d6a6
var argument = args[parameter];

if (argument != null && typeof argument === 'object') {
@@ -80,7 +74,7 @@ function substituteTokens(template, args, errorListener) {
@@ -80,7 +85,7 @@ function substituteTokens(template, args, errorListener) {

return '\x17' + punctuation;
} else if (argument == null) {
Expand Down
Loading

0 comments on commit 1ed9a59

Please sign in to comment.