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

Local deps? #30

Closed
den1k opened this issue Dec 12, 2021 · 7 comments
Closed

Local deps? #30

den1k opened this issue Dec 12, 2021 · 7 comments
Assignees

Comments

@den1k
Copy link

den1k commented Dec 12, 2021

I just painfully found out on a flight that clerk's frontend deps (in my case vega, vega lite, vega embed and katex) are not included in the source and therefore failed fetching in-browser. This is an edge case for sure, but since clerk advertises itself being local first, I think it would be nice for clerk to be able to work offline.

ikappaki added a commit to ikappaki/clerk that referenced this issue Dec 17, 2021
@mk
Copy link
Member

mk commented Dec 21, 2021

True, this is annoying and Clerk should support working completely offline. I'll revisit this after #36 which switches to tailwind's play cdn and is another thing to consider for offline support.

@borkdude
Copy link
Collaborator

Working on this.

@borkdude
Copy link
Collaborator

This has now been addressed in PR #113.
Before we merge this, please test commit ccae890.

You can cache assets locally, before entering a plane, with:

clojure -X nextjournal.clerk/cache-assets!

But also while using clerk, assets will be cached on first use.

@borkdude
Copy link
Collaborator

Anyone? :)

@mk
Copy link
Member

mk commented Jan 31, 2023

Was chatting with @borkdude about resuming work on this. When we actually tried it we discovered to my surprise that Clerk does work fine when offline, as long as you previously had a notebook with the viewers you're using open. This includes KaTeX, Vega, Plotly etc which are all cached in the browser and do survive a reload. So this is a lot better than how I thought it worked.

We might want to consider bundling these deps in the jar in the future but would track that in a separate issue when the need arises.

@mk mk closed this as completed Jan 31, 2023
@den1k
Copy link
Author

den1k commented Jan 31, 2023

Yes, I believe I was on a plane while debugging and had to do a hard refresh which put a hard stop to any development. Hard refreshes are somewhat common in moments of debugging despair. I think this is still a valid issue and it seems the solution is straightforward.

@mk mk reopened this Sep 11, 2023
@mk
Copy link
Member

mk commented Sep 11, 2023

f35635f implements caching of all assets used by Clerk in the browser's ServiceWorker, finally.

@mk mk closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants