Skip to content

Commit 8ce9b42

Browse files
authored
Merge branch 'main' into eslint-config-update
2 parents dd52384 + f320ef8 commit 8ce9b42

File tree

45 files changed

+252
-328
lines changed

Some content is hidden

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

45 files changed

+252
-328
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ workflows:
464464
- setup
465465
commit_sha: << pipeline.parameters.prerelease_commit_sha >>
466466
release_channel: stable
467-
dist_tag: "next,alpha"
467+
dist_tag: "next,beta"
468468
- publish_prerelease:
469469
name: Publish to Experimental channel
470470
requires:
@@ -496,7 +496,7 @@ workflows:
496496
- setup
497497
commit_sha: << pipeline.git.revision >>
498498
release_channel: stable
499-
dist_tag: "next,alpha"
499+
dist_tag: "next,beta"
500500
- publish_prerelease:
501501
name: Publish to Experimental channel
502502
requires:

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ module.exports = {
110110
{isProductionUserAppCode: true},
111111
],
112112
'react-internal/no-to-warn-dev-within-to-throw': ERROR,
113-
'react-internal/invariant-args': ERROR,
114113
'react-internal/warning-args': ERROR,
115114
'react-internal/no-production-logging': ERROR,
116115
'react-internal/no-cross-fork-imports': ERROR,

ReactVersions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const ReactVersion = '18.0.0';
2222

2323
// The label used by the @next channel. Represents the upcoming release's
2424
// stability. Could be "alpha", "beta", "rc", etc.
25-
const nextChannelLabel = 'alpha';
25+
const nextChannelLabel = 'beta';
2626

2727
const stablePackages = {
2828
'create-subscription': ReactVersion,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"scripts": {
110110
"build": "node ./scripts/rollup/build.js",
111111
"build-combined": "node ./scripts/rollup/build-all-release-channels.js",
112-
"build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
112+
"build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/test,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
113113
"build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
114114
"build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
115115
"linc": "node ./scripts/tasks/linc.js",
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
'use strict';
2+
3+
const {test, expect} = require('@playwright/test');
4+
const config = require('../../playwright.config');
5+
test.use(config);
6+
7+
test.describe('Testing Todo-List App', () => {
8+
let page, frameElementHandle, frame;
9+
test.beforeAll(async ({browser}) => {
10+
page = await browser.newPage();
11+
await page.goto('http://localhost:8080/', {waitUntil: 'domcontentloaded'});
12+
await page.waitForSelector('iframe#target');
13+
frameElementHandle = await page.$('#target');
14+
frame = await frameElementHandle.contentFrame();
15+
});
16+
17+
test('The Todo List should contain 3 items by default', async () => {
18+
const list = frame.locator('.listitem');
19+
await expect(list).toHaveCount(3);
20+
});
21+
22+
test('Add another item Fourth to list', async () => {
23+
await frame.type('.input', 'Fourth');
24+
await frame.click('button.iconbutton');
25+
const listItems = await frame.locator('.label');
26+
await expect(listItems).toHaveText(['First', 'Second', 'Third', 'Fourth']);
27+
});
28+
29+
test('Inspecting list elements with devtools', async () => {
30+
// Component props are used as string in devtools.
31+
const listItemsProps = [
32+
'',
33+
'{id: 1, isComplete: true, text: "First"}',
34+
'{id: 2, isComplete: true, text: "Second"}',
35+
'{id: 3, isComplete: false, text: "Third"}',
36+
'{id: 4, isComplete: false, text: "Fourth"}',
37+
];
38+
const countOfItems = await frame.$$eval('.listitem', el => el.length);
39+
// For every item in list click on devtools inspect icon
40+
// click on the list item to quickly navigate to the list item component in devtools
41+
// comparing displayed props with the array of props.
42+
for (let i = 1; i <= countOfItems; ++i) {
43+
await page.click('[class^=ToggleContent]', {delay: 100});
44+
await frame.click(`.listitem:nth-child(${i})`, {delay: 50});
45+
await page.waitForSelector('span.Value___tNzum');
46+
const text = await page.innerText('span[class^=Value]');
47+
await expect(text).toEqual(listItemsProps[i]);
48+
}
49+
});
50+
});

packages/react-devtools-inline/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"scripts": {
2020
"build": "cross-env NODE_ENV=production webpack --config webpack.config.js",
2121
"prepublish": "yarn run build",
22-
"start": "cross-env NODE_ENV=development webpack --config webpack.config.js --watch"
22+
"start": "cross-env NODE_ENV=development webpack --config webpack.config.js --watch",
23+
"test:e2e": "playwright test --config=playwright.config.js"
2324
},
2425
"dependencies": {
2526
"source-map-js": "^0.6.2",
@@ -33,6 +34,7 @@
3334
"@babel/preset-env": "^7.11.0",
3435
"@babel/preset-flow": "^7.10.4",
3536
"@babel/preset-react": "^7.10.4",
37+
"@playwright/test": "^1.16.3",
3638
"babel-core": "^7.0.0-bridge",
3739
"babel-eslint": "^9.0.0",
3840
"babel-loader": "^8.0.4",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const config = {
2+
use: {
3+
headless: false,
4+
browserName: 'chromium',
5+
launchOptions: {
6+
slowMo: 100,
7+
},
8+
},
9+
};
10+
11+
module.exports = config;

packages/react-devtools-inline/webpack.config.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ const babelOptions = {
3333
),
3434
};
3535

36+
const builtModulesDir = resolve(
37+
__dirname,
38+
'..',
39+
'..',
40+
'build',
41+
'oss-experimental',
42+
);
43+
3644
module.exports = {
3745
mode: __DEV__ ? 'development' : 'production',
3846
devtool: __DEV__ ? 'eval-cheap-source-map' : 'source-map',
@@ -49,12 +57,10 @@ module.exports = {
4957
libraryTarget: 'commonjs2',
5058
},
5159
externals: {
52-
react: 'react',
53-
// TODO: Once this package is published, remove the external
54-
// 'react-debug-tools': 'react-debug-tools',
55-
'react-dom': 'react-dom',
56-
'react-is': 'react-is',
57-
scheduler: 'scheduler',
60+
react: resolve(builtModulesDir, 'react'),
61+
'react-dom': resolve(builtModulesDir, 'react-dom/unstable_testing'),
62+
'react-is': resolve(builtModulesDir, 'react-is'),
63+
scheduler: resolve(builtModulesDir, 'scheduler'),
5864
},
5965
node: {
6066
// source-maps package has a dependency on 'fs'

packages/react-devtools-shell/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const config = {
5555
react: resolve(builtModulesDir, 'react'),
5656
'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'),
5757
'react-devtools-feature-flags': resolveFeatureFlags('shell'),
58-
'react-dom': resolve(builtModulesDir, 'react-dom'),
58+
'react-dom': resolve(builtModulesDir, 'react-dom/unstable_testing'),
5959
'react-is': resolve(builtModulesDir, 'react-is'),
6060
scheduler: resolve(builtModulesDir, 'scheduler'),
6161
},
@@ -107,7 +107,7 @@ const config = {
107107
options: {
108108
sourceMap: true,
109109
modules: true,
110-
localIdentName: '[local]___[hash:base64:5]',
110+
localIdentName: '[local]',
111111
},
112112
},
113113
],

packages/react-dom/index.classic.fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ export {
3434
unstable_isNewReconciler,
3535
unstable_renderSubtreeIntoContainer,
3636
unstable_runWithPriority, // DO NOT USE: Temporarily exposed to migrate off of Scheduler.runWithPriority.
37-
unstable_scheduleHydration,
3837
version,
3938
} from './src/client/ReactDOM';

0 commit comments

Comments
 (0)