Skip to content

Commit 7739cd4

Browse files
committed
[DOM] Shrink ReactDOMCurrentDispatcher method names (#28770)
Stacked on #28771 ReactDOMCurrentDispatcher has longer property names for various methods. These methods are only ever called internally and don't need to be represented with as many characters. This change shortens the names and aligns them with the hint codes we use in Flight. This alignment is passive since not all dispatcher methods will exist as flight instructions but where they can line up it seems reasonable to make them do so DiffTrain build for [97c90ed](97c90ed)
1 parent 9ea88c8 commit 7739cd4

21 files changed

+1385
-731
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9007fdc8f103a5d9247be384791496db9a3be91d
1+
97c90ed8835401e325e42de22f38a803c5e6fc6d

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 179 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,14 +3024,30 @@ if (__DEV__) {
30243024
function noop$3() {}
30253025

30263026
var DefaultDispatcher = {
3027-
flushSyncWork: noop$3,
3028-
prefetchDNS: noop$3,
3029-
preconnect: noop$3,
3030-
preload: noop$3,
3031-
preloadModule: noop$3,
3032-
preinitScript: noop$3,
3033-
preinitStyle: noop$3,
3034-
preinitModuleScript: noop$3
3027+
f:
3028+
/* flushSyncWork */
3029+
noop$3,
3030+
D:
3031+
/* prefetchDNS */
3032+
noop$3,
3033+
C:
3034+
/* preconnect */
3035+
noop$3,
3036+
L:
3037+
/* preload */
3038+
noop$3,
3039+
m:
3040+
/* preloadModule */
3041+
noop$3,
3042+
X:
3043+
/* preinitScript */
3044+
noop$3,
3045+
S:
3046+
/* preinitStyle */
3047+
noop$3,
3048+
M:
3049+
/* preinitModuleScript */
3050+
noop$3
30353051
};
30363052
var Internals = {
30373053
Events: null,
@@ -36162,7 +36178,7 @@ if (__DEV__) {
3616236178
return root;
3616336179
}
3616436180

36165-
var ReactVersion = "19.0.0-www-classic-393dd949";
36181+
var ReactVersion = "19.0.0-www-classic-42767cb4";
3616636182

3616736183
function createPortal$1(
3616836184
children,
@@ -45606,14 +45622,31 @@ if (__DEV__) {
4560645622
Internals.d =
4560745623
/* ReactDOMCurrentDispatcher */
4560845624
{
45609-
flushSyncWork: previousDispatcher.flushSyncWork,
45610-
prefetchDNS: prefetchDNS$1,
45611-
preconnect: preconnect$1,
45612-
preload: preload$1,
45613-
preloadModule: preloadModule$1,
45614-
preinitStyle: preinitStyle,
45615-
preinitScript: preinitScript,
45616-
preinitModuleScript: preinitModuleScript
45625+
f:
45626+
/* flushSyncWork */
45627+
previousDispatcher.f,
45628+
/* flushSyncWork */
45629+
D:
45630+
/* prefetchDNS */
45631+
prefetchDNS$1,
45632+
C:
45633+
/* preconnect */
45634+
preconnect$1,
45635+
L:
45636+
/* preload */
45637+
preload$1,
45638+
m:
45639+
/* preloadModule */
45640+
preloadModule$1,
45641+
X:
45642+
/* preinitScript */
45643+
preinitScript,
45644+
S:
45645+
/* preinitStyle */
45646+
preinitStyle,
45647+
M:
45648+
/* preinitModuleScript */
45649+
preinitModuleScript
4561745650
};
4561845651
// how we resolve the HoistableRoot for ReactDOM.pre*() methods. Because we support calling
4561945652
// these methods outside of render there is no way to know which Document or ShadowRoot is 'scoped'
@@ -45658,17 +45691,29 @@ if (__DEV__) {
4565845691
}
4565945692

4566045693
function prefetchDNS$1(href) {
45661-
previousDispatcher.prefetchDNS(href);
45694+
previousDispatcher.D(
45695+
/* prefetchDNS */
45696+
href
45697+
);
4566245698
preconnectAs("dns-prefetch", href, null);
4566345699
}
4566445700

4566545701
function preconnect$1(href, crossOrigin) {
45666-
previousDispatcher.preconnect(href, crossOrigin);
45702+
previousDispatcher.C(
45703+
/* preconnect */
45704+
href,
45705+
crossOrigin
45706+
);
4566745707
preconnectAs("preconnect", href, crossOrigin);
4566845708
}
4566945709

4567045710
function preload$1(href, as, options) {
45671-
previousDispatcher.preload(href, as, options);
45711+
previousDispatcher.L(
45712+
/* preload */
45713+
href,
45714+
as,
45715+
options
45716+
);
4567245717
var ownerDocument = getGlobalDocument();
4567345718

4567445719
if (ownerDocument && href && as) {
@@ -45765,7 +45810,11 @@ if (__DEV__) {
4576545810
}
4576645811

4576745812
function preloadModule$1(href, options) {
45768-
previousDispatcher.preloadModule(href, options);
45813+
previousDispatcher.m(
45814+
/* preloadModule */
45815+
href,
45816+
options
45817+
);
4576945818
var ownerDocument = getGlobalDocument();
4577045819

4577145820
if (ownerDocument && href) {
@@ -45831,7 +45880,12 @@ if (__DEV__) {
4583145880
}
4583245881

4583345882
function preinitStyle(href, precedence, options) {
45834-
previousDispatcher.preinitStyle(href, precedence, options);
45883+
previousDispatcher.S(
45884+
/* preinitStyle */
45885+
href,
45886+
precedence,
45887+
options
45888+
);
4583545889
var ownerDocument = getGlobalDocument();
4583645890

4583745891
if (ownerDocument && href) {
@@ -45904,7 +45958,11 @@ if (__DEV__) {
4590445958
}
4590545959

4590645960
function preinitScript(src, options) {
45907-
previousDispatcher.preinitScript(src, options);
45961+
previousDispatcher.X(
45962+
/* preinitScript */
45963+
src,
45964+
options
45965+
);
4590845966
var ownerDocument = getGlobalDocument();
4590945967

4591045968
if (ownerDocument && src) {
@@ -45957,7 +46015,11 @@ if (__DEV__) {
4595746015
}
4595846016

4595946017
function preinitModuleScript(src, options) {
45960-
previousDispatcher.preinitModuleScript(src, options);
46018+
previousDispatcher.M(
46019+
/* preinitModuleScript */
46020+
src,
46021+
options
46022+
);
4596146023
var ownerDocument = getGlobalDocument();
4596246024

4596346025
if (ownerDocument && src) {
@@ -48710,7 +48772,10 @@ if (__DEV__) {
4871048772
if (typeof href === "string") {
4871148773
Internals.d
4871248774
/* ReactDOMCurrentDispatcher */
48713-
.prefetchDNS(href);
48775+
.D(
48776+
/* prefetchDNS */
48777+
href
48778+
);
4871448779
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
4871548780
// and the runtime may not be capable of responding. The function is optimistic and not critical
4871648781
// so we favor silent bailout over warning or erroring.
@@ -48741,7 +48806,11 @@ if (__DEV__) {
4874148806
: null;
4874248807
Internals.d
4874348808
/* ReactDOMCurrentDispatcher */
48744-
.preconnect(href, crossOrigin);
48809+
.C(
48810+
/* preconnect */
48811+
href,
48812+
crossOrigin
48813+
);
4874548814
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
4874648815
// and the runtime may not be capable of responding. The function is optimistic and not critical
4874748816
// so we favor silent bailout over warning or erroring.
@@ -48787,33 +48856,39 @@ if (__DEV__) {
4878748856
var crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
4878848857
Internals.d
4878948858
/* ReactDOMCurrentDispatcher */
48790-
.preload(href, as, {
48791-
crossOrigin: crossOrigin,
48792-
integrity:
48793-
typeof options.integrity === "string"
48794-
? options.integrity
48795-
: undefined,
48796-
nonce:
48797-
typeof options.nonce === "string" ? options.nonce : undefined,
48798-
type: typeof options.type === "string" ? options.type : undefined,
48799-
fetchPriority:
48800-
typeof options.fetchPriority === "string"
48801-
? options.fetchPriority
48802-
: undefined,
48803-
referrerPolicy:
48804-
typeof options.referrerPolicy === "string"
48805-
? options.referrerPolicy
48806-
: undefined,
48807-
imageSrcSet:
48808-
typeof options.imageSrcSet === "string"
48809-
? options.imageSrcSet
48810-
: undefined,
48811-
imageSizes:
48812-
typeof options.imageSizes === "string"
48813-
? options.imageSizes
48814-
: undefined,
48815-
media: typeof options.media === "string" ? options.media : undefined
48816-
});
48859+
.L(
48860+
/* preload */
48861+
href,
48862+
as,
48863+
{
48864+
crossOrigin: crossOrigin,
48865+
integrity:
48866+
typeof options.integrity === "string"
48867+
? options.integrity
48868+
: undefined,
48869+
nonce:
48870+
typeof options.nonce === "string" ? options.nonce : undefined,
48871+
type: typeof options.type === "string" ? options.type : undefined,
48872+
fetchPriority:
48873+
typeof options.fetchPriority === "string"
48874+
? options.fetchPriority
48875+
: undefined,
48876+
referrerPolicy:
48877+
typeof options.referrerPolicy === "string"
48878+
? options.referrerPolicy
48879+
: undefined,
48880+
imageSrcSet:
48881+
typeof options.imageSrcSet === "string"
48882+
? options.imageSrcSet
48883+
: undefined,
48884+
imageSizes:
48885+
typeof options.imageSizes === "string"
48886+
? options.imageSizes
48887+
: undefined,
48888+
media:
48889+
typeof options.media === "string" ? options.media : undefined
48890+
}
48891+
);
4881748892
} // We don't error because preload needs to be resilient to being called in a variety of scopes
4881848893
// and the runtime may not be capable of responding. The function is optimistic and not critical
4881948894
// so we favor silent bailout over warning or erroring.
@@ -48861,21 +48936,28 @@ if (__DEV__) {
4886148936
);
4886248937
Internals.d
4886348938
/* ReactDOMCurrentDispatcher */
48864-
.preloadModule(href, {
48865-
as:
48866-
typeof options.as === "string" && options.as !== "script"
48867-
? options.as
48868-
: undefined,
48869-
crossOrigin: crossOrigin,
48870-
integrity:
48871-
typeof options.integrity === "string"
48872-
? options.integrity
48873-
: undefined
48874-
});
48939+
.m(
48940+
/* preloadModule */
48941+
href,
48942+
{
48943+
as:
48944+
typeof options.as === "string" && options.as !== "script"
48945+
? options.as
48946+
: undefined,
48947+
crossOrigin: crossOrigin,
48948+
integrity:
48949+
typeof options.integrity === "string"
48950+
? options.integrity
48951+
: undefined
48952+
}
48953+
);
4887548954
} else {
4887648955
Internals.d
4887748956
/* ReactDOMCurrentDispatcher */
48878-
.preloadModule(href);
48957+
.m(
48958+
/* preloadModule */
48959+
href
48960+
);
4887948961
}
4888048962
} // We don't error because preload needs to be resilient to being called in a variety of scopes
4888148963
// and the runtime may not be capable of responding. The function is optimistic and not critical
@@ -48918,7 +49000,8 @@ if (__DEV__) {
4891849000
if (as === "style") {
4891949001
Internals.d
4892049002
/* ReactDOMCurrentDispatcher */
48921-
.preinitStyle(
49003+
.S(
49004+
/* preinitStyle */
4892249005
href,
4892349006
typeof options.precedence === "string"
4892449007
? options.precedence
@@ -48932,13 +49015,17 @@ if (__DEV__) {
4893249015
} else if (as === "script") {
4893349016
Internals.d
4893449017
/* ReactDOMCurrentDispatcher */
48935-
.preinitScript(href, {
48936-
crossOrigin: crossOrigin,
48937-
integrity: integrity,
48938-
fetchPriority: fetchPriority,
48939-
nonce:
48940-
typeof options.nonce === "string" ? options.nonce : undefined
48941-
});
49018+
.X(
49019+
/* preinitScript */
49020+
href,
49021+
{
49022+
crossOrigin: crossOrigin,
49023+
integrity: integrity,
49024+
fetchPriority: fetchPriority,
49025+
nonce:
49026+
typeof options.nonce === "string" ? options.nonce : undefined
49027+
}
49028+
);
4894249029
}
4894349030
} // We don't error because preinit needs to be resilient to being called in a variety of scopes
4894449031
// and the runtime may not be capable of responding. The function is optimistic and not critical
@@ -49007,20 +49094,29 @@ if (__DEV__) {
4900749094
);
4900849095
Internals.d
4900949096
/* ReactDOMCurrentDispatcher */
49010-
.preinitModuleScript(href, {
49011-
crossOrigin: crossOrigin,
49012-
integrity:
49013-
typeof options.integrity === "string"
49014-
? options.integrity
49015-
: undefined,
49016-
nonce:
49017-
typeof options.nonce === "string" ? options.nonce : undefined
49018-
});
49097+
.M(
49098+
/* preinitModuleScript */
49099+
href,
49100+
{
49101+
crossOrigin: crossOrigin,
49102+
integrity:
49103+
typeof options.integrity === "string"
49104+
? options.integrity
49105+
: undefined,
49106+
nonce:
49107+
typeof options.nonce === "string"
49108+
? options.nonce
49109+
: undefined
49110+
}
49111+
);
4901949112
}
4902049113
} else if (options == null) {
4902149114
Internals.d
4902249115
/* ReactDOMCurrentDispatcher */
49023-
.preinitModuleScript(href);
49116+
.M(
49117+
/* preinitModuleScript */
49118+
href
49119+
);
4902449120
}
4902549121
} // We don't error because preinit needs to be resilient to being called in a variety of scopes
4902649122
// and the runtime may not be capable of responding. The function is optimistic and not critical

0 commit comments

Comments
 (0)