Skip to content
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

Fix include viewStyle assets in dynamic version generation #436

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fabiankaegy
Copy link
Member

Description of the Change

WordPress uses the version property of a block.json file as the cache busting property for any style assets that are defined in it. This is okay but means you have to manually update a version parameter every time. If you don't it will use the current WordPress version as a fallback.

In #281 we added some handling to toolkit which automatically generates and injects a version param if there isn't already one defined that consists of a hash of all the assets starting with file:.

This automatically generated version currently only accounts for style assets. viewStyle assets are not handled and therefore don't trigger the version generation.

This fixes that by also handling viewStyle in the same way.

Props to @smwoll for raising this to me 🚀

Copy link

changeset-bot bot commented Jan 24, 2025

🦋 Changeset detected

Latest commit: b7da8ff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
10up-toolkit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@fabiankaegy fabiankaegy force-pushed the fix/also-bust-cache-for-view-style branch from 7a2651a to 4321d3b Compare January 24, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant