Skip to content

Commit 4d6376a

Browse files
author
Brian Vaughn
committed
Import scheduling profiler into DevTools Profiler tab
1 parent 25f09e3 commit 4d6376a

Some content is hidden

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

58 files changed

+872
-997
lines changed

.circleci/config.yml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -227,48 +227,6 @@ jobs:
227227
- store_artifacts:
228228
path: ./build/devtools.tgz
229229

230-
build_devtools_scheduling_profiler:
231-
docker: *docker
232-
environment: *environment
233-
steps:
234-
- checkout
235-
- attach_workspace: *attach_workspace
236-
- run: yarn workspaces info | head -n -1 > workspace_info.txt
237-
- *restore_yarn_cache
238-
- *restore_node_modules
239-
- run:
240-
name: Install Packages
241-
command: yarn --frozen-lockfile --cache-folder ~/.cache/yarn
242-
- run:
243-
name: Build and archive
244-
command: |
245-
mkdir -p build/devtools
246-
cd packages/react-devtools-scheduling-profiler
247-
yarn build
248-
cd dist
249-
tar -zcvf ../../../build/devtools-scheduling-profiler.tgz .
250-
- store_artifacts:
251-
path: ./build/devtools-scheduling-profiler.tgz
252-
- persist_to_workspace:
253-
root: packages/react-devtools-scheduling-profiler
254-
paths:
255-
- dist
256-
257-
deploy_devtools_scheduling_profiler:
258-
docker: *docker
259-
environment: *environment
260-
steps:
261-
- checkout
262-
- attach_workspace:
263-
at: packages/react-devtools-scheduling-profiler
264-
- run: yarn workspaces info | head -n -1 > workspace_info.txt
265-
- *restore_node_modules
266-
- run:
267-
name: Deploy
268-
command: |
269-
cd packages/react-devtools-scheduling-profiler
270-
yarn vercel deploy dist --prod --confirm --token $SCHEDULING_PROFILER_DEPLOY_VERCEL_TOKEN
271-
272230
yarn_lint_build:
273231
docker: *docker
274232
environment: *environment
@@ -408,16 +366,6 @@ workflows:
408366
- build_devtools_and_process_artifacts:
409367
requires:
410368
- yarn_build
411-
- build_devtools_scheduling_profiler:
412-
requires:
413-
- yarn_build
414-
- deploy_devtools_scheduling_profiler:
415-
requires:
416-
- build_devtools_scheduling_profiler
417-
filters:
418-
branches:
419-
only:
420-
- main
421369

422370
# New workflow that will replace "stable" and "experimental"
423371
build_and_test:

packages/react-devtools-core/webpack.standalone.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ const __DEV__ = NODE_ENV === 'development';
1818

1919
const DEVTOOLS_VERSION = getVersionString();
2020

21+
const babelOptions = {
22+
configFile: resolve(
23+
__dirname,
24+
'..',
25+
'react-devtools-shared',
26+
'babel.config.js',
27+
),
28+
};
29+
2130
module.exports = {
2231
mode: __DEV__ ? 'development' : 'production',
2332
devtool: __DEV__ ? 'cheap-module-eval-source-map' : 'source-map',
@@ -62,17 +71,25 @@ module.exports = {
6271
],
6372
module: {
6473
rules: [
74+
{
75+
test: /\.worker\.js$/,
76+
use: [
77+
{
78+
loader: 'workerize-loader',
79+
options: {
80+
inline: true,
81+
},
82+
},
83+
{
84+
loader: 'babel-loader',
85+
options: babelOptions,
86+
},
87+
],
88+
},
6589
{
6690
test: /\.js$/,
6791
loader: 'babel-loader',
68-
options: {
69-
configFile: resolve(
70-
__dirname,
71-
'..',
72-
'react-devtools-shared',
73-
'babel.config.js',
74-
),
75-
},
92+
options: babelOptions,
7693
},
7794
{
7895
test: /\.css$/,

packages/react-devtools-extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"chrome-launch": "^1.1.4",
3838
"crx": "^5.0.0",
3939
"css-loader": "^1.0.1",
40+
"file-loader": "^6.1.0",
4041
"firefox-profile": "^1.0.2",
4142
"fs-extra": "^4.0.2",
4243
"jest-fetch-mock": "^3.0.3",
@@ -52,7 +53,6 @@
5253
"source-map": "^0.8.0-beta.0",
5354
"sourcemap-codec": "^1.4.8",
5455
"style-loader": "^0.23.1",
55-
"web-ext": "^3.0.0",
5656
"webpack": "^4.43.0",
5757
"webpack-cli": "^3.3.11",
5858
"webpack-dev-server": "^3.10.3",

packages/react-devtools-extensions/src/parseHookNames/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
* @flow
1010
*/
1111

12-
// This file uses workerize to load ./parseHookNames.worker as a webworker
13-
// and instanciates it, exposing flow typed functions that can be used
14-
// on other files.
12+
// This file uses workerize to load ./parseHookNames.worker as a webworker and instanciates it,
13+
// exposing flow typed functions that can be used on other files.
1514

1615
import * as parseHookNamesModule from './parseHookNames';
1716
import WorkerizedParseHookNames from './parseHookNames.worker';

packages/react-devtools-extensions/src/parseHookNames/parseHookNames.worker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
18
import * as parseHookNamesModule from './parseHookNames';
29

310
export const parseHookNames = parseHookNamesModule.parseHookNames;

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

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ const DEVTOOLS_VERSION = getVersionString();
1919

2020
const featureFlagTarget = process.env.FEATURE_FLAG_TARGET || 'extension-oss';
2121

22+
const babelOptions = {
23+
configFile: resolve(
24+
__dirname,
25+
'..',
26+
'react-devtools-shared',
27+
'babel.config.js',
28+
),
29+
};
30+
2231
module.exports = {
2332
mode: __DEV__ ? 'development' : 'production',
2433
devtool: __DEV__ ? 'cheap-module-eval-source-map' : false,
@@ -81,17 +90,25 @@ module.exports = {
8190
],
8291

8392
rules: [
93+
{
94+
test: /\.worker\.js$/,
95+
use: [
96+
{
97+
loader: 'workerize-loader',
98+
options: {
99+
inline: true,
100+
},
101+
},
102+
{
103+
loader: 'babel-loader',
104+
options: babelOptions,
105+
},
106+
],
107+
},
84108
{
85109
test: /\.js$/,
86110
loader: 'babel-loader',
87-
options: {
88-
configFile: resolve(
89-
__dirname,
90-
'..',
91-
'react-devtools-shared',
92-
'babel.config.js',
93-
),
94-
},
111+
options: babelOptions,
95112
},
96113
{
97114
test: /\.css$/,
@@ -109,11 +126,6 @@ module.exports = {
109126
},
110127
],
111128
},
112-
{
113-
test: /\.worker\.js$/,
114-
// inline: true due to limitations with extensions
115-
use: {loader: 'workerize-loader', options: {inline: true}},
116-
},
117129
],
118130
},
119131
};

packages/react-devtools-inline/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
"babel-loader": "^8.0.4",
3535
"cross-env": "^3.1.4",
3636
"css-loader": "^1.0.1",
37+
"file-loader": "^6.1.0",
3738
"raw-loader": "^3.1.0",
3839
"style-loader": "^0.23.1",
3940
"webpack": "^4.43.0",
4041
"webpack-cli": "^3.3.11",
41-
"webpack-dev-server": "^3.10.3"
42+
"webpack-dev-server": "^3.10.3",
43+
"worker-loader": "^3.0.3"
4244
}
4345
}

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

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ const __DEV__ = NODE_ENV === 'development';
1616

1717
const DEVTOOLS_VERSION = getVersionString();
1818

19+
const babelOptions = {
20+
configFile: resolve(
21+
__dirname,
22+
'..',
23+
'react-devtools-shared',
24+
'babel.config.js',
25+
),
26+
};
27+
1928
module.exports = {
2029
mode: __DEV__ ? 'development' : 'production',
2130
devtool: __DEV__ ? 'eval-cheap-source-map' : 'source-map',
@@ -65,17 +74,25 @@ module.exports = {
6574
],
6675
module: {
6776
rules: [
77+
{
78+
test: /\.worker\.js$/,
79+
use: [
80+
{
81+
loader: 'workerize-loader',
82+
options: {
83+
inline: true,
84+
},
85+
},
86+
{
87+
loader: 'babel-loader',
88+
options: babelOptions,
89+
},
90+
],
91+
},
6892
{
6993
test: /\.js$/,
7094
loader: 'babel-loader',
71-
options: {
72-
configFile: resolve(
73-
__dirname,
74-
'..',
75-
'react-devtools-shared',
76-
'babel.config.js',
77-
),
78-
},
95+
options: babelOptions,
7996
},
8097
{
8198
test: /\.css$/,
Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
# Experimental React Concurrent Mode Profiler
1+
# React Concurrent Mode Profiler
22

3-
https://react-devtools-scheduling-profiler.vercel.app/
4-
5-
## Setting up continuous deployment with CircleCI and Vercel
6-
7-
These instructions are intended for internal use, but may be useful if you are setting up a custom production deployment of the scheduling profiler.
8-
9-
1. Create a Vercel token at https://vercel.com/account/tokens.
10-
2. Configure CircleCI:
11-
1. In CircleCI, navigate to the repository's Project Settings.
12-
2. In the Advanced tab, ensure that "Pass secrets to builds from forked pull requests" is set to false.
13-
3. In the Environment Variables tab, add the Vercel token as a new `SCHEDULING_PROFILER_DEPLOY_VERCEL_TOKEN` environment variable.
14-
15-
The Vercel project will be created when the deploy job runs.
3+
This package contains the new/experimental "scheduling profiler" for React 18. This profiler exists as its own project because it was initially deployed as a standalone app. It has since been moved into the DevTools Profiler under the "Scheduling" tab. This package will likely eventually be moved into `react-devtools-shared`.

packages/react-devtools-scheduling-profiler/buildUtils.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

packages/react-devtools-scheduling-profiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "react-devtools-scheduling-profiler",
4-
"version": "0.0.0",
4+
"version": "4.14.0",
55
"license": "MIT",
66
"scripts": {
77
"build": "cross-env NODE_ENV=production cross-env TARGET=remote webpack --config webpack.config.js",

packages/react-devtools-scheduling-profiler/src/App.css

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)