refactor(loop): leave Pro features' runtime to Pro - #349
Merged
Merged
Conversation
An infinite trigger dispatches a cancelable vp-infinite-load before each load it starts by itself. Pro holds loads through it for its startup and every-page options, so free no longer reads their data attributes. data-vp-infinite-threshold stays, documented as generic.
A loop sends vp-loop-request before it loads an address, and a listener may answer with the page through respondWith. It sends vp-loop-loaded once it shows what it loaded. Pro prefetches through them, so the vpf_loop_prefetch filter and callbacks.initPrefetch go.
The search block stays registered and renders nothing, and Pro supplies its render callback through register_block_type_args. actions.navigateTo lets a script swap the loop for an address of its own, and vp-loop-request is sent first in a navigation, so that a search waiting for a pause in the typing can stop on it.
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 plugin carried the runtime of several Pro features that do nothing without Pro. It now keeps only generic extension points, and Pro (nk-crew/visual-portfolio-pro, same branch name) runs the features.
get_screen_queries()vp-infinite-loadevent before each automatic load;data-vp-infinite-thresholdvp-loop-request(an extension answers with a page it holds) andvp-loop-loadedactions.navigateTo( href, { replace, ref } )All of it is documented in
docs/gallery-loop-blocks.md. Without Pro every navigation, Load More and infinite scroll behaves as before. Popup gallery settings stay here on purpose, so users see them in the interface.A site on Pro 3.8.0 or older that updates only this plugin loses the two loop infinite-trigger pauses and the Twenty Twenty-Two iframe padding. Pro 3.8.1 and later bundle their own copy, which this plugin steps aside for.
Checked: lint, PHPUnit 448 OK, e2e 211 passed; with Pro, the free suite on the Pro build 207 passed.