Skip to content

Commit f613165

Browse files
authored
Rename SECRET INTERNALS to __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE (#28789)
Follow up to #28783 and #28786. Since we've changed the implementations of these we can rename them to something a bit more descriptive while we're at it, since anyone depending on them will need to upgrade their code anyway. "react" with no condition: `__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` "react" with "react-server" condition: `__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` "react-dom": `__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`
1 parent 50895bc commit f613165

File tree

54 files changed

+607
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+607
-448
lines changed

fixtures/dom/public/act-dom.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<script src="scheduler-unstable_mock.development.js"></script>
1111
<script src="react.development.js"></script>
1212
<script type="text/javascript">
13-
window.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler =
13+
window.React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.Scheduler =
1414
window.SchedulerMock;
1515
</script>
1616
<script src="react-dom.development.js"></script>

packages/react-cache/src/ReactCacheOld.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Resolved = 1;
4545
const Rejected = 2;
4646

4747
const SharedInternals =
48-
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
4949

5050
function readContext(Context: ReactContext<mixed>) {
5151
const dispatcher = SharedInternals.H;

packages/react-devtools-shared/src/__tests__/legacy/editing-test.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ describe('editing interface', () => {
6464

6565
act(() =>
6666
ReactDOM.render(
67-
<ClassComponent
68-
array={[1, 2, 3]}
69-
object={{nested: 'initial'}}
70-
shallow="initial"
71-
/>,
67+
React.createElement(ClassComponent, {
68+
array: [1, 2, 3],
69+
object: {nested: 'initial'},
70+
shallow: 'initial',
71+
}),
7272
document.createElement('div'),
7373
),
7474
);
@@ -270,7 +270,10 @@ describe('editing interface', () => {
270270

271271
act(() =>
272272
ReactDOM.render(
273-
<ClassComponent object={{nested: 'initial'}} shallow="initial" />,
273+
React.createElement(ClassComponent, {
274+
object: {nested: 'initial'},
275+
shallow: 'initial',
276+
}),
274277
document.createElement('div'),
275278
),
276279
);
@@ -489,9 +492,11 @@ describe('editing interface', () => {
489492

490493
act(() =>
491494
ReactDOM.render(
492-
<LegacyContextProvider>
493-
<ClassComponent />
494-
</LegacyContextProvider>,
495+
React.createElement(
496+
LegacyContextProvider,
497+
null,
498+
React.createElement(ClassComponent),
499+
),
495500
document.createElement('div'),
496501
),
497502
);

packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js

+64-58
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ describe('InspectedElementContext', () => {
6262
const Example = () => null;
6363

6464
act(() =>
65-
ReactDOM.render(<Example a={1} b="abc" />, document.createElement('div')),
65+
ReactDOM.render(
66+
React.createElement(Example, {a: 1, b: 'abc'}),
67+
document.createElement('div'),
68+
),
6669
);
6770

6871
const id = ((store.getElementIDAtIndex(0): any): number);
@@ -91,19 +94,19 @@ describe('InspectedElementContext', () => {
9194

9295
act(() =>
9396
ReactDOM.render(
94-
<Example
95-
boolean_false={false}
96-
boolean_true={true}
97-
infinity={Infinity}
98-
integer_zero={0}
99-
integer_one={1}
100-
float={1.23}
101-
string="abc"
102-
string_empty=""
103-
nan={NaN}
104-
value_null={null}
105-
value_undefined={undefined}
106-
/>,
97+
React.createElement(Example, {
98+
boolean_false: false,
99+
boolean_true: true,
100+
infinity: Infinity,
101+
integer_zero: 0,
102+
integer_one: 1,
103+
float: 1.23,
104+
string: 'abc',
105+
string_empty: '',
106+
nan: NaN,
107+
value_null: null,
108+
value_undefined: undefined,
109+
}),
107110
document.createElement('div'),
108111
),
109112
);
@@ -178,28 +181,28 @@ describe('InspectedElementContext', () => {
178181

179182
act(() =>
180183
ReactDOM.render(
181-
<Example
182-
anonymous_fn={instance.anonymousFunction}
183-
array_buffer={arrayBuffer}
184-
array_of_arrays={arrayOfArrays}
184+
React.createElement(Example, {
185+
anonymous_fn: instance.anonymousFunction,
186+
array_buffer: arrayBuffer,
187+
array_of_arrays: arrayOfArrays,
185188
// eslint-disable-next-line no-undef
186-
big_int={BigInt(123)}
187-
bound_fn={exampleFunction.bind(this)}
188-
data_view={dataView}
189-
date={new Date(123)}
190-
fn={exampleFunction}
191-
html_element={div}
192-
immutable={immutableMap}
193-
map={mapShallow}
194-
map_of_maps={mapOfMaps}
195-
object_of_objects={objectOfObjects}
196-
react_element={<span />}
197-
regexp={/abc/giu}
198-
set={setShallow}
199-
set_of_sets={setOfSets}
200-
symbol={Symbol('symbol')}
201-
typed_array={typedArray}
202-
/>,
189+
big_int: BigInt(123),
190+
bound_fn: exampleFunction.bind(this),
191+
data_view: dataView,
192+
date: new Date(123),
193+
fn: exampleFunction,
194+
html_element: div,
195+
immutable: immutableMap,
196+
map: mapShallow,
197+
map_of_maps: mapOfMaps,
198+
object_of_objects: objectOfObjects,
199+
react_element: React.createElement('span'),
200+
regexp: /abc/giu,
201+
set: setShallow,
202+
set_of_sets: setOfSets,
203+
symbol: Symbol('symbol'),
204+
typed_array: typedArray,
205+
}),
203206
document.createElement('div'),
204207
),
205208
);
@@ -333,7 +336,7 @@ describe('InspectedElementContext', () => {
333336

334337
act(() =>
335338
ReactDOM.render(
336-
<Example object={object} />,
339+
React.createElement(Example, {object}),
337340
document.createElement('div'),
338341
),
339342
);
@@ -363,7 +366,7 @@ describe('InspectedElementContext', () => {
363366

364367
act(() =>
365368
ReactDOM.render(
366-
<Example object={object} />,
369+
React.createElement(Example, {object}),
367370
document.createElement('div'),
368371
),
369372
);
@@ -390,7 +393,7 @@ describe('InspectedElementContext', () => {
390393

391394
act(() =>
392395
ReactDOM.render(
393-
<Example iteratable={iteratable} />,
396+
React.createElement(Example, {iteratable}),
394397
document.createElement('div'),
395398
),
396399
);
@@ -445,7 +448,7 @@ describe('InspectedElementContext', () => {
445448

446449
act(() =>
447450
ReactDOM.render(
448-
<Example data={new CustomData()} />,
451+
React.createElement(Example, {data: new CustomData()}),
449452
document.createElement('div'),
450453
),
451454
);
@@ -537,7 +540,10 @@ describe('InspectedElementContext', () => {
537540
});
538541

539542
act(() =>
540-
ReactDOM.render(<Example data={object} />, document.createElement('div')),
543+
ReactDOM.render(
544+
React.createElement(Example, {data: object}),
545+
document.createElement('div'),
546+
),
541547
);
542548

543549
const id = ((store.getElementIDAtIndex(0): any): number);
@@ -605,7 +611,7 @@ describe('InspectedElementContext', () => {
605611
const Example = ({data}) => null;
606612
act(() =>
607613
ReactDOM.render(
608-
<Example data={testData} />,
614+
React.createElement(Example, {data: testData}),
609615
document.createElement('div'),
610616
),
611617
);
@@ -631,8 +637,8 @@ describe('InspectedElementContext', () => {
631637

632638
act(() =>
633639
ReactDOM.render(
634-
<Example
635-
nestedObject={{
640+
React.createElement(Example, {
641+
nestedObject: {
636642
a: {
637643
b: {
638644
c: [
@@ -644,8 +650,8 @@ describe('InspectedElementContext', () => {
644650
],
645651
},
646652
},
647-
}}
648-
/>,
653+
},
654+
}),
649655
document.createElement('div'),
650656
),
651657
);
@@ -746,7 +752,7 @@ describe('InspectedElementContext', () => {
746752

747753
act(() =>
748754
ReactDOM.render(
749-
<Example nestedObject={nestedObject} />,
755+
React.createElement(Example, {nestedObject}),
750756
document.createElement('div'),
751757
),
752758
);
@@ -802,7 +808,7 @@ describe('InspectedElementContext', () => {
802808

803809
act(() =>
804810
ReactDOM.render(
805-
<Example nestedObject={nestedObject} />,
811+
React.createElement(Example, {nestedObject}),
806812
document.createElement('div'),
807813
),
808814
);
@@ -872,17 +878,17 @@ describe('InspectedElementContext', () => {
872878

873879
act(() =>
874880
ReactDOM.render(
875-
<Example
876-
arrayBuffer={arrayBuffer}
877-
dataView={dataView}
878-
map={map}
879-
set={set}
880-
mapOfMaps={mapOfMaps}
881-
setOfSets={setOfSets}
882-
typedArray={typedArray}
883-
immutable={immutable}
884-
bigInt={bigInt}
885-
/>,
881+
React.createElement(Example, {
882+
arrayBuffer: arrayBuffer,
883+
dataView: dataView,
884+
map: map,
885+
set: set,
886+
mapOfMaps: mapOfMaps,
887+
setOfSets: setOfSets,
888+
typedArray: typedArray,
889+
immutable: immutable,
890+
bigInt: bigInt,
891+
}),
886892
document.createElement('div'),
887893
),
888894
);

0 commit comments

Comments
 (0)