Update name of css and js files (cache busting) #3017
Merged
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.
Change the name of the CSS and JS files to force users to download a new file instead of using a cached version of the existing CSS and JS files.
Here's what we learned throughout the process:
styles.css
tostyles-v1.css
anddocs.js
todocs-v1.js
), both the tests and the build failed, with the following error:lib/ES/Util.pm
file, we saw that this was right after running the Parcel CLI. We decided to try renaming not only the name of the file to be created and sent to built-docs as static assets, but also renaming the source files (styles.pcss
tostyles-v1.pcss
andindex.js
andindex-v1.js
). After making that change, the build succeeded, but we still had three failing tests related to running the docs locally using--open
. All three errors were coming fromspec/single_book_spec.rb
and were related to the fact that it couldn't find the appropriate CSS/JS files to watch and update automatically when developing locally:docs.js
that we missed because the.
was escaped because it was in a regular expression (docs\\.js
). This was fixed in Fixes failing test #3019 where both the build and the tests passed.