Skip to content

Commit 30c5daf

Browse files
authored
Remove concurrent apis from stable (#17088)
* Tests run in experimental mode by default For local development, you usually want experiments enabled. Unless the release channel is set with an environment variable, tests will run with __EXPERIMENTAL__ set to `true`. * Remove concurrent APIs from stable builds Those who want to try concurrent mode should use the experimental builds instead. I've left the `unstable_` prefixed APIs in the Facebook build so we can continue experimenting with them internally without blessing them for widespread use. * Turn on SSR flags in experimental build * Remove prefixed concurrent APIs from www build Instead we'll use the experimental builds when syncing to www. * Remove "canary" from internal React version string
1 parent 4cb399a commit 30c5daf

33 files changed

+1946
-2198
lines changed

.circleci/config.yml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ jobs:
9898
- checkout
9999
- *restore_yarn_cache
100100
- *run_yarn
101-
- run: yarn test --maxWorkers=2
101+
- run:
102+
environment:
103+
RELEASE_CHANNEL: stable
104+
command: yarn test --maxWorkers=2
102105

103106
test_source_experimental:
104107
docker: *docker
@@ -120,7 +123,10 @@ jobs:
120123
- checkout
121124
- *restore_yarn_cache
122125
- *run_yarn
123-
- run: yarn test-persistent --maxWorkers=2
126+
- run:
127+
environment:
128+
RELEASE_CHANNEL: stable
129+
command: yarn test-persistent --maxWorkers=2
124130

125131
test_source_prod:
126132
docker: *docker
@@ -130,7 +136,10 @@ jobs:
130136
- checkout
131137
- *restore_yarn_cache
132138
- *run_yarn
133-
- run: yarn test-prod --maxWorkers=2
139+
- run:
140+
environment:
141+
RELEASE_CHANNEL: stable
142+
command: yarn test-prod --maxWorkers=2
134143

135144
build:
136145
docker: *docker
@@ -217,7 +226,23 @@ jobs:
217226
- attach_workspace: *attach_workspace
218227
- *restore_yarn_cache
219228
- *run_yarn
220-
- run: yarn test-build --maxWorkers=2
229+
- run:
230+
environment:
231+
RELEASE_CHANNEL: stable
232+
command: yarn test-build --maxWorkers=2
233+
234+
test_build_experimental:
235+
docker: *docker
236+
environment: *environment
237+
steps:
238+
- checkout
239+
- attach_workspace: *attach_workspace
240+
- *restore_yarn_cache
241+
- *run_yarn
242+
- run:
243+
environment:
244+
RELEASE_CHANNEL: experimental
245+
command: yarn test-build --maxWorkers=2
221246

222247
test_build_devtools:
223248
docker: *docker
@@ -227,7 +252,10 @@ jobs:
227252
- attach_workspace: *attach_workspace
228253
- *restore_yarn_cache
229254
- *run_yarn
230-
- run: yarn test-build-devtools --maxWorkers=2
255+
- run:
256+
environment:
257+
RELEASE_CHANNEL: stable
258+
command: yarn test-build --maxWorkers=2
231259

232260
test_dom_fixtures:
233261
docker: *docker
@@ -238,6 +266,8 @@ jobs:
238266
- *restore_yarn_cache
239267
- run:
240268
name: Run DOM fixture tests
269+
environment:
270+
RELEASE_CHANNEL: stable
241271
command: |
242272
cd fixtures/dom
243273
yarn --frozen-lockfile
@@ -265,7 +295,23 @@ jobs:
265295
- attach_workspace: *attach_workspace
266296
- *restore_yarn_cache
267297
- *run_yarn
268-
- run: yarn test-build-prod --maxWorkers=2
298+
- run:
299+
environment:
300+
RELEASE_CHANNEL: stable
301+
command: yarn test-build-prod --maxWorkers=2
302+
303+
test_build_prod_experimental:
304+
docker: *docker
305+
environment: *environment
306+
steps:
307+
- checkout
308+
- attach_workspace: *attach_workspace
309+
- *restore_yarn_cache
310+
- *run_yarn
311+
- run:
312+
environment:
313+
RELEASE_CHANNEL: experimental
314+
command: yarn test-build-prod --maxWorkers=2
269315

270316
workflows:
271317
version: 2
@@ -324,6 +370,12 @@ workflows:
324370
- process_artifacts_experimental:
325371
requires:
326372
- build_experimental
373+
- test_build_experimental:
374+
requires:
375+
- build_experimental
376+
- test_build_prod_experimental:
377+
requires:
378+
- build_experimental
327379

328380
fuzz_tests:
329381
triggers:

fixtures/dom/src/__tests__/wrong-act-test.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ let TestRenderer;
1717
let ARTTest;
1818

1919
global.__DEV__ = process.env.NODE_ENV !== 'production';
20+
global.__EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';
2021

2122
expect.extend(require('../toWarnDev'));
2223

@@ -176,19 +177,21 @@ it("doesn't warn if you use nested acts from different renderers", () => {
176177
});
177178
});
178179

179-
it('warns when using createRoot() + .render', () => {
180-
const root = ReactDOM.unstable_createRoot(document.createElement('div'));
181-
expect(() => {
182-
TestRenderer.act(() => {
183-
root.render(<App />);
184-
});
185-
}).toWarnDev(
186-
[
187-
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked',
188-
"It looks like you're using the wrong act()",
189-
],
190-
{
191-
withoutStack: true,
192-
}
193-
);
194-
});
180+
if (__EXPERIMENTAL__) {
181+
it('warns when using createRoot() + .render', () => {
182+
const root = ReactDOM.createRoot(document.createElement('div'));
183+
expect(() => {
184+
TestRenderer.act(() => {
185+
root.render(<App />);
186+
});
187+
}).toWarnDev(
188+
[
189+
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked',
190+
"It looks like you're using the wrong act()",
191+
],
192+
{
193+
withoutStack: true,
194+
}
195+
);
196+
});
197+
}

0 commit comments

Comments
 (0)