-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Edit Post: Replace store name string with exposed store definition #27414
Edit Post: Replace store name string with exposed store definition #27414
Conversation
There are still some references remaining, but most of them are in the There's also |
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.
Some stable tests (according to the last runs in the master
branch) were failing. I reviewed and found some copy/paste mistakes. I'll fix them and see if it fixes the failing tests.
packages/edit-post/src/components/sidebar/settings-sidebar/index.js
Outdated
Show resolved
Hide resolved
In this case, how should I perform these changes? Should I rebase my branch or should I add one more commit on top of it? |
45c0692
to
bda42e4
Compare
Rebasing on |
bda42e4
to
a2bb533
Compare
a2bb533
to
e728d8c
Compare
At first, the build failed because I forgot to include
They already declared it... But anyway. That is fixed now.
@gziolo Is my understanding is correct? If yes, then is there any example where this has been fixed before, or have I created a monster? 😞 Also, sorry for writing so much; I wanted to make myself clear as I thought this very confusing to explain. |
Yes, those cyclic dependencies are bugs. That's the point of this refactoring to fix them eventually and prevent moving forward 😃 I plan to look at your PR tomorrow, great comments and awesome work 🎉 |
Great, thanks! I'll keep looking at it and see if I can come up with anything else. |
@hypest and @Tug, it looks like there are some architectural issues in React Native files that this PR uncovers. The packages should depend on each other in the following direction:
There is also some mix in the picture as @rafaelgalani, what it means is that for now, we should live hardcoded strings outside of the There are other high-level packages:
|
I missed some previous questions:
Yes, for all code related to e2e tests we should leave hard-coded strings, those are shortcuts that allow to perform more detailed assertions or set the app in a specific state.
They should be left unmodified. Those are hardcoded strings used for scoping which happen to use the same names to make it easier to debug.
It's up to you. I personally use rebasing + force pushing, sometimes I squash commits. I think it's covered here: https://github.com/WordPress/gutenberg/blob/master/docs/contributors/git-workflow.md#keeping-your-branch-up-to-date. It's for repository members (it's you now, you can open PR directly in Gutenberg repo), there is also a section that covers forks (this branch). |
ab78919
to
e9fac2b
Compare
Uhm, @gziolo...
Sorry. I haven't checked the exports... They were included in the last refactorings, so I thought that for this package they would be too, my bad. 😓 |
e9fac2b
to
f2a297c
Compare
Reverting commits that removed `"edit-post"` hardcoded store name on `"components"` and `"block-editor"` packages, due to cyclic dependencies, as referenced in WordPress#27414 (this commit will be used as baseline later).
af20ba5
to
58ab3d1
Compare
I only force-pushed to resolve the conflicts. There is no actual change to the code. |
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 left two more comments. Once they are addressed this PR should be good to 😄
Edit: I posted this comment while doing a live stream at Twitch 😅:
https://www.twitch.tv/videos/828801176
@@ -28,6 +28,7 @@ import { | |||
createBlock, | |||
} from '@wordpress/blocks'; | |||
import { withDispatch, withSelect } from '@wordpress/data'; | |||
import { store as editPostStore } from '@wordpress/edit-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.
Let's avoid this cyclic dependency for @wordpress/editor
package and leave it as a string for now.
packages/block-library/package.json
Outdated
@@ -40,6 +40,7 @@ | |||
"@wordpress/date": "file:../date", | |||
"@wordpress/deprecated": "file:../deprecated", | |||
"@wordpress/dom": "file:../dom", | |||
"@wordpress/edit-post": "file:../edit-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.
Let's avoid this cyclic dependency for @wordpress/block-library
package and leave it as a string for now.
+1 follow 😆. Will fix them right away. |
👋 @gziolo, can you open a ticket to have that discussion? I feel like there must be some immediate changes we could do to adapt the native mobile blocks to use whatever is the pattern the web components have atm, but I'm not sure what that pattern is. I like how you opened #27088 with a checklist of the blocks that need refactoring and would be nice if we compile a similar one for the cases you bring up here. WDYT? |
package-lock.json
Outdated
@@ -13247,6 +13247,7 @@ | |||
"@wordpress/date": "file:packages/date", | |||
"@wordpress/deprecated": "file:packages/deprecated", | |||
"@wordpress/dom": "file:packages/dom", | |||
"@wordpress/edit-post": "file:packages/edit-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.
"@wordpress/edit-post": "file:packages/edit-post", |
I reverted changes to I can't apply changes to the lock file using GitHub UI. Would you mind running |
I opened #27751 to address the issue with cyclic dependencies in other packages - those reverted in this PR. |
05b7417
to
19222ce
Compare
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.
@rafaelgalani thank you for your great cooperation on this PR.
Description
Addresses #27088. Replaces the store names (hardcoded strings) with the exposed
store
definitions.How has this been tested?
npm run test
andnpm run test-e2e
, making sure the tests didn't break.Types of changes
Code refactoring, non-breaking change.
Checklist: