-
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
Components: Group all "next" Components in the ui
folder
#28624
Merged
Merged
Conversation
This file contains 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
gziolo
added
[Type] Code Quality
Issues or PRs that relate to code quality
[Package] Components
/packages/components
[Feature] Component System
WordPress component system
labels
Feb 1, 2021
gziolo
requested review from
ajitbohra,
chrisvanpatten and
oandregal
as code owners
February 1, 2021 10:25
Size Change: +43 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
gziolo
commented
Feb 1, 2021
gziolo
force-pushed
the
update/g2-components-ui-folder
branch
from
February 1, 2021 12:25
64e1d65
to
a8cc365
Compare
gziolo
commented
Feb 1, 2021
gziolo
commented
Feb 1, 2021
gziolo
commented
Feb 1, 2021
gziolo
added
the
Backport to WP 6.7 Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
Feb 1, 2021
gziolo
force-pushed
the
update/g2-components-ui-folder
branch
from
February 1, 2021 13:53
9723a65
to
b3799a6
Compare
ItsJonQ
approved these changes
Feb 1, 2021
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.
🚀 from me! I think containing it + exposing it under a directory like you did (/ui
) is a great idea 🙏 . Thank you @gziolo !
I can't comment on the TypeScript stuff. But the rest look good to me!
noisysocks
force-pushed
the
update/g2-components-ui-folder
branch
from
February 2, 2021 02:35
b3799a6
to
3248b85
Compare
noisysocks
pushed a commit
that referenced
this pull request
Feb 2, 2021
* Components: Group all G2 components in the `ui` folder * Move G2 context to the `ui` folder * Storybook improvements for G2 stories * Move G2 Text component to `ui` folder * Update manifest for the handbook * Move FontSizeControl to the `ui` subfolder * Move createComponent util to the `ui` folder * Move G2 utils to the `ui` folder
This was referenced Feb 2, 2021
noisysocks
removed
the
Backport to WP 6.7 Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
Feb 7, 2021
ItsJonQ
changed the title
Components: Group all G2 components in the
Components: Group all "next" Components in the Feb 11, 2021
ui
folderui
folder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Component System
WordPress component system
[Package] Components
/packages/components
[Type] Code Quality
Issues or PRs that relate to code quality
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.
Description
This PR tries to mitigate the issue that was reported by @pento on WordPress Slack (link requires registration at https://make.wordpress.org/chat/):
https://wordpress.slack.com/archives/C02QB2JS7/p1612158923355300
The approach I took:
ui
subfolder and don't expose them from the main entry point in the@wordpress/components
package. This way they won't be bundled and exposed as experimental components underwp.components
namespace.__next/context
toui/context
and use the original name in the@wordpress/components
scope.utils
toutils/ui
.ui
folder so they don't get exposed in the Block Editor Handbook, some examples (they also have some formatting issues that should be addressed separately):G2 Components (Experimental)
subsection.(Experimental)
note in the README file's header. I updated code examples to use temporary import statements from@wordpress/components/ui
.@wp-g2/components
.Future work
FontSizeControl
isn't typed and therefore it can't be included in the export inpackages/components/src/ui/index.js
FontSizeControl
andView
don't have storiesFonteSizeControl
andView
don't have unit testsuseFontSizeControl
useGrid
useText
useTruncate
useView
createComponents
,getOptimalTextShade
) with unit testsHow has this been tested?
npm run dev
&npm run build
works andFontSizePicker
works as expected (example Paragraph block, see the screenshot attached)npm run lint-js
passesnpm run test-unit
passesnpm run storybook:dev
&npm run storybook:build
finishes with successScreenshots
New section in Storybook
FontSizePicker still works
G2 components aren't exposed
Types of changes
Checklist: