Subscribe to Gutenberg's data API#9080
Merged
danielFangstrom merged 25 commits intotrunkfrom Mar 16, 2018
Merged
Conversation
js/src/analysis/PostDataCollector.js
Outdated
| if( ! isEmpty( getData() ) ) { | ||
| gutenbergData = getData(); | ||
| } | ||
| let text = this.getText(); |
Contributor
There was a problem hiding this comment.
For consistency: do not put this in a variable either.
js/src/analysis/data.js
Outdated
| } | ||
| } | ||
| } | ||
| for( let dataPoint in gutenbergData ) { |
Contributor
There was a problem hiding this comment.
Is the other way comparison needed? They always include the same keys, right?
So if you check a.data !== b.data then you no longer need to check b.data !== a.data.
js/src/analysis/data.js
Outdated
| */ | ||
| const refreshYoastSEO = () => { | ||
| let gutenbergData = collectGutenbergData(); | ||
| data = updateData( data, gutenbergData ); |
Contributor
There was a problem hiding this comment.
It seems to me that you could do the isDirty check here and then you could overwrite data only if needed. That way you do not need a separate updateDate function.
Contributor
|
CR 👍 |
Contributor
|
ACC 👍 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
This PR can be tested by following these steps:
Important: Currently, Gutenberg only saves a slug after publishing the post.
Quality assurance
Fixes #9019