Skip to content

Commit

Permalink
refactor[react-devtools-shared]: minor parsing improvements and modif…
Browse files Browse the repository at this point in the history
…ications (#27661)

Had these stashed for some time, it includes:
- Some refactoring to remove unnecessary `FlowFixMe`s and type castings
via `any`.
- Optimized version of parsing component names. We encode string names
to utf8 and then pass it serialized from backend to frontend in a single
array of numbers. Previously we would call `slice` to get the
corresponding encoded string as a subarray and then parse each
character. New implementation skips `slice` step and just receives
`left` and `right` ranges for the string to parse.
- Early `break` instead of `continue` when Store receives unexpected
operation, like removing an element from the Store, which is not
registered yet.

DiffTrain build for commit c897260.
  • Loading branch information
hoxyq committed Nov 7, 2023
1 parent 8a14f78 commit dfc3ece
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24901,7 +24901,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-ce2bc58a9-20231102";
var ReactVersion = "18.3.0-canary-c897260cf-20231107";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9039,7 +9039,7 @@ var devToolsConfig$jscomp$inline_1033 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-ce2bc58a9-20231102",
version: "18.3.0-canary-c897260cf-20231107",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1226 = {
Expand Down Expand Up @@ -9070,7 +9070,7 @@ var internals$jscomp$inline_1226 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-ce2bc58a9-20231102"
reconcilerVersion: "18.3.0-canary-c897260cf-20231107"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9465,7 +9465,7 @@ var devToolsConfig$jscomp$inline_1075 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-ce2bc58a9-20231102",
version: "18.3.0-canary-c897260cf-20231107",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1267 = {
Expand Down Expand Up @@ -9496,7 +9496,7 @@ var internals$jscomp$inline_1267 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-ce2bc58a9-20231102"
reconcilerVersion: "18.3.0-canary-c897260cf-20231107"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-ce2bc58a9-20231102";
var ReactVersion = "18.3.0-canary-c897260cf-20231107";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-ce2bc58a9-20231102";
exports.version = "18.3.0-canary-c897260cf-20231107";
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-ce2bc58a9-20231102";
exports.version = "18.3.0-canary-c897260cf-20231107";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ce2bc58a9f6f3b0bfc8c738a0d8e2a5f3a332ff5
c897260cffb6a237d5ad707a6043f68ddf9ab014

0 comments on commit dfc3ece

Please sign in to comment.