-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Routing: Add boot package #72809
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
Routing: Add boot package #72809
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +76.4 kB (+3.21%) Total Size: 2.46 MB
ℹ️ View Unchanged
|
2de164a to
c51b245
Compare
|
Flaky tests detected in fc9a737. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19027475296
|
| { | ||
| selector: | ||
| 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]', | ||
| 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]:not([source.value=/^@wordpress\\u002F.+\\u002Fbuild-types\\u002F/])', |
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 make this change? Isn't any other way of importing types from a package?
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.
Right now no, third-party devs have been doing this forever. The other way is to export all types from the "index" of components which is being explored in its own PR. #72831
|
|
||
| export default function Root() { | ||
| return ( | ||
| <ThemeProvider isRoot color={ { bg: '#f8f8f8', primary: '#3858e9' } }> |
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.
Should we pass scheme to the provider instead of bg and primary?
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.
It doesn't work for me with scheme, accent, it only works with bg, primary. cc @aduth might enlighten us.
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.
scheme is outdated from earlier iterations of the theme provider implementation which explored configurable light and dark modes, but light and dark is handled internally by the color ramp algorithm in the implementation that was merged.
This should be updated in the documentation. I've created an issue at #72932
| "exports": { | ||
| ".": { | ||
| "types": "./build-types/index.d.ts", | ||
| "types": "./build-types", |
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.
Do you think this change should be part of this PR?
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.
It is mandatory otherwise I can't use the types from this package. (Unless we land the alternative PR first)
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.
@youknowriad Can you elaborate what's mandatory about this? I ran into the opposite issue in #72978 with the changes here causing resolution to fail.
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.
These two imports fail otherwise
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.
To me, that's expected for those kind of imports to fail. If we want to expose the types, they should be exported from the index. Otherwise we're kinda defeating part of the point of exports.
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.
And I don't know that we do want those types to be exported. For those, we could probably be using React.ComponentTypes (related blog post)?
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.
No disagreement, it's what the alternative PR is trying to do #72831
The change here just brings things back to what it used to be pre-build v2 but I don't mind moving towards exporting all the types needed explicitly.
ntsekouras
left a comment
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.
Thanks Riad! This is a great starting point for the new admin pages. I think there might be a few things that are not needed right now, but I know you're going to follow up with more changes and didn't want to have an even bigger PR.
My comments are very small and we want 🟢 CI and we can land.
f6fd476 to
fc9a737
Compare
ntsekouras
left a comment
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 think it's okay to land and iterate. Thanks!
Related #70862
What?
As shared on the issue, this PR starts by introducing a new @wordpress/boot package - a minimal framework inspired by the site editor, providing a foundation for building modern WordPress admin pages with client-side routing. The ultimate goal is to refactor the site editor with it to allow third-party extensibility.
The boot package provides:
It is very early to judge this though, we need to work on routes, lazy loading and more. This is just the initial brick. It includes a sidebar with some example menu items and single hello world static route.
I have some accompanying PHP to code to allow testing this by navigating to this url
wp-admin/admin.php?page=gutenberg-boot. The goal for this PHP code is to be auto-generated by the build tool.Testing Instructions
- Site icon and title display immediately
- Dark sidebar with light content area
- Command palette opens with Cmd+K