-
Notifications
You must be signed in to change notification settings - Fork 843
Protect Components: Use @wordpress/dataviews/wp import path #41510
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
Merged
nateweller
merged 6 commits into
add/protect/core-3
from
add/components/dataviews-wp-import
Mar 29, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9edd2dd
Use /wp import path with dataviews package
nateweller a8761cf
Add missing wordpress deps to dataviews build process for storybook
nateweller e4f9321
Remove initial ThreatsDataViews test
nateweller ae2cb0d
Revert "Remove initial ThreatsDataViews test"
nateweller 53d1977
Fix tests
nateweller dda7f23
Remove tests and stories from build
nateweller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/js-packages/scan/src/components/threat-severity-badge/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
projects/js-packages/scan/src/components/threats-data-views/test/index.test.jsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do we need the
functionsobject here?Was the compiling manual? If yes, would that mean updating things here if the core DataViews package adds more i18n functions in its code?
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.
The real problem is that
build-wp/index.jsisn't preserving the names of the@wordpress/i18nfunctions. Instead it does a lot of aliasing likeimport { __ as __9 } from '@wordpress/i18n';.It turns out that Webpack as used in this particular PR currently winds up undoing all the bad import aliasing, going back to the correct
__name so GlotPress's use ofwp i18nwill pick up the strings from the bundle. But@automattic/babel-plugin-replace-textdomain(which runs long before Webpack fixes it) needs this to know to inject the correct textdomain into all the aliased calls, because the translations won't be in Core's default domain.Someday, when Core distributes
@wordpress/dataviewslike it does@wordpress/componentsand other packages, none of this will be needed because both the script and translations will come from Core instead of having to be bundled with the plugin. It's unfortunate that we're currently in this situation where@wordpress/dataviewsis too unstable for Core to provide but everyone wants to start using it anyway.