-
Notifications
You must be signed in to change notification settings - Fork 890
Charts: stop pre-bundling @wordpress/ui so IconButton works in Script Module consumers #51016
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
f837936
3261318
db539b8
191a4e6
589e7ea
2dc08f9
47b6cd2
4592a6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: major | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Until now That is not hypothetical. #47004 added the On the known consumer: the only So in practice nothing live is likely to break. The |
||
| Type: changed | ||
|
|
||
| Zoom: Restore the accessible tooltip on the reset control. `@wordpress/ui` is no longer bundled into the package output, so each consumer's bundler now resolves it. It remains a dependency and resolves from node_modules by default, but a bundler that externalizes `@wordpress/*` to `window.wp.*` must bundle `@wordpress/ui` instead — `window.wp.ui` does not exist. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,7 +45,7 @@ export default defineConfig( { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.png': 'asset', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deps: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alwaysBundle: [ '@wordpress/ui', /^fast-deep-equal/ ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But wp build tools expect this to be bundled? How will this externalization deal with private APIs mismatch? Did we test this change with older versions of other plugins that consume the same package?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good questions thanks 👍 "wp build tools expect this to be bundled?" That was true, and it is exactly why CHARTS-163 / #47004 added
"How will this externalization deal with private APIs mismatch?" On instance duplication, this change avoids a mismatch rather than introducing one. I built all three variants rather than reason about it:
Trunk today is fine, because Externalising avoids both: no On version mismatch: Charts pins So drift needs someone to override the pin — a "Did we test this change with older versions of other plugins that consume the same package?" Not initially — my first pass was all at monorepo HEAD, where every consumer builds from the same source, so that skew cannot occur by construction. I have since tested it. The case I took you to mean is mixed vintages of the same package on one site: I reproduced that deliberately. Built
No critical errors, no What would break that is That said, this is my reading of your question rather than necessarily yours. If you had a different combination in mind, tell me which and I will run that one instead.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update after rebasing onto trunk, since one detail above has moved underneath it. Trunk bumped the I re-measured the three build variants on 0.19.0 rather than assume the earlier figures carried. Same shape, slightly different numbers:
Full suite passes on 0.19.0 — 1074 tests. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| alwaysBundle: [ /^fast-deep-equal/ ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| css: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fileName: 'index.css', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Hard-wrap makes it difficult to navigate or read for people which rely on screen readers.