-
Notifications
You must be signed in to change notification settings - Fork 88
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
SDK - Module Caching #2940
SDK - Module Caching #2940
Conversation
🦋 Changeset detectedLatest commit: 9d7e7fe The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
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 |
…ts-for-module-caching' into lorissigrist/mesdk-81-requirements-for-module-caching
Questions for Reviewers:
|
Thanks for working on this @LorisSigrist! The implementation appears to work as intended. 👍 I have an offline compile working in a test paraglide-sveltekit project, by running the build once, and then disconnecting 🎉 I haven't looked at the code in detail yet, but here are some initial comments after testing:
|
I pushed my test repo to https://github.com/jldec/svelte-latest
|
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.
Network-first avoids cache invalidation problems. Hence, good choice to ship this fast. Can be improved later.
Minor comments. Implement them or not. Your choice.
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.
LGTM - see comment regarding checking the FNV implementation
fyi - i'd be fine with slightly longer file names (10-40 chars) if that gave us better collision avoidance or makes the filenames nicer e.g. if you want to use 52 bit from https://github.com/tjwebb/fnv-plus
This PR adds a network-first module cache to the SDK. This enables devs to keep working offline & in case JSDelivr goes down.
In case the network isn't available, or incredibly slow, it can be annoying to have to wait for the request timeout. To speed this up the SDK now fetches modules in parallel instead of sequentially.