Skip to content

Commit dd7d036

Browse files
author
Brian Vaughn
committed
Import scheduling profiler into DevTools Profiler tab
1 parent 3f62dec commit dd7d036

Some content is hidden

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

50 files changed

+771
-895
lines changed

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: 'worker-loader',
79+
options: {
80+
inline: 'no-fallback',
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/firefox/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
"devtools_page": "main.html",
3434

35-
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
35+
"content_security_policy": "script-src 'self' 'unsafe-eval' blob:; object-src 'self'",
3636
"web_accessible_resources": [
3737
"main.html",
3838
"panel.html",

packages/react-devtools-extensions/package.json

Lines changed: 3 additions & 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",
@@ -55,7 +56,8 @@
5556
"web-ext": "^3.0.0",
5657
"webpack": "^4.43.0",
5758
"webpack-cli": "^3.3.11",
58-
"webpack-dev-server": "^3.10.3"
59+
"webpack-dev-server": "^3.10.3",
60+
"worker-loader": "^3.0.3"
5961
},
6062
"dependencies": {
6163
"web-ext": "^4"

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

Lines changed: 25 additions & 8 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: 'worker-loader',
98+
options: {
99+
inline: 'no-fallback',
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$/,

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: 'worker-loader',
82+
options: {
83+
inline: 'no-fallback',
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)