Skip to content

Commit

Permalink
Remove concurrent APIs from stable builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
acdlite committed Oct 15, 2019
1 parent 09633e6 commit dca8802
Show file tree
Hide file tree
Showing 32 changed files with 1,907 additions and 2,190 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Expand Up @@ -252,7 +252,10 @@ jobs:
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run: yarn test-build-devtools --maxWorkers=2
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-build --maxWorkers=2

test_dom_fixtures:
docker: *docker
Expand Down
35 changes: 19 additions & 16 deletions fixtures/dom/src/__tests__/wrong-act-test.js
Expand Up @@ -17,6 +17,7 @@ let TestRenderer;
let ARTTest;

global.__DEV__ = process.env.NODE_ENV !== 'production';
global.__EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';

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

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

it('warns when using createRoot() + .render', () => {
const root = ReactDOM.unstable_createRoot(document.createElement('div'));
expect(() => {
TestRenderer.act(() => {
root.render(<App />);
});
}).toWarnDev(
[
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked',
"It looks like you're using the wrong act()",
],
{
withoutStack: true,
}
);
});
if (__EXPERIMENTAL__) {
it('warns when using createRoot() + .render', () => {
const root = ReactDOM.createRoot(document.createElement('div'));
expect(() => {
TestRenderer.act(() => {
root.render(<App />);
});
}).toWarnDev(
[
'In Concurrent or Sync modes, the "scheduler" module needs to be mocked',
"It looks like you're using the wrong act()",
],
{
withoutStack: true,
}
);
});
}

0 comments on commit dca8802

Please sign in to comment.