feat: add Clear Cache button to Freemius block sidebar (0.5.0)#63
Draft
evrpress wants to merge 7 commits into
Draft
feat: add Clear Cache button to Freemius block sidebar (0.5.0)#63evrpress wants to merge 7 commits into
evrpress wants to merge 7 commits into
Conversation
Adds a "Clear Cache" button in two Freemius sidebar locations: below the mapping info text on child blocks, and next to Reset Modifications on the parent scope panel. Introduces a shared ClearCacheButton component wired to POST /freemius/v1/cache/clear via the API store, with a force-refetch of pricing data so block content updates immediately. Shown only to users with manage_options. Files: src/scope/ClearCacheButton.js, MappingSettings.js, Settings.js. Targets release 0.5.0. Editors previously had no in-editor way to bypass server/client API caches when Freemius product data changed; they had to wait for cache expiry or use workarounds.
Updated the useApi hook to ensure local data is kept in sync with the shared store. If cached data is available, it sets the local data accordingly; if local data exists without cached data, it resets the local data to null. This change improves data consistency after cache clear and refetch operations.
…nent Wrapped the ClearCacheButton in a Flex component to justify it to the end, enhancing the layout of the MappingSettings interface.
…sage Added the ClearCacheButton to the Edit component, enhancing the user interface by placing it alongside the Select Scope button within a Flex container. Updated the ClearCacheButton to remove the size prop for consistency across components. This change improves accessibility to cache clearing functionality directly from the block editor.
Keep Cursor config in a local nested repo under .cursor/ and ignore it in the plugin repository so it is not pushed to origin. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Adds a "Clear Cache" button in two Freemius sidebar locations: below the mapping info text on child blocks, and next to Reset Modifications on the parent scope panel.
Introduces a shared ClearCacheButton component wired to POST /freemius/v1/cache/clear via the API store, with a force-refetch of pricing data so block content updates immediately. Shown only to users with manage_options. Files: src/scope/ClearCacheButton.js, MappingSettings.js, Settings.js. Targets release 0.5.0.

Editors previously had no in-editor way to bypass server/client API caches when Freemius product data changed; they had to wait for cache expiry or use workarounds.