Skip to content

Bundle dependencies #67

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

Merged
merged 9 commits into from
Jun 11, 2022
Merged

Bundle dependencies #67

merged 9 commits into from
Jun 11, 2022

Conversation

Rich-Harris
Copy link
Member

This packages up the contents of content/tutorial/common into a zip file and generates a small boot.cjs file that unzips it inside the webcontainer.

There's a tiny bit more to it than that — we exclude certain unused files from the zip file, and rename esbuild-wasm to esbuild — but it all works pretty nicely. In this video, the top browser is the current main, the bottom one is this PR. The first load is with a disabled cache, the second is with a populated cache:

startup-comparison.mov

It's possible that turbo with a package-lock.json would be comparable, but it would be tricky to maintain lockfiles for all the apps that have dependencies from npm.

One thing this PR doesn't consider is whether life will get complicated in future if we want to allow the user to install dependencies on-demand, since in that case turbo would need to construct a lockfile anyway, meaning that installation would be slower than if we started with a lockfile. But we can cross that bridge when we come to it.

@vercel
Copy link

vercel bot commented Jun 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
learn-svelte-dev ✅ Ready (Inspect) Visit Preview Jun 11, 2022 at 2:47AM (UTC)

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

Successfully merging this pull request may close these issues.

1 participant