Framework: Extract "edit-post" to its own module#3649
Framework: Extract "edit-post" to its own module#3649youknowriad wants to merge 1 commit intomasterfrom
Conversation
4ac2001 to
ff3f9b1
Compare
Codecov Report
@@ Coverage Diff @@
## master #3649 +/- ##
==========================================
- Coverage 37.32% 37.31% -0.01%
==========================================
Files 277 284 +7
Lines 6685 6692 +7
Branches 1213 1206 -7
==========================================
+ Hits 2495 2497 +2
- Misses 3532 3544 +12
+ Partials 658 651 -7
Continue to review full report at Codecov.
|
ff3f9b1 to
285e9a7
Compare
|
I took a quick glance at this code. Looks pretty good.
I'm not so happy about passing it down to all those components. I will think about some alternatives. |
| * Internal dependencies | ||
| */ | ||
| import scssVariables from '!!sass-variables-loader!./assets/stylesheets/_variables.scss'; | ||
| import scssVariables from '!!sass-variables-loader!../edit-post/assets/stylesheets/_variables.scss'; |
There was a problem hiding this comment.
It looks like some SCSS variables should remain located in editor/ folder.
There was a problem hiding this comment.
Yeah, we have this issue for all components, these variables and mixins are not modularized properly. They are used in all the modules "components, "block", "editor", "edit-post" and a lot of them are specific to a module.
There was a problem hiding this comment.
We should tackle this separately in that case.
285e9a7 to
af231de
Compare
af231de to
d8a28c2
Compare
|
We discussed it extensively on Slack, but let me summarize my feedback here. So as I understand, the idea here is to have isolated Redux state for the editor and a separate one for I’m not happy about It's passed down from I was exploring if we could reuse pattern from <AdvancedSettings>
{ ( areAdvancedSettingActive, closeAdvancedSettings ) => areAdvancedSettingActive && <Sidebar onClose={ closeAdvancedSettings } /> }
</AdvancedSettings>This would solve the nesting issue, but the obvious issue here is that it won't play well with the modal case. It would be nice to gather feedback from @mkaz and @georgeh how this proposal fits with their work on P2 integration. It would be a very valuable to hear from them before we proceed. |
|
One more thing to consider. Previously only |
|
I'm closing this right now, I'll do another attempt once the "data" module finalized, which will help with state access accross modules. |

Sorry for the huge PR, sometimes there's no alternative.
This PR extracts the
edit-postmodule to its own module. This surfaced some "issues"The need to spit the store into two stores. One store for the "editor" module (library) which is more a "local state" to the
EditorProvidercomponent. This store is saved in the React context using a different key "editorStore" to avoid ambiguity when callingconnectSome components in
edit-postwhere still needed access to theeditormodule's store, in general this is fixed by adding reusable components to theeditormodule.The "Show block inspector" button proved to be a challenge, because the idea is that clicking this button shows the inspector, but since the BlockInspector is a reusable component that can be shown anyware in the application using the "editor" module, we needed a
showBlockInspectorto allow the surrouding application (edit-post) to handle this button properly.I'd appreciate quick feedback and opinions, this won't be enought to keep without conflicts and continuous rebasing.
Testing instructions