-
Notifications
You must be signed in to change notification settings - Fork 39
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
Try @wordpress/edit-post
for the creator UI.
#115
Conversation
# Conflicts: # package.json # public_html/wp-content/plugins/pattern-creator/pattern-creator.php # public_html/wp-content/plugins/pattern-creator/src/components/editor/index.js # public_html/wp-content/plugins/pattern-creator/src/components/header/index.js # public_html/wp-content/plugins/pattern-creator/src/components/header/style.css # public_html/wp-content/plugins/pattern-creator/src/components/layout/index.js # public_html/wp-content/plugins/pattern-creator/src/components/layout/style.css # public_html/wp-content/plugins/pattern-creator/src/components/settings/panels.js # public_html/wp-content/plugins/pattern-creator/src/index.js # public_html/wp-content/plugins/pattern-creator/src/store/actions.js # public_html/wp-content/plugins/pattern-creator/src/store/selectors.js # public_html/wp-content/plugins/pattern-creator/src/style.css # public_html/wp-content/plugins/pattern-creator/view/editor.php # yarn.lock
Can this be sorted with a rewrite? I don't think there's a sane way to stop it from happening on the front apart from changing it back. |
I haven't dug deep into it, so take this all w/ a grain of salt, but a rewrite sounds like a good workaround if the JS isn't configurable/overwritable. Some alternative ideas if any of them seem useful:
I'd rely on Kelly's thoughts more than any of that, though. |
Much appreciated!
This seems like a good idea. I wonder how long it would take to do this (or is it possible?). @ryelle Any opinion on this?
Can't do much here since we call
We can replace it but the control that updates the URLs listens for a change to
Not familiar with how this would work. @ryelle Any opinion on this? |
That would work, though I don't love the idea. We'll need to check for a post ID and load in the pattern content into the editor on new-pattern as well as when editing a pattern, but it's a good workaround.
Unfortunately it's not pulled from PHP, the redirect to
It's definitely possible, but probably depends on whether we can prove our use-case to whoever reviews it. We have a real use-case here, so that's good. If you do create an issue, I suggest explaining the use case and making some suggestions, rather than jumping to a PR. We could shortcut out of This feels like a pretty big blocker to this approach, so I'd like to have a plan before this is merged. |
I was able to get it working using redirects. I don't think it's the best approach, I think getting something into Gutenberg would be a better approach long term but it does work and isn't a bad experience. What do y'all think? Here is the code: Here is what it looks like functionally: |
🤔 , I wonder if the explicit
You might need to make sure that the post ID is a pattern post type, and that the user isn't in wp-admin, to avoid redirecting other post types and manually adding patterns. It's odd that there's the FOUC, doing the |
I think that Do we need a sysreq for
I think that's the page before the JS content loads, not to do with the redirect, unless I'm misunderstanding FOUC (flash of unstyled content?).
Yeah, I agree. |
Yeah, the
Good call, I'll make it more specific.
Yeah, that flash is the page itself, it's technically the wp header on the page without styles. The react app appears on top once the JS loads. We'll need to add a better loading state for that but the redirect does work as expected. |
Ah, I see. You're right, we'd only need a sysreq if we needed an nginx rewrite similar to the |
I've added the redirect code to this branch and I think I've closed out all the main issues identified. |
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.
A few small notes, but once those are addressed I think this can be merged so we can iterate on it in trunk.
This PR is an experiment to test the use of
import { initializeEditor } from '@wordpress/edit-post';
@ryelle Since I didn't author all the changes in the branch, can you take a really critical eye?
Closes #59.
Implements:
Doesn't yet Implement:
Screenshots
How to test the changes in this Pull Request:
/new-pattern/
In the browser console, paste the following one by one:
Expect to see your updates values.