-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add Server Side Render component. #5602
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
cd58776
Add blocks-renderer API endpoint. Add skeleton for ServerSideRender c…
miina b0ede76
Update SSR preview when editing attributes.
miina 340136e
Fix binding preview change.
miina 514dd4f
Fix binding preview change.
miina a90f40d
Add tests. Fix permission check for get_item.
miina 0c127e1
Remove debugger line.
miina b0b977a
Fix some phpcs.
miina 395a168
Fix some jscs.
miina 1d05c2d
Show 'loading' when changing response.
miina c40dd25
Use wp.apiRequest for consistency.
miina f323651
Update ServerSideRender readme to note intended usage
westonruter c4abc69
Rename classes, methods, and property to be more aligned with the res…
westonruter 6557877
Register block-renderer endpoint for each dynamic block
westonruter 228c756
Fixes to README. Use isEqual. Renaming method.
miina b48ef81
Fix checking for existing response.
miina e39332d
Add putting together query URL from object.
miina 46506a9
Fix some jscs.
miina ce1f7c6
Fix using correct props with fetching.
miina e0fec83
Improve putting together query URL. Use attributes as separate param.
miina 17e404a
Make path constant more readable.
miina 39b867a
Add setting global if is present.
miina 4c3129b
Merge branch 'master' of github.com:WordPress/gutenberg into add/780-…
miina 3c60d4b
Update Readme.
miina a10bfac
Register post_id. Add context. Fix tests.
miina a166324
Fix CS.
miina f0f4a77
Merge remote-tracking branch 'origin/master' into add/780-server-side…
miina 6d1ee65
Add more tests. Add exception for namespace to as ruleset.
miina 2bbbeb7
Fix eslint.
miina 6f7d62e
Merge branch 'master' of github.com:WordPress/gutenberg into add/780-…
miina 67af6b7
Add context param to API request.
miina 007fb1d
Add version numbers to the phpdocs
pento 1c9ef56
Tweak the README a little
pento 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
Remove debugger line.
- Loading branch information
commit 0c127e1a2729f6fa94f89d65d42f8e031bc9686a
There are no files selected for viewing
This file contains hidden or 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
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.
What about using
isEqualfrom lodash?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 was going to comment that there was room to figure out how aggressive this component should be with refetches and ask if a shallow equality check could make any sense. However, by design, block attributes should (until abused) retain a very simple shape.
isEqualshould do it.More importantly, it's not clear to me why there is state synchronization at all. Perhaps this is a relic of a previous solution?
responseappears to be the only datum requiring local state. Component props should be fed directly intogetOutput. If the goal is to trigger a refetch and a rerender, the following should be enough: