-
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
Site Editor and Admin Redesign: Build a solid routing foundation. #60584
Comments
I believed #60466 by @jsnajdr solved most of the big issues we had in terms of maintainability, it's also a path forward towards decoupling the layout from the pages. I believe we can probably start experimenting (and using) with a private API to register routes (replace the router.js file with it). |
One thing that's currently odd about the In a mainstream router, this would all be just one |
@jsnajdr do you think we should explore pretty permalinks to improve that? I guess it still needs to land on site-editor.php anyway |
One prior art that comes to mind is the WordPress REST API. You can use the raw, not-pretty URL where you refer to a PHP file and pass all information in query params:
But the preferred choice is to have a pretty URL where the
I guess that eventually we want to have also
there would be this in the URL bar:
I think that's feasible and worth exploring. One additional question: do we already have other My current plan for routing is:
|
Actually, I think this is one of the next steps that I want to explore. I didn't track this yet but I do want to see whether we can build a "site editor" like experience for posts/categories to replace the "edit.php" we have right now. Should be an experiment first but I was kind of waiting for the routing work to advance a bit to start on that part.
Sounds good to me. |
This code in gutenberg/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js Lines 204 to 246 in 77f03d3
From the URL, it determines what should be displayed in the content area. We should move this code to the router's |
@jsnajdr I agree, I think the ideal would be to have postType, postId and context as props to the |
Hi, y'all, will it be possible to hook into the single post route to provide a custom React-based editing experience rather than the Block Editor? (And is this the right place for this question?) |
@dannyreaktiv That means that you want to completely disable Gutenberg and replace the post editor with your own custom app? In that case you don't want to hook into anything in the Gutenberg codebase, but do it directly at the WordPress level. The Classic Editor plugin could be an inspiration for this. |
@jsnajdr Thanks for replying. If the post tables are being replaced with DataViews, it would be nice to hook into edit post action to launch a custom view (such as a modal) rather than redirect to the editor. |
The site editor has a built-in routing approach that is a bit fragile and hard to scale to the next steps of the Admin Redesign project. It is time to look at it and refactor it to both address its immediate shortcomings (bugs and maintainability) and provide a solid base for the next steps (extensibility, new pages)...
The solution needs to address the following requirements:
The text was updated successfully, but these errors were encountered: