Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
This PR makes this starter compatible with the new JS runtime called bun
Bun is the new JS runtime compatible with both Node.JS and Web APIs. It promises to drastically improve performance for both runtime and bundling/installing dependencies. Below, I've gathered some metrics on the differences between our current stack (node + yarn) vs bun. These are values for 95% confidence interval
How does it work?
bun
is not yet a drop in replacement for node. You can notice by the dependencies I've had to remove to make this starter compatible withbun
. Hopefully, these dependencies were not need by either Next.JS or Storybook and I think it's safe to merge this PR and remove these dependencies anyways.I've had issues with the gatsby.store starter, where the sharp module would not be installed. Maybe this will be fixed in the future and we will be able to use bun in there as well.
Vercel is preparing to provide the
bun
runtime and I guess we should prepare ourselves too by adding early support on FastStore Cloud platform via a flag. I think we would have massive gains on this regard.How to test it?
Download this starter and run
bun install && bun run develop
. You should see the starter as usual.References