Skip to content

Commit 53e0ed1

Browse files
committed
Minify DEV bundles with closure (#29809)
The goal is to improve speed of the development by inlining and DCE unused branches. We have the ability to preserve some variable names and pretty print in the production version so might as well do the same with DEV. DiffTrain build for commit c2ae9e2.
1 parent 848ae6c commit 53e0ed1

File tree

19 files changed

+52669
-86210
lines changed

19 files changed

+52669
-86210
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-20b6f4c0e8-20240607
1+
19.0.0-native-fb-c2ae9e28bc-20240608

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-is/cjs/ReactIs-dev.js

Lines changed: 119 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -7,197 +7,129 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<a12e42d980c252cd9449b3f2a99f483a>>
10+
* @generated SignedSource<<ff1f9a3938ee5baa52e815facaa7d1d1>>
1111
*/
1212

13-
'use strict';
14-
15-
if (__DEV__) {
16-
(function() {
17-
'use strict';
18-
19-
// Re-export dynamic flags from the internal module.
20-
var enableDebugTracing = false;
21-
var enableRenderableContext = true;
22-
var enableScopeAPI = false;
23-
var enableLegacyHidden = false;
24-
var enableTransitionTracing = false;
25-
26-
// When adding new symbols to this file,
27-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
28-
// The Symbol used to tag the ReactElement-like types.
29-
30-
var REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element');
31-
var REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE;
32-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
33-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
34-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
35-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
36-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
37-
38-
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
39-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
40-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
41-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
42-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
43-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
44-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
45-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
46-
47-
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); // This function is deprecated. Don't use. Only the renderer knows what a valid type is.
48-
// TODO: Delete this when enableOwnerStacks ships.
49-
50-
function isValidElementType(type) {
51-
if (typeof type === 'string' || typeof type === 'function') {
52-
return true;
53-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
54-
55-
56-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
57-
return true;
58-
}
59-
60-
if (typeof type === 'object' && type !== null) {
61-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
62-
// types supported by any Flight configuration anywhere since
63-
// we don't know which Flight build this will end up being used
64-
// with.
65-
type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== undefined) {
66-
return true;
67-
}
68-
}
69-
70-
return false;
71-
}
72-
73-
function typeOf(object) {
74-
if (typeof object === 'object' && object !== null) {
75-
var $$typeof = object.$$typeof;
76-
77-
switch ($$typeof) {
78-
case REACT_ELEMENT_TYPE:
79-
var type = object.type;
80-
81-
switch (type) {
82-
case REACT_FRAGMENT_TYPE:
83-
case REACT_PROFILER_TYPE:
84-
case REACT_STRICT_MODE_TYPE:
85-
case REACT_SUSPENSE_TYPE:
86-
case REACT_SUSPENSE_LIST_TYPE:
87-
return type;
88-
89-
default:
90-
var $$typeofType = type && type.$$typeof;
91-
92-
switch ($$typeofType) {
93-
case REACT_CONTEXT_TYPE:
94-
case REACT_FORWARD_REF_TYPE:
95-
case REACT_LAZY_TYPE:
96-
case REACT_MEMO_TYPE:
97-
return $$typeofType;
98-
99-
case REACT_CONSUMER_TYPE:
100-
{
101-
return $$typeofType;
102-
}
103-
104-
// Fall through
105-
106-
case REACT_PROVIDER_TYPE:
107-
108-
// Fall through
109-
13+
"use strict";
14+
__DEV__ &&
15+
(function () {
16+
function typeOf(object) {
17+
if ("object" === typeof object && null !== object) {
18+
var $$typeof = object.$$typeof;
19+
switch ($$typeof) {
20+
case REACT_ELEMENT_TYPE:
21+
switch (((object = object.type), object)) {
22+
case REACT_FRAGMENT_TYPE:
23+
case REACT_PROFILER_TYPE:
24+
case REACT_STRICT_MODE_TYPE:
25+
case REACT_SUSPENSE_TYPE:
26+
case REACT_SUSPENSE_LIST_TYPE:
27+
return object;
11028
default:
111-
return $$typeof;
29+
switch (((object = object && object.$$typeof), object)) {
30+
case REACT_CONTEXT_TYPE:
31+
case REACT_FORWARD_REF_TYPE:
32+
case REACT_LAZY_TYPE:
33+
case REACT_MEMO_TYPE:
34+
return object;
35+
case REACT_CONSUMER_TYPE:
36+
return object;
37+
default:
38+
return $$typeof;
39+
}
11240
}
113-
41+
case REACT_PORTAL_TYPE:
42+
return $$typeof;
11443
}
115-
116-
case REACT_PORTAL_TYPE:
117-
return $$typeof;
44+
}
11845
}
119-
}
120-
121-
return undefined;
122-
}
123-
var ContextConsumer = REACT_CONSUMER_TYPE ;
124-
var ContextProvider = REACT_CONTEXT_TYPE ;
125-
var Element = REACT_ELEMENT_TYPE;
126-
var ForwardRef = REACT_FORWARD_REF_TYPE;
127-
var Fragment = REACT_FRAGMENT_TYPE;
128-
var Lazy = REACT_LAZY_TYPE;
129-
var Memo = REACT_MEMO_TYPE;
130-
var Portal = REACT_PORTAL_TYPE;
131-
var Profiler = REACT_PROFILER_TYPE;
132-
var StrictMode = REACT_STRICT_MODE_TYPE;
133-
var Suspense = REACT_SUSPENSE_TYPE;
134-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
135-
function isContextConsumer(object) {
136-
{
137-
return typeOf(object) === REACT_CONSUMER_TYPE;
138-
}
139-
}
140-
function isContextProvider(object) {
141-
{
142-
return typeOf(object) === REACT_CONTEXT_TYPE;
143-
}
144-
}
145-
function isElement(object) {
146-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
147-
}
148-
function isForwardRef(object) {
149-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
150-
}
151-
function isFragment(object) {
152-
return typeOf(object) === REACT_FRAGMENT_TYPE;
153-
}
154-
function isLazy(object) {
155-
return typeOf(object) === REACT_LAZY_TYPE;
156-
}
157-
function isMemo(object) {
158-
return typeOf(object) === REACT_MEMO_TYPE;
159-
}
160-
function isPortal(object) {
161-
return typeOf(object) === REACT_PORTAL_TYPE;
162-
}
163-
function isProfiler(object) {
164-
return typeOf(object) === REACT_PROFILER_TYPE;
165-
}
166-
function isStrictMode(object) {
167-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
168-
}
169-
function isSuspense(object) {
170-
return typeOf(object) === REACT_SUSPENSE_TYPE;
171-
}
172-
function isSuspenseList(object) {
173-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
174-
}
175-
176-
exports.ContextConsumer = ContextConsumer;
177-
exports.ContextProvider = ContextProvider;
178-
exports.Element = Element;
179-
exports.ForwardRef = ForwardRef;
180-
exports.Fragment = Fragment;
181-
exports.Lazy = Lazy;
182-
exports.Memo = Memo;
183-
exports.Portal = Portal;
184-
exports.Profiler = Profiler;
185-
exports.StrictMode = StrictMode;
186-
exports.Suspense = Suspense;
187-
exports.SuspenseList = SuspenseList;
188-
exports.isContextConsumer = isContextConsumer;
189-
exports.isContextProvider = isContextProvider;
190-
exports.isElement = isElement;
191-
exports.isForwardRef = isForwardRef;
192-
exports.isFragment = isFragment;
193-
exports.isLazy = isLazy;
194-
exports.isMemo = isMemo;
195-
exports.isPortal = isPortal;
196-
exports.isProfiler = isProfiler;
197-
exports.isStrictMode = isStrictMode;
198-
exports.isSuspense = isSuspense;
199-
exports.isSuspenseList = isSuspenseList;
200-
exports.isValidElementType = isValidElementType;
201-
exports.typeOf = typeOf;
46+
var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
47+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
48+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
49+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
50+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
51+
Symbol.for("react.provider");
52+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
53+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
54+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
55+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
56+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
57+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
58+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
59+
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
60+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
61+
exports.ContextConsumer = REACT_CONSUMER_TYPE;
62+
exports.ContextProvider = REACT_CONTEXT_TYPE;
63+
exports.Element = REACT_ELEMENT_TYPE;
64+
exports.ForwardRef = REACT_FORWARD_REF_TYPE;
65+
exports.Fragment = REACT_FRAGMENT_TYPE;
66+
exports.Lazy = REACT_LAZY_TYPE;
67+
exports.Memo = REACT_MEMO_TYPE;
68+
exports.Portal = REACT_PORTAL_TYPE;
69+
exports.Profiler = REACT_PROFILER_TYPE;
70+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
71+
exports.Suspense = REACT_SUSPENSE_TYPE;
72+
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
73+
exports.isContextConsumer = function (object) {
74+
return typeOf(object) === REACT_CONSUMER_TYPE;
75+
};
76+
exports.isContextProvider = function (object) {
77+
return typeOf(object) === REACT_CONTEXT_TYPE;
78+
};
79+
exports.isElement = function (object) {
80+
return (
81+
"object" === typeof object &&
82+
null !== object &&
83+
object.$$typeof === REACT_ELEMENT_TYPE
84+
);
85+
};
86+
exports.isForwardRef = function (object) {
87+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
88+
};
89+
exports.isFragment = function (object) {
90+
return typeOf(object) === REACT_FRAGMENT_TYPE;
91+
};
92+
exports.isLazy = function (object) {
93+
return typeOf(object) === REACT_LAZY_TYPE;
94+
};
95+
exports.isMemo = function (object) {
96+
return typeOf(object) === REACT_MEMO_TYPE;
97+
};
98+
exports.isPortal = function (object) {
99+
return typeOf(object) === REACT_PORTAL_TYPE;
100+
};
101+
exports.isProfiler = function (object) {
102+
return typeOf(object) === REACT_PROFILER_TYPE;
103+
};
104+
exports.isStrictMode = function (object) {
105+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
106+
};
107+
exports.isSuspense = function (object) {
108+
return typeOf(object) === REACT_SUSPENSE_TYPE;
109+
};
110+
exports.isSuspenseList = function (object) {
111+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
112+
};
113+
exports.isValidElementType = function (type) {
114+
return "string" === typeof type ||
115+
"function" === typeof type ||
116+
type === REACT_FRAGMENT_TYPE ||
117+
type === REACT_PROFILER_TYPE ||
118+
type === REACT_STRICT_MODE_TYPE ||
119+
type === REACT_SUSPENSE_TYPE ||
120+
type === REACT_SUSPENSE_LIST_TYPE ||
121+
type === REACT_OFFSCREEN_TYPE ||
122+
("object" === typeof type &&
123+
null !== type &&
124+
(type.$$typeof === REACT_LAZY_TYPE ||
125+
type.$$typeof === REACT_MEMO_TYPE ||
126+
type.$$typeof === REACT_CONTEXT_TYPE ||
127+
type.$$typeof === REACT_CONSUMER_TYPE ||
128+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
129+
type.$$typeof === REACT_CLIENT_REFERENCE ||
130+
void 0 !== type.getModuleId))
131+
? !0
132+
: !1;
133+
};
134+
exports.typeOf = typeOf;
202135
})();
203-
}

0 commit comments

Comments
 (0)