[DevTools] Switch sourcemap-codec dependency (#34569)
[sourcemap-codec](https://www.npmjs.com/package/sourcemap-codec) (deprecated) -> [@jridgewell/sourcemap-codec](https://www.npmjs.com/package/@jridgewell/sourcemap-codec) Validated that symbolication still works.
Ruslan Lesiutin committed
Sep 24, 2025 at 06:11 UTC
2ee61475100e3d729816467c857366b37a231494
6 files changed
+93
-12
packages/react-devtools-extensions/package.json
+1
-1
@@ -28,6 +28,7 @@
28
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
29
"@babel/plugin-transform-react-jsx-source": "^7.10.5",
30
"@babel/preset-react": "^7.10.4",
31
+ "@jridgewell/sourcemap-codec": "1.5.5",
32
"acorn-jsx": "^5.2.0",
33
"archiver": "^3.0.0",
34
"babel-core": "^7.0.0-bridge",
@@ -60,7 +61,6 @@
61
"raw-loader": "^3.1.0",
62
"rimraf": "^5.0.1",
63
"source-map-js": "^0.6.2",
63
- "sourcemap-codec": "^1.4.8",
64
"style-loader": "^0.23.1",
65
"webpack": "^5.82.1",
66
"webpack-cli": "^5.1.1",
packages/react-devtools-inline/package.json
+2
-2
@@ -22,8 +22,8 @@
22
"test:e2e": "playwright test --config=playwright.config.js"
23
},
24
"dependencies": {
25
- "source-map-js": "^0.6.2",
26
- "sourcemap-codec": "^1.4.8"
25
+ "@jridgewell/sourcemap-codec": "1.5.5",
26
+ "source-map-js": "^0.6.2"
27
},
28
"devDependencies": {
29
"@babel/core": "^7.11.1",
packages/react-devtools-shared/src/hooks/SourceMapConsumer.js
+2
-2
@@ -7,7 +7,7 @@
7
* @flow
8
*/
9
import {withSyncPerfMeasurements} from 'react-devtools-shared/src/PerformanceLoggingUtils';
10
-import {decode} from 'sourcemap-codec';
10
+import {decode} from '@jridgewell/sourcemap-codec';
11
12
import type {
13
IndexSourceMap,
@@ -47,7 +47,7 @@ export default function SourceMapConsumer(
47
48
function BasicSourceMapConsumer(sourceMapJSON: BasicSourceMap) {
49
const decodedMappings: Mappings = withSyncPerfMeasurements(
50
- 'Decoding source map mappings with sourcemap-codec',
50
+ 'Decoding source map mappings with @jridgewell/sourcemap-codec',
51
() => decode(sourceMapJSON.mappings),
52
);
53
packages/react-devtools-shared/src/hooks/__tests__/updateMockSourceMaps.js
+1
-1
@@ -14,7 +14,7 @@ const babel = require('@rollup/plugin-babel').babel;
14
const commonjs = require('@rollup/plugin-commonjs');
15
const jsx = require('acorn-jsx');
16
const rollupResolve = require('@rollup/plugin-node-resolve').nodeResolve;
17
-const {encode, decode} = require('sourcemap-codec');
17
+const {encode, decode} = require('@jridgewell/sourcemap-codec');
18
const {generateEncodedHookMap} = require('../generateHookMap');
19
const {parse} = require('@babel/parser');
20
packages/react-devtools-shared/src/hooks/generateHookMap.js
+1
-1
@@ -8,7 +8,7 @@
8
*/
9
10
import {getHookNamesMappingFromAST} from './astUtils';
11
-import {encode, decode} from 'sourcemap-codec';
11
+import {encode, decode} from '@jridgewell/sourcemap-codec';
12
13
// Missing types in @babel/types
14
type File = any;
yarn.lock
+86
-5
@@ -3227,6 +3227,11 @@
3227
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
3228
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
3229
3230
+"@jridgewell/sourcemap-codec@1.5.5":
3231
+ version "1.5.5"
3232
+ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba"
3233
+ integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==
3234
+
3235
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15":
3236
version "1.4.15"
3237
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
@@ -8269,7 +8274,7 @@ eslint-utils@^2.0.0, eslint-utils@^2.1.0:
8274
dependencies:
8275
eslint-visitor-keys "^1.1.0"
8276
8272
-"eslint-v7@npm:eslint@^7.7.0", eslint@^7.7.0:
8277
+"eslint-v7@npm:eslint@^7.7.0":
8278
version "7.32.0"
8279
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
8280
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
@@ -8468,6 +8473,52 @@ eslint@8.57.0:
8473
strip-ansi "^6.0.1"
8474
text-table "^0.2.0"
8475
8476
+eslint@^7.7.0:
8477
+ version "7.32.0"
8478
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
8479
+ integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
8480
+ dependencies:
8481
+ "@babel/code-frame" "7.12.11"
8482
+ "@eslint/eslintrc" "^0.4.3"
8483
+ "@humanwhocodes/config-array" "^0.5.0"
8484
+ ajv "^6.10.0"
8485
+ chalk "^4.0.0"
8486
+ cross-spawn "^7.0.2"
8487
+ debug "^4.0.1"
8488
+ doctrine "^3.0.0"
8489
+ enquirer "^2.3.5"
8490
+ escape-string-regexp "^4.0.0"
8491
+ eslint-scope "^5.1.1"
8492
+ eslint-utils "^2.1.0"
8493
+ eslint-visitor-keys "^2.0.0"
8494
+ espree "^7.3.1"
8495
+ esquery "^1.4.0"
8496
+ esutils "^2.0.2"
8497
+ fast-deep-equal "^3.1.3"
8498
+ file-entry-cache "^6.0.1"
8499
+ functional-red-black-tree "^1.0.1"
8500
+ glob-parent "^5.1.2"
8501
+ globals "^13.6.0"
8502
+ ignore "^4.0.6"
8503
+ import-fresh "^3.0.0"
8504
+ imurmurhash "^0.1.4"
8505
+ is-glob "^4.0.0"
8506
+ js-yaml "^3.13.1"
8507
+ json-stable-stringify-without-jsonify "^1.0.1"
8508
+ levn "^0.4.1"
8509
+ lodash.merge "^4.6.2"
8510
+ minimatch "^3.0.4"
8511
+ natural-compare "^1.4.0"
8512
+ optionator "^0.9.1"
8513
+ progress "^2.0.0"
8514
+ regexpp "^3.1.0"
8515
+ semver "^7.2.1"
8516
+ strip-ansi "^6.0.0"
8517
+ strip-json-comments "^3.1.0"
8518
+ table "^6.0.9"
8519
+ text-table "^0.2.0"
8520
+ v8-compile-cache "^2.0.3"
8521
+
8522
espree@10.0.1, espree@^10.0.1:
8523
version "10.0.1"
8524
resolved "https://registry.yarnpkg.com/espree/-/espree-10.0.1.tgz#600e60404157412751ba4a6f3a2ee1a42433139f"
@@ -14269,7 +14320,7 @@ prepend-http@^2.0.0:
14320
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
14321
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
14322
14272
-"prettier-2@npm:prettier@^2", prettier@^2.5.1:
14323
+"prettier-2@npm:prettier@^2":
14324
version "2.8.8"
14325
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
14326
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
@@ -14284,6 +14335,11 @@ prettier@^1.19.1:
14335
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
14336
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
14337
14338
+prettier@^2.5.1:
14339
+ version "2.8.8"
14340
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
14341
+ integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
14342
+
14343
pretty-format@^29.4.1:
14344
version "29.4.1"
14345
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.1.tgz#0da99b532559097b8254298da7c75a0785b1751c"
@@ -16158,7 +16214,7 @@ string-natural-compare@^3.0.1:
16214
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
16215
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
16216
16161
-"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
16217
+"string-width-cjs@npm:string-width@^4.2.0":
16218
version "4.2.3"
16219
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
16220
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -16193,6 +16249,15 @@ string-width@^4.0.0:
16249
is-fullwidth-code-point "^3.0.0"
16250
strip-ansi "^6.0.0"
16251
16252
+string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
16253
+ version "4.2.3"
16254
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
16255
+ integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
16256
+ dependencies:
16257
+ emoji-regex "^8.0.0"
16258
+ is-fullwidth-code-point "^3.0.0"
16259
+ strip-ansi "^6.0.1"
16260
+
16261
string-width@^5.0.1, string-width@^5.1.2:
16262
version "5.1.2"
16263
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -16253,7 +16318,7 @@ string_decoder@~1.1.1:
16318
dependencies:
16319
safe-buffer "~5.1.0"
16320
16256
-"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
16321
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
16322
version "6.0.1"
16323
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
16324
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -16281,6 +16346,13 @@ strip-ansi@^5.1.0:
16346
dependencies:
16347
ansi-regex "^4.1.0"
16348
16349
+strip-ansi@^6.0.0, strip-ansi@^6.0.1:
16350
+ version "6.0.1"
16351
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
16352
+ integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
16353
+ dependencies:
16354
+ ansi-regex "^5.0.1"
16355
+
16356
strip-ansi@^7.0.1:
16357
version "7.1.0"
16358
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -17889,7 +17961,7 @@ workerize-loader@^2.0.2:
17961
dependencies:
17962
loader-utils "^2.0.0"
17963
17892
-"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
17964
+"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
17965
version "7.0.0"
17966
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
17967
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -17907,6 +17979,15 @@ wrap-ansi@^6.2.0:
17979
string-width "^4.1.0"
17980
strip-ansi "^6.0.0"
17981
17982
+wrap-ansi@^7.0.0:
17983
+ version "7.0.0"
17984
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
17985
+ integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
17986
+ dependencies:
17987
+ ansi-styles "^4.0.0"
17988
+ string-width "^4.1.0"
17989
+ strip-ansi "^6.0.0"
17990
+
17991
wrap-ansi@^8.1.0:
17992
version "8.1.0"
17993
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"