Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/devtools_regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,5 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: screenshots
path: ./tmp/screenshots
path: ./tmp/playwright-artifacts
if-no-files-found: warn
6 changes: 6 additions & 0 deletions .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,12 @@ jobs:
- run: ./scripts/ci/run_devtools_e2e_tests.js
env:
RELEASE_CHANNEL: experimental
- name: Archive Playwright report
uses: actions/upload-artifact@v4
with:
name: devtools-playwright-artifacts
path: tmp/playwright-artifacts
if-no-files-found: warn
Comment on lines +834 to +839
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will help debugging CI failures even though that wasn't necessary here. The issue was reproducible locally.


# ----- SIZEBOT -----
sizebot:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ chrome-user-data
.vscode
*.swp
*.swo
/tmp

packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-core/webpack.standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ module.exports = {
{
loader: 'workerize-loader',
options: {
// Workers would have to be exposed on a public path in order to outline them.
inline: true,
name: '[name]',
},
Expand Down
13 changes: 7 additions & 6 deletions packages/react-devtools-extensions/src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
normalizeUrlIfValid,
} from 'react-devtools-shared/src/utils';
import {checkConditions} from 'react-devtools-shared/src/devtools/views/Editor/utils';
import * as parseHookNames from 'react-devtools-shared/src/hooks/parseHookNames';

import {
setBrowserSelectionFromReact,
Expand All @@ -40,6 +41,12 @@ import getProfilingFlags from './getProfilingFlags';
import debounce from './debounce';
import './requestAnimationFramePolyfill';

const resolvedParseHookNames = Promise.resolve(parseHookNames);
// DevTools assumes this is a dynamically imported module. Since we outline
// workers in this bundle, we can sync require the module since it's just a thin
// wrapper around calling the worker.
Comment on lines +46 to +47
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2kB to be specific

const hookNamesModuleLoaderFunction = () => resolvedParseHookNames;

function createBridge() {
bridge = new Bridge({
listen(fn) {
Expand Down Expand Up @@ -188,12 +195,6 @@ function createBridgeAndStore() {
);
};

// TODO (Webpack 5) Hopefully we can remove this prop after the Webpack 5 migration.
const hookNamesModuleLoaderFunction = () =>
import(
/* webpackChunkName: 'parseHookNames' */ 'react-devtools-shared/src/hooks/parseHookNames'
);

root = createRoot(document.createElement('div'));

render = (overrideTab = mostRecentOverrideTab) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ module.exports = {
{
loader: 'workerize-loader',
options: {
inline: true,
inline: false,
name: '[name]',
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-fusebox/webpack.config.frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module.exports = {
{
loader: 'workerize-loader',
options: {
// Workers would have to be exposed on a public path in order to outline them.
inline: true,
name: '[name]',
},
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-inline/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports = {
{
loader: 'workerize-loader',
options: {
// Workers would have to be exposed on a public path in order to outline them.
inline: true,
name: '[name]',
},
Expand Down
24 changes: 16 additions & 8 deletions scripts/ci/run_devtools_e2e_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ROOT_PATH = join(__dirname, '..', '..');
const reactVersion = process.argv[2];
const inlinePackagePath = join(ROOT_PATH, 'packages', 'react-devtools-inline');
const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell');
const screenshotPath = join(ROOT_PATH, 'tmp', 'screenshots');
const playwrightArtifactsPath = join(ROOT_PATH, 'tmp', 'playwright-artifacts');

const {SUCCESSFUL_COMPILATION_MESSAGE} = require(
join(shellPackagePath, 'constants.js')
Expand Down Expand Up @@ -125,14 +125,22 @@ function runTestShell() {
async function runEndToEndTests() {
logBright('Running e2e tests');
if (!reactVersion) {
testProcess = spawn('yarn', ['test:e2e', `--output=${screenshotPath}`], {
cwd: inlinePackagePath,
});
testProcess = spawn(
'yarn',
['test:e2e', `--output=${playwrightArtifactsPath}`],
{
cwd: inlinePackagePath,
}
);
} else {
testProcess = spawn('yarn', ['test:e2e', `--output=${screenshotPath}`], {
cwd: inlinePackagePath,
env: {...process.env, REACT_VERSION: reactVersion},
});
testProcess = spawn(
'yarn',
['test:e2e', `--output=${playwrightArtifactsPath}`],
{
cwd: inlinePackagePath,
env: {...process.env, REACT_VERSION: reactVersion},
}
);
}

testProcess.stdout.on('data', data => {
Expand Down
Loading