stiegi
Opinions: replace esbuild with bun.js
As the title suggests, I’d like to hear your opinion of the idea to replace esbuild with bun.js, since it recently received its 1.0 release. The release trailer can be found here: https://www.youtube.com/watch?v=ThyMiimsAA0, more infos about bun you can find here: https://bun.sh/
For those who haven’t heard of it: bun is supposed to be a drop-in replacement for nodeJS and Deno. It as also a package manager so it replaces npm etc, and it comes with its own test suite. Written in Zik (https://ziglang.org/), it seems much faster than node and deno.
Now, I know that Phoenix switched to esbuild quite recently, however bun seems to outperform esbuild, and can also be used as a test framework and even as a runtime, in case you need some service written in JS. So, as it looks like, it would be everything esbuild is (a bundler) but faster, and more. There’s already support for many frameworks, and I think it would be great if you could spin up a Phoenix app, and combine it for example with a single page application of your choice out of the box.
What is your opinion about this? Would you prefer to stick with esbuild for now, or do you think it would make sense to switch again?
Most Liked
belaustegui
This has been on my mind since Bun released version 1.0. I’ve published a package today to integrate Bun with Elixir which is heavily based on the Esbuild package.
LostKobrakai
Esbuild was chosen to lessen the node/npm related churn on the phoenix team. I personally wouldn’t see a switch to bun being helpful to that goal.
I’d love to see someone build a wrapper for downloading bun like the esbuild wrapper does it though.
LostKobrakai
I don‘t see where phoenix should or could become more agnostic to built tooling. The only reason it ships with one integrated is because it would be bad for a fresh phoenix project to require the user to setup an assets pipeline. It need to ship some reasonable baseline.
But the intergration points phoenix has with an assets pipeline is the config in dev.exs to start one or more watchers and one or more commands in mix.exs to run a full build. Both are actually optional if you don‘t need the assets pipeline to run with phoenix commands, but start them out of band. If those commands can put files somewhere in priv/static/… things will work.
Phoenix LiveReload checks files being changed in that folder as well. It doesn‘t care how or by which method files are changed in the folder.
So really phoenix doesn‘t care at all what you use. It just wants to see the resulting files being placed/updated in a certain folder.
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









