Repository navigation
Standalone Block Registration/Block Dependencies - #10503
Merged
Merged
Conversation
…ules. Structure for declaring block dependencies.
Collaborator
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: December 4, 2018. Generated by 🚫 dangerJS |
enejb
reviewed
Nov 1, 2018
enejb
reviewed
Nov 1, 2018
Member
|
Beside the minor renaming of things I think this works as expected. I tested this with the JN link above and it worked as expected. |
lezama
reviewed
Nov 1, 2018
jeherve
requested changes
Nov 2, 2018
jeherve
left a comment
Member
There was a problem hiding this comment.
A few minor improvements that I think we could make.
…file only if Gutenberg is enabled.
Contributor
|
Good for me too. @jeffersonrabb feel free to merge if you're ready to have it land. |
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.
This adds a few pieces needed for the Map block (and similar future ones) to work following recent changes to block building and view script loading in #10405 and Automattic/wp-calypso#28066.
Fixes
modules/. Here, this is done inmodules/blocks.php.Testing instructions:
To test the Map block, it will need to be built from the https://github.com/Automattic/wp-calypso/tree/try/map-key branch. The Calypso branch resolves a naming consistency problem (
mapvs.maps-block) and temporarily adds a hardcoded Google Maps API key so it can be used without the changes in https://github.com/Automattic/wp-calypso/tree/try/map-key. This Calypso branch is meant only for testing with this PR, and will be deleted after this PR merges.To test with Jetpack docker:
wp-calypsobranch try/map-key.jetpackbranchtry/block-dependencies.wp-calypsorepo:npm run sdk gutenberg client/gutenberg/extensions/presets/jetpack -- --output-dir=PATH_TO_JETPACK_REPO/_inc/blocks. (Replace PATH_TO_JETPACK_REPO with relevant path)._inc/blocks/map/exists and containsview.css|view.js|view.rtl.css.To test with Jurassic Ninja use this link:
https://jurassic.ninja/create/?gutenberg&gutenpack&shortlived&jetpack-beta&calypsobranch=try/map-key&branch=try/block-dependencies
Flows to verify
1: Verify that Map block loads and renders in editor and view. If the view.js or any of the dependencies are missing the block will be completely blank.
2: In view, watch Network tab to verify that all dependent Javascript files are loading. Among others you should see:
/wp-content/plugins/jetpack/_inc/blocks/map/view.js/wp-content/plugins/gutenberg/vendor/react-dom.min/wp-content/plugins/gutenberg/vendor/react.min.ab6b06d4.js(or similar)/wp-content/plugins/gutenberg/build/element/index.js/wp-content/plugins/gutenberg/build/i18n/index.js/wp-content/plugins/gutenberg/build/api-fetch/index.js3: Remove the map block (or create a second post without it), publish and view. In the Network tab none of the above files should be loading.
Proposed changelog entry for your changes: