Skip to content

Commit 383c241

Browse files
feat(v13): enable concurrent rendering by default (#1692)
* feat!: enable concurrent rendering by default * chore: tweaks
1 parent 3abeac3 commit 383c241

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

.github/workflows/ci.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
test:
4848
needs: [install-cache-deps]
4949
runs-on: ubuntu-latest
50-
name: Test
50+
name: Test (concurrent by default)
5151
steps:
5252
- name: Checkout
5353
uses: actions/checkout@v4
@@ -61,11 +61,10 @@ jobs:
6161
- name: Upload coverage to Codecov
6262
uses: codecov/codecov-action@v4
6363

64-
65-
test-concurrent:
64+
test-legacy:
6665
needs: [install-cache-deps]
6766
runs-on: ubuntu-latest
68-
name: Test (concurrent mode)
67+
name: Test (legacy)
6968
steps:
7069
- name: Checkout
7170
uses: actions/checkout@v4
@@ -74,7 +73,7 @@ jobs:
7473
uses: ./.github/actions/setup-deps
7574

7675
- name: Test in concurrent mode
77-
run: CONCURRENT_MODE=1 yarn test:ci
76+
run: CONCURRENT_MODE=0 yarn test:ci
7877

7978
test-website:
8079
runs-on: ubuntu-latest

jest-setup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './src/matchers/extend-expect';
33

44
beforeEach(() => {
55
resetToDefaults();
6-
if (process.env.CONCURRENT_MODE === '1') {
7-
configure({ concurrentRoot: true });
6+
if (process.env.CONCURRENT_MODE === '0') {
7+
configure({ concurrentRoot: false });
88
}
99
});

src/__tests__/config.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test('configure() overrides existing config values', () => {
1616
asyncUtilTimeout: 5000,
1717
defaultDebugOptions: { message: 'debug message' },
1818
defaultIncludeHiddenElements: false,
19-
concurrentRoot: false,
19+
concurrentRoot: true,
2020
});
2121
});
2222

src/config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export type Config = {
1515
defaultDebugOptions?: Partial<DebugOptions>;
1616

1717
/**
18-
* Set to `true` to enable concurrent rendering.
19-
* Otherwise `render` will default to legacy synchronous rendering.
18+
* Set to `false` to disable concurrent rendering.
19+
* Otherwise `render` will default to concurrent rendering.
2020
*/
2121
concurrentRoot: boolean;
2222
};
@@ -43,7 +43,7 @@ export type InternalConfig = Config & {
4343
const defaultConfig: InternalConfig = {
4444
asyncUtilTimeout: 1000,
4545
defaultIncludeHiddenElements: false,
46-
concurrentRoot: false,
46+
concurrentRoot: true,
4747
};
4848

4949
let config = { ...defaultConfig };

src/render.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export interface RenderOptions {
2424
wrapper?: React.ComponentType<any>;
2525

2626
/**
27-
* Set to `true` to enable concurrent rendering.
28-
* Otherwise `render` will default to legacy synchronous rendering.
27+
* Set to `false` to disable concurrent rendering.
28+
* Otherwise `render` will default to concurrent rendering.
2929
*/
30-
concurrentRoot?: boolean | undefined;
30+
concurrentRoot?: boolean;
3131

3232
createNodeMock?: (element: React.ReactElement) => unknown;
3333
unstable_validateStringsRenderedWithinText?: boolean;

0 commit comments

Comments
 (0)