-
Notifications
You must be signed in to change notification settings - Fork 79
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
Write hash in pre-commit hook for predicable viewer.js location, build JS in CI #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks good and getting this should nicely improve the workflow. Only wondering if we can do a pass on the names here to make it clearer what this is for.
Some ideas:
write-hash
→write-viewer-resources-hash
hashing.clj
→viewer-resources-hashing
refresh-cdn
→build+upload-viewer-resources
front-end-hash.txt
→viewer-js-hash.txt
, orviewer-resource-manifest
if we turn it into the same map thatclerk.resource_manifest
is.
Alternatives to resources
could be assets
(which I know you don't like) or to stay as narrow as possible viewer-js
. Though I do want to add building a css file here very soon.
Note that in clerk.resource_manifest
we already use a custom css if that key is set.
Now thinking that we should unify those names, so either change the clerk.resource_manifest
system property to become clerk.viewer_resource_manifest
or drop the viewer
from the suggestions above. Leaning towards with viewer, wdyt?
@mk Excellent suggestions. I also renamed the |
@mk Implemented the changes. One thing I'm wondering about. What if we get hash collisions, e.g. gs://nextjournal-cas-eu/data/lookup/2MnmwsYfak9x5j6cXDBB56uRiheT already exists, but was produced from a different set of files a year or so ago. Should we do additional cache invalidation? |
As discussed: collisions aren't considered a problem. Ready for squash/merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some remarks which we might want to address in a follow-up.
Thanks, will resolve in follow up. |
Processed all comments and pushed to the ui tests branch (to avoid merge conflicts, rebasing, etc, I'd like to limit the work in progress). |
Fixes #102
@mk Ready for review.