Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add
__default
binding for pattern overrides #60694Add
__default
binding for pattern overrides #60694Changes from all commits
9d45054
a099f03
bbca6e9
e89587a
8acdc99
f897e0f
77d7b20
afee53f
c6b1c4f
e5b834f
9b2dce8
bb2280e
50822b7
29a65a4
869d53d
b07b346
1cd20dd
5638bcd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
To do this strictly correctly, we should use
PARTIAL_SYNCING_SUPPORTED_BLOCKS
to match attributes to specific block types. Right now, this function is duplicating what is already some temporary hardcoded information, which just seems a bit too error-prone.That said, IMO the strictly correct way seems overkill for the purpose of this branch. We could just loop over all keys of
.metadata.bindings
to replace.source.name
and call it a day.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 agree we should probably just iterate through the bindings and remove the ones with source
core/pattern-overrides
, and avoid having this hardcoded list.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.
This works ok in the site editor, but for some reason isn't working in the post editor when navigating to the original pattern. It must be that
convertLegacyBlockNameAndAttributes
is never called when switching to edit a different entity.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.
Could you clarify the testing instructions for this? I'm seeing a consistent result on my end.
Kapture.2024-04-23.at.14.59.09.mp4
It won't automatically change from
content
to__default
as shown in the recording, but I think it's expected as the function only runs on change. It's also backward compatible this way, I believe. Maybe there's something I'm missing though 🤔.