Skip to content
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

Use customized edit-post package #2554

Closed
swissspidy opened this issue Jun 10, 2019 · 6 comments
Closed

Use customized edit-post package #2554

swissspidy opened this issue Jun 10, 2019 · 6 comments
Labels
P0 High priority

Comments

@swissspidy
Copy link
Collaborator

The whole awesomeness of the block editor in WordPress begins with the @wordpress/edit-post package. It's responsible for initializing the editor, complete with the NUX tips, editor settings, and the overall layout with header (toolbar), sidebar, and of course the (visual/code) editor itself.

While this works great for the regular post edit screen, it has caused some pain when working on the AMP Stories editor as some of the features in that package simply do not apply to our use case.

As a consequence, there were multiple instances where we had to insert elements in the middle of the editor using some DOM operations, and hide tons of things using CSS.

Examples of conflicting components include WritingFlow and BlockList, as well as basically the whole header and sidebar areas and components therein. That all our blocks are draggable and resizable is also something that makes using all these components

In the future, I expect the Stories editor UI to diverge more and more from the default post editor.

For example, we might position the block toolbar in a completely different place (#2309) and add some new UI controls (#2532) or even completely new interfaces (#2529, #2525, #2527, #2409).

All these changes are also likely to cause problems with features like fullscreen or spotlight mode (#2221, #2177).

With that, we will soon reach a point where we need to consider using our own custom @wordpress/edit-post implementation or find some other way to gain more control over the UI by overriding some components with our own implementations.

@swissspidy swissspidy added Enhancement New feature or improvement of an existing one AMP Stories labels Jun 10, 2019
@swissspidy
Copy link
Collaborator Author

@miina @westonruter @kienstra ^ thoughts?

@westonruter
Copy link
Member

In other words, you're thinking that we could fork the Gutenberg repo to start maintaining a modified version of the edit-post (i.e. edit-story) package that we would bundle with the AMP plugin?

@swissspidy
Copy link
Collaborator Author

Forking the repository is not really what I had in mind, but yes some custom package is probably something we could end up with. An example would be the new @wordpress/edit-widgets package and to some degree perhaps https://github.com/woocommerce/woocommerce-admin

@swissspidy swissspidy added the Discussion For issues that are high-level and not yet ready to implement. label Jun 12, 2019
@miina
Copy link
Contributor

miina commented Jun 17, 2019

Could be a good idea if we'll continue to need overriding the default package -- to have better control over things potentially breaking with updates and also not having to invent complicated workarounds.

Are you thinking of a completely new package instead of the edit-post, or still using the default components as well?

@swissspidy
Copy link
Collaborator Author

I haven't looked closely into it yet. Last time I checked, most of the components within that edit-post package were not exported, so reusing them is not easily possible.

@swissspidy
Copy link
Collaborator Author

As discussed today I'll work on writing a design doc for that.

@swissspidy swissspidy added P0 High priority and removed Group: Stories Editing Discussion For issues that are high-level and not yet ready to implement. Enhancement New feature or improvement of an existing one labels Nov 7, 2019
@swissspidy swissspidy removed their assignment Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority
Projects
None yet
Development

No branches or pull requests

4 participants