Change resource URL in source map for @wordpress packages.#51401
Change resource URL in source map for @wordpress packages.#51401noahtallen merged 5 commits intotrunkfrom
Conversation
|
Size Change: -2.13 kB (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 4baf491. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6124637212
|
|
@gziolo Could you review this PR? |
|
Hello, I don't have much experience configuring source maps with webpack. I landed 4 years ago PR #17024 that set a constant namespace with |
ff2df57 to
6fa1f82
Compare
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
|
As long as it's about the source map generated by the plugin and not by the packages, it's good to go (since it has been tested). I wonder if a similar change is needed on Core. |
|
@youknowriad |
There was a problem hiding this comment.
I confirmed the sourcemaps for packages are the same (which makes sense, since those aren't generated by webpack). Looking at the sourcemaps for @wordpress/annotations (under build/annotations):
before:
"sources": [
"webpack://wp/webpack/bootstrap",
"webpack://wp/webpack/runtime/define property getters",
"webpack://wp/webpack/runtime/hasOwnProperty shorthand",
"webpack://wp/webpack/runtime/make namespace object",
"webpack://wp/external window [\"wp\",\"richText\"]",
"webpack://wp/external window [\"wp\",\"i18n\"]",
"webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/constants.js",
"webpack://wp/./packages/annotations/build-module/format/@wordpress/annotations/src/format/annotation.js",
"webpack://wp/./packages/annotations/build-module/format/@wordpress/annotations/src/format/index.js",
"webpack://wp/external window [\"wp\",\"hooks\"]",
"webpack://wp/external window [\"wp\",\"data\"]",
"webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/reducer.js",
"webpack://wp/./packages/annotations/build-module/block/@wordpress/annotations/src/block/index.js",
"webpack://wp/./node_modules/rememo/rememo.js",
"webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/selectors.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/rng.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/stringify.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/regex.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/validate.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/v4.js",
"webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/actions.js",
"webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/index.js"
],after:
"sources": [
"webpack://wp/webpack/bootstrap",
"webpack://wp/webpack/runtime/define property getters",
"webpack://wp/webpack/runtime/hasOwnProperty shorthand",
"webpack://wp/webpack/runtime/make namespace object",
"webpack://wp/external window [\"wp\",\"richText\"]",
"webpack://wp/external window [\"wp\",\"i18n\"]",
"../../packages/annotations/src/store/constants.js",
"../../packages/annotations/src/format/annotation.js",
"../../packages/annotations/src/format/index.js",
"webpack://wp/external window [\"wp\",\"hooks\"]",
"webpack://wp/external window [\"wp\",\"data\"]",
"../../packages/annotations/src/store/reducer.js",
"../../packages/annotations/src/block/index.js",
"webpack://wp/./node_modules/rememo/rememo.js",
"../../packages/annotations/src/store/selectors.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/rng.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/stringify.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/regex.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/validate.js",
"webpack://wp/./packages/annotations/node_modules/uuid/dist/esm-browser/v4.js",
"../../packages/annotations/src/store/actions.js",
"../../packages/annotations/src/store/index.js"
],This makes sense to me 👍
|
I will go ahead and merge it, since @youknowriad said it is good to go. |
…1401) * Change the URL of the packages output in the source map. --------- Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
…1401) * Change the URL of the packages output in the source map. --------- Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>







What?
Change the URL of
@wordpresspackages referenced in the source map. Specifically, the following will be used.before:
webpack://wp/packages/a11y/build-module/@wordpress/a11y/src/index.jsafter:
../../packages/a11y/src/index.jsWhy?
When VS Code and a browser are linked, the actual file can be referenced from the debug console. Also, operations such as breakpoints can be performed from VS Code.
The lanch.json configuration is as follows
How?
Set
devtoolModuleFilenameTemplateScreenshots or screencast
2023-06-11.20.29.53.mov