Skip to content

Commit 81d6692

Browse files
authored
[DevTools] Stop polyfilling Buffer (#34512)
1 parent 6a4c8f5 commit 81d6692

File tree

7 files changed

+90
-204
lines changed

7 files changed

+90
-204
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ module.exports = {
119119
plugins: [
120120
new Webpack.ProvidePlugin({
121121
process: 'process/browser',
122-
Buffer: ['buffer', 'Buffer'],
123122
}),
124123
new Webpack.DefinePlugin({
125124
__DEV__,

packages/react-devtools-fusebox/webpack.config.frontend.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ module.exports = {
7474
new MiniCssExtractPlugin(),
7575
new Webpack.ProvidePlugin({
7676
process: 'process/browser',
77-
Buffer: ['buffer', 'Buffer'],
7877
}),
7978
new Webpack.DefinePlugin({
8079
__DEV__,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ module.exports = {
6565
plugins: [
6666
new Webpack.ProvidePlugin({
6767
process: 'process/browser',
68-
Buffer: ['buffer', 'Buffer'],
6968
}),
7069
new Webpack.DefinePlugin({
7170
__DEV__,

packages/react-devtools-shared/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"react-dom-15": "npm:react-dom@^15"
1111
},
1212
"dependencies": {
13-
"@babel/parser": "^7.12.5",
14-
"@babel/preset-env": "^7.11.0",
13+
"@babel/parser": "^7.28.3",
14+
"@babel/preset-env": "7.26.9",
1515
"@babel/preset-flow": "^7.10.4",
1616
"@babel/runtime": "^7.11.2",
17-
"@babel/traverse": "^7.12.5",
17+
"@babel/traverse": "^7.28.3",
1818
"@reach/menu-button": "^0.16.1",
1919
"@reach/tooltip": "^0.16.0",
2020
"clipboard-js": "^0.3.6",

packages/react-devtools-shared/src/hooks/parseHookNames/loadSourceAndMetadata.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,7 @@ export async function loadSourceAndMetadata(
119119
}
120120

121121
function decodeBase64String(encoded: string): Object {
122-
if (typeof atob === 'function') {
123-
return atob(encoded);
124-
} else if (
125-
typeof Buffer !== 'undefined' &&
126-
Buffer !== null &&
127-
typeof Buffer.from === 'function'
128-
) {
129-
return Buffer.from(encoded, 'base64');
130-
} else {
131-
throw Error('Cannot decode base64 string');
132-
}
122+
return atob(encoded);
133123
}
134124

135125
function extractAndLoadSourceMapJSON(

scripts/ci/run_devtools_e2e_tests.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ function buildInlinePackage() {
5555
logDim(data);
5656
});
5757
buildProcess.stderr.on('data', data => {
58-
if (`${data}`.includes('Warning')) {
58+
if (
59+
`${data}`.includes('Warning') ||
60+
// E.g. [BABEL] Note: The code generator has deoptimised the styling of * as it exceeds the max of 500KB.
61+
`${data}`.includes('[BABEL] Note')
62+
) {
5963
logDim(data);
6064
} else {
6165
logError(`Error:\n${data}`);

0 commit comments

Comments
 (0)