oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.05k stars 2.46k forks source link

Bun's Roadmap #159

Open Jarred-Sumner opened 2 years ago

Jarred-Sumner commented 2 years ago

this has not been updated post Bun 1.0, we will update it soon.

This tracks the current near-term plans for Bun.

Edge bundling

With bundle-time functions, static analysis goes dynamic. Objects returned by functions executed at bundle-time are injected into the AST. This makes dead-code elimination work a lot better.

I expect this to spawn a new generation of bundle-time JavaScript frameworks.

But first, a lot more needs to be built.

Main blockers

JavaScript minifier

Web Bundler (production-focused, instead of development-focused)):

CSS parser:

Once complete, the next step is integration with the HTTP server and other Bun APIs

Efficient bundling format

Cache builds into a binary archive format with metadata designed for fast random access, splice(), and sendfile() support. Outside of the edge runtime, these will work as a single-file JavaScript executable internally holding many files.

Instances of Bun will need to know what bundle(s) they're serving. From there, instead of going through a filesystem, we can serve static requests directly from the bundle and dynamic requests will bundle on-demand, potentially importing code from statically-bundled code.

Server-side rendering

Runtime

Edge Runtime

Slimmer, linux-only build of bun.js:

Usability & Developer Experience

Ecosystem

Web Compatibility

note: after a little testing, performance of safari's web streams implementation is similar to deno and much faster than node 18. I expect the final result to be faster than deno because bun's TextEncoder/TextDecoder & Blob implementation seems generally faster than safari's

Security

Windows support

Node.js Compatibility

Reliability

Misc

RnbWd commented 1 year ago

this seems like a lot of work... wow

space7panda commented 1 year ago

Can't wait for full npm-like config support. We are using our own npm registry, and the current build time is 40-60 minutes. If it will be at least 10 minutes this will be a game-changer!

officialrajdeepsingh commented 1 year ago

I am waiting for the stable version of the bun. What change bun in the javascript world.

tipiirai commented 1 year ago

Also waiting for the stable version. So exciting! I bet it's going to take a lot of time though. The scope of this project is much larger than what Node attempts to solve.

matepaiva commented 1 year ago

can someone confirm that right now I can't use the package mysql2? It throws me an error because it depends on TLS package and on NET package, and I think they were not implemented yet in Bun, but I am not sure.

Kapsonfire-DE commented 1 year ago

still missing websocket server support

GCSBOSS commented 1 year ago

Can a tinitiny docker image be placed somewhere in there? 👀

MystPi commented 1 year ago

Can't wait for Windows support... I'll be anxiously awaiting it until it's out. 😅

JacobStraberg commented 1 year ago

still missing websocket server support

Dito

sodeprecated commented 1 year ago

Are you planning to support http2?

moderation commented 1 year ago

Are you planning to support http2?

HTTP/3 is on https://github.com/oven-sh/bun/issues/159 so I would say HTTP/2 will likely be added before that

sodeprecated commented 1 year ago

Are you planning to support http2?

HTTP/3 is on #159 so I would say HTTP/2 will likely be added before that

I would say that http3 on roadmap is more about quic protocol and there is no straight inheritance between http3 and http2, so maybe support of http2 needs to be marked explicitly.

frodoe7 commented 1 year ago

Motivated to see a stable version ASAP

LaurelineP commented 1 year ago

Promising ! Any roadmap on a progressive translation ?

Parvat-R commented 1 year ago

When is the support for windows coming? Cant wait for it.

jacoscaz commented 1 year ago

I would say that http3 on roadmap is more about quic protocol and there is no straight inheritance between http3 and http2, so maybe support of http2 needs to be marked explicitly.

Another vote for HTTP/2 as it's a prerequisite to gRPC support.

dyaskur commented 1 year ago

Any plans to create a desktop app like electron?

xHyroM commented 1 year ago

When is the support for windows coming? Cant wait for it.

https://github.com/oven-sh/bun/issues/43 you can use WSL for now

xHyroM commented 1 year ago

When is the support for windows coming? Cant wait for it.

43 you can use WSL for now

I don't use WSL. Node.js and Deno support Windows natively; why can't Bun?

Check https://github.com/oven-sh/bun/issues/43

devongovett commented 1 year ago

On the topic of CSS parsing, transpilation, minification, etc., what's your stance on dependencies? Do you want to reimplement everything yourself, or would you consider using an embeddable library? If so, I'd love to collaborate with you on embedding Parcel CSS in Bun. It's implemented in Rust, but if we added a C API, I think Bun could call into it pretty easily. It may also work via Bun's napi support, but that would probably be slower. It's about 4x faster than esbuild on benchmarks, minifying over 2 million lines of code per second on a single thread. You can find more info in the announcement blog post from February, though it's gotten even faster since then. Would be cool to work together, and I'm happy to help support how I can.

aphix commented 1 year ago

One thought re: minification, please include a way to exclude class/parameter (on both function and constructor args, and incl. subkeys)/function names from minification as it makes certain dependency injection patterns impossible.

Traditionally, many of the existing DI libraries would use Function.toString() and then use some regex to pull out the fn name & args, but given the reason that is needed and how hacky it is, this may be an opportunity for bun to create a better solution ahead of time, for example by exposing the pre-minified function/class names + argument names programmatically such that they are available at runtime. Note that they much be able to be retrieved before the function is called or class is instantiated.

piosystems commented 1 year ago

How about full support for NestJS? Looking forward to it.

sayjeyhi commented 1 year ago

[ ] read resolutions from package.json

DippsoN commented 1 year ago

Bun should move toward full support for nestjs.

kuator commented 1 year ago

Are there any plans for bun language server? Deno provides one: https://deno.land/manual@v1.29.1/advanced/language_server/overview, so I thought bun might do as well

gabriiels commented 1 year ago

Bun === GOAT

vanor89 commented 1 year ago

Setup a donations button!!

wxs77577 commented 1 year ago

As an Electron or Tauri alternative. Maybe should consider to build single-file executable files. .exe or .msi for windows and .dmg and .pkg for macos.

Alberto-Safra commented 1 year ago

Would love to eventually see support for Qwik. Down the line would be willing to help with the effort too.

gabriiels commented 1 year ago

Would love to eventually see support for Qwik. Down the line would be willing to help with the effort too.

Yes!!!!!!!!!!!!!!!!! Qwik + Bun === GOAT

Willdune commented 1 year ago

Some cool dependency injection would be nice, such as https://www.npmjs.com/package/node-dependency-injection without decorators and making possible configuring yml files for each enviroment, for example. Keep that absolute good work! Love it <3

innocenzi commented 12 months ago

Would a linter/formatter be considered in the future? An alternative to eslint that'd use Bun's parser, would be faster and would have a better plugin/config format?

wsz7777 commented 11 months ago

when can have a tool with bundle analyzer?It's like webpack-bundle-analyzer。 https://github.com/webpack-contrib/webpack-bundle-analyzer

of course , Providing 'stats.json' files is also possible

ceopaludetto commented 10 months ago

For me the main blockers are:

cottons-kr commented 10 months ago

what about native path alias support?

znycheporuk commented 10 months ago

@ceopaludetto

For me the main blockers are:

  • Remix with renderToPipeableStream

React docs statement about renderToPipeableStream:

This API is specific to Node.js. Environments with Web Streams, like Deno and modern edge runtimes, should use renderToReadableStream instead.

Here is example of remix + bun repo https://github.com/jacob-ebey/bun-remix

ceopaludetto commented 10 months ago

@ceopaludetto

For me the main blockers are:

  • Remix with renderToPipeableStream

React docs statement about renderToPipeableStream:

This API is specific to Node.js. Environments with Web Streams, like Deno and modern edge runtimes, should use renderToReadableStream instead.

Here is example of remix + bun repo https://github.com/jacob-ebey/bun-remix

Yeah I found that. Also I get turborepo to work by simulating yarn usage:

  1. First setup workspaces field in package.json (https://bun.sh/docs/install/workspaces)
  2. Then install dependencies with bun(the --yarn flag will generate a yarn.lock file):
    bun install --yarn
  3. Then setup the packageManager field in package.json to yarn(you should have yarn installed in the $PATH):
    "packageManager": "yarn@1.22.19"
  4. Now on every turbo command you should add --skip-infer, e.g.:
    bun turbo build --skip-infer

Turbo will only use yarn to generate the package graph, but the packages resolution will be handled by bun. This is a workaround until this issue get fixed https://github.com/vercel/turbo/issues/4762

chakrihacker commented 10 months ago

Please integrate parcel with bun, as some of the problems on the web world are solved very well by them

niklasgrewe commented 9 months ago

what about web cache api?

achang-ui commented 9 months ago

Is there a roadmap of for v1.0 release? Would like to know what's going to be completed for v1.0. Thanks!

gabrielcaiana commented 8 months ago

amazing!!!

gynet commented 8 months ago

"Supporting both https: and http: imports" - Once this feature is up and running, it has the potential to give Deno a tough run

present-g commented 8 months ago

@Jarred-Sumner, hi, it would be great to update roadmap

When can we get HMR for Frontend dev server?

lindelleric commented 8 months ago

@Jarred-Sumner Are there any plans for adding custom ts ast transformers?

ram-you commented 8 months ago

Hi, Kindly revise this roadmap to reflect the release of Bun 1.0, or alternatively, create a new roadmap for Bun 2.0.

KingCh1ll commented 8 months ago

Hi, is there any development on support for Windows? Been very excited to switch from NodeJs to Bun 👀

harisvsulaiman commented 8 months ago

Hi, is there any development on support for Windows? Been very excited to switch from NodeJs to Bun 👀

Bun 1.0 did launch with windows support.

birkskyum commented 8 months ago

@KingCh1ll lots of development - in here:

aperez900907 commented 8 months ago

Any plan to make remote cache available for building with CI in the future?

gruckion commented 8 months ago

Amazing work guys, truly beautiful. Tried it out on my existing NextJS app works no issues. Looking forward for better support to make use of all the buntastic benefits