-
Notifications
You must be signed in to change notification settings - Fork 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
Map Block, With Asynchronous Loader #28498
Conversation
… Refactor of Frontend Management's handling of block children to avoid altering the DOM. Refactor of view.js files with component and config as properties of a single object, for greater uniformity and less code in the preset view file.
…on and popover will always be shown together. The dashed icon is no longer a button for invoking the popover. Add Marker UI will be visible when map is first revealed. Icon in Block Controls shows the Add Marker UI.
…s info window immediately appearing.
…s view.js, to simplify the presets.
…ation often caused the infowindow to jump (sometimes off screen) making it difficult or impossible to continue editing.
…t which looked suspicious. San Francisco is new default center point (to help me test using client's location, since I live in NY)
…r color and map theme are now in Panels.
…arious editor chrome.
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 block is great and we need to get it merged. Several folks have already gone over it, but there are certainly a few things left to do.
With this PR it will be included in the Jetpack beta blocks and nowhere else, which makes this relatively safe.
Let's get together a list of the remaining bits that will be handled in smaller, more targeted follow-up PRs and 🚢 🚢 🚢
Changes proposed in this Pull Request
This is identical to the Map block PR except that it replaces the Calypso loadScript utility with a custom async loader utility that manages scripts and stylesheets. In the Map block, this utility is used to load the Mapbox script and stylesheet at runtime. At some point in the future, making a library like this available in Gutenberg core might be a valuable addition for plugin authors (cc: @mtias).
Also, Map block has been removed from the Jetpack preset and added to Jetpack Beta, so
JETPACK_BETA_BLOCKS
constant will need to be set to test.Testing instructions
Jurassic Ninja link: https://jurassic.ninja/create/?gutenberg&gutenpack&shortlived&jetpack-beta&calypsobranch=try/map+loader&branch=try/google-maps-api-key
Set Up Jetpack
Start with free
Activate recommended features
SSH in using connection string and password found in the persistent admin notice in the site’s wp-admincd ~/apps/$USER/public
wp config set JETPACK_BETA_BLOCKS true --raw --type=constant
Settings->Jetpack Constants
JETPACK_BETA_BLOCKS
and Save.Map