sandpack
sandpack copied to clipboard
Add support for caching the build for 2nd load onwards
Tell us how you think we can improve Sandpack
The current implementation of bundler doesn't cache the build which means, even on the second or subsequent loads the whole build process starts from scratch causing a huge performance overhead(think about a sandpack using tons of npm dependencies)
Packages affected
- [x] sandpack-client
- [x] sandpack-react
What is this feature?
Feature Request: Add support for caching the build for 2nd load onwards
This helps with our use-case of running a "heavy sandpack"! This should also help every user of sandpack have an instant preview 2nd load onwards (no matter their choice of template and build step)
cc @danilowoz @DeMoorJasper
Is there a workaround for caching bundles at point in times and using them for instant preview?
In our Sandpack use-case, the time taken to resolve (assuming npm modules of all deps are cached) is currently closer to 20s.
For more context: Original question thread on discord.
@danilowoz Any updates on this issue or an alternative that you recommend for this use-case?