-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Bindings: do not use useSource hook conditionally #59403
Merged
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
37a7f5a
replace use-binding-attributes with block-binding-support
retrofox 09f8565
minor enhancement
retrofox 45742ca
minor change
retrofox 6af2517
tweak
retrofox f02c4ef
do not import use-binding-attributes
retrofox 6412b7d
use isItPossibleToBindBlock() helper
retrofox 5749a34
introduce core/entity source handler
retrofox 25b0bb8
rename folder
retrofox 76e0cb5
rename source name
retrofox dc48e09
polish post-entity source handler
retrofox 44421f1
make core/post-entity more consistent with core-data
retrofox 8a11812
make entity source hand;ler more generic
retrofox 1b40bef
fix entity sour handl;er issues
retrofox 59b26ba
remove uneeded useValue () hook (crossfingers)
retrofox 72338e3
minor jsdoc improvement
retrofox f7d87a8
clean
retrofox b60c7ea
rename with updateValue()
retrofox adfd711
remove core/entity binding source handler
retrofox 832f170
move useSource to Connector cmp
retrofox 42fc47c
move the whole dryining logic to the Connect component
retrofox 09c8cd3
improve jsdoc
retrofox b0a0310
rename to blockProps
retrofox c46c140
minor jsdoc improvements
retrofox 4f4e3b5
use a single effect to update attr and value
retrofox 5ae157e
discard useValue. Return value and setValue instead
retrofox 6ebb240
check wheter updateValue function is defined
retrofox 8c8c90c
check prop value is defined when updating attr
retrofox 536bc90
handle `placerholder`
retrofox 4063d77
ensure to put attribute in sync when onmount
retrofox 6a28f73
remove // eslint comment
retrofox 55c8cda
enable editing for bound with post-meta
retrofox a255fd5
move block bindiung processor to hooks/
retrofox a2b5326
ensure update bound attr once when mounting
retrofox ad5b1e1
Update packages/block-editor/src/hooks/block-binding-support/index.js
retrofox 4e8f2c8
disable editing block attribute
retrofox f06ce6d
move changes to the use-binding-attributes file
retrofox de41aa0
introduce BlockBindingBridge component
retrofox c1119b5
update isItPossibleToBindBlock() import path
retrofox 52c45e1
introduce hasPossibleBlockBinding() helper
retrofox bdc0b82
use hooks API to extened blocks with bound attts
retrofox f1e941a
fix propagating attr value. jsdoc
retrofox b944f21
minor changes
retrofox b9f8aef
minor code enhancement
retrofox e6cf0e3
not edit bound prop for now
retrofox 8f69062
jsdoc
retrofox ff76966
revert using hooks API to extrend block
retrofox 8b135ba
jsdoc
retrofox df35039
update internal path
retrofox d84bc0a
rollback hook utils chnages
retrofox 75284b4
tidy
retrofox 2c8edfb
wrap Connector instances with a Fragment
retrofox 5b39024
return original Edit instance when no bindings
retrofox c86f3dc
check whether useSource is defined
retrofox 967efaa
Use `useSelect` and move it out of the for loop
michalczaplinski 3143392
check attr value type
retrofox f0af985
iterare when creating BindingConnector instances
retrofox 67dd86a
rename helper functions
retrofox fed0e87
use useSelect to get binding sources
retrofox 9126558
Update packages/block-editor/src/hooks/use-bindings-attributes.js
retrofox 5179ad0
Update packages/block-editor/src/hooks/use-bindings-attributes.js
retrofox 9837379
pass prev attr value to compare
retrofox cdbbda7
improve binding allowed block attributes
retrofox f4906b6
sync derevied updates when updating bound attr
retrofox c554dc5
improve getting attr source
retrofox 9621b02
check properly bindings data
retrofox eb27c87
preserve the RichTextData for block attr
retrofox fbb24f2
comment line just for tesrting purposes
retrofox 90c828a
rebasing changes
retrofox 01ce180
rollback change foir testing purposes
retrofox f790ca7
change cmp prop name. improve jsdoc
retrofox 46da935
simplify checking bindins value
retrofox 1762e9c
use attr name as key instance
retrofox e03d861
store bound attrs values in a local state
retrofox 8e2eeaa
collect and update bound attr in a local state
retrofox 56a782b
Refactor block binding functionality from e55f6bc
michalczaplinski 80e8102
pick block data from straight props
retrofox eb0f79a
Merge branch 'update/do-not-conditional-hook-in-binding' of github.co…
retrofox fa9ed05
remove conditional onPropValueChange call
retrofox 021f87a
Merge branch 'trunk' into update/do-not-conditional-hook-in-binding
retrofox b6d14b5
Update e2e tests
SantosGuillamot 879129c
Use `useLayoutEffect` instead of `useEffect`
SantosGuillamot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
If we want to address the pattern override use case and not push ourselves into a corder, we should also make use of the
updateValue
callback.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.
Initially, the PR handled the updateValue callback but then decided to address it in a follow-up. Do you think we should proceed to do it in the same PR? cc @SantosGuillamot
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.
As this is not going to be a public API and
updateValue
is not going to be used yet, I would include it once we work on the pull request to use this hook for pattern overrides.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.
Exactly,
updateValue
is part of the API in the original PR #58085 and all prototypes. Post Meta source is forced to be in readonly mode for the initial rollout in WP 6.5.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 see that
updateValue
is even implemented for the Post Meta source. It isn't wired here as intended for now.