[Theme] Fix Liquid asset hot reload #4669
Merged
+41
−5
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.
WHY are these changes introduced?
Fixes #2614
WHAT is this pull request doing?
When a missing .liquid asset that is referenced in the app is created anew, the server will try to hot reload it and fail.
Pairing with @jamesmengo , we found out during the first rendering, SFR renders
?1234
for the file querystring, which returns a 404.The problem is that even after creating the file and uploading it, SFR still renders the wrong
?1234
instead of?v=timestamp
. This makes the request fail again with 404 even though the file already exists. This might be related to caching at the SFR level, I'm not sure about it.This PR makes 3 changes:
?1234
with a new?v=
timestamp.?1234
queries to?v=
timestamp queries. This fix would probably also work for CSS assets, but I'm keeping the previous one since it's cleaner for CSS.How to test your changes?
.liquid.css
file from your theme.Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist