-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change resource URL in source map for @wordpress packages. #51401
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Aki Hamano <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
…1401) * Change the URL of the packages output in the source map. --------- Co-authored-by: Aki Hamano <[email protected]>
What?
Change the URL of
@wordpress
packages referenced in the source map. Specifically, the following will be used.before:
webpack://wp/packages/a11y/build-module/@wordpress/a11y/src/index.js
after:
../../packages/a11y/src/index.js
Why?
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
devtoolModuleFilenameTemplate
Screenshots or screencast
2023-06-11.20.29.53.mov