belaustegui
Hi!
Bun is a new all-in-one toolkit for Javascript: bundler, test runner, package manager, dev. environment, etc. It can do what Esbuild does, and more.
I’ve just published a package heavily inspired in the Esbuild integration package made by Wojtek Mach and José Valim that is adapted to install and invoke Bun.
I am using it in a personal project of mine and the switch from Esbuild requires very minimal changes. Then, it allows you to install and the many node packages available without requiring NodeJS or NPM. It also supports TypeScript, JSX, CSS, WASM, and many more (even Rust!).
Anyway. If you want to check it out you can take a look at the GitHub Repo and the Hex.pm package.
Thanks again to @josevalim and @wojtekmach for creating the Esbuild packge
which I used as a base.
Trending in Announcing
Other Trending Topics
Latest Phoenix Threads
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
D4no0
It seems that you have some typos in readme:
While the name of the package is elixir_bun on hex.
belaustegui
Thanks for noticing this @D4no0 . I planned to name the project just
bunbun when I was trying to push it to Hex.pm I found out that the name was already takenI renamed it to
elixir_bunbut seems that I forgot to change it in a few places. Will do it right now.EDIT: fixed just now. Thanks again.
belaustegui
I’ve just released elixir_bun 0.1.4 with the following changes:
Thanks to @pepicrft and @LostKobrakai who made their first contributions to the project
For more information you can take a look at the Hex.pm package and the release notes.
belaustegui
Hi all again!
When I created this package I wanted to publish it as
bunto follow the conventions set by the esbuild and tailwind packages. Unfortunately that package name was taken so I had to publish my project as elixir_bun instead.After getting in touch with the hex.pm team they confirmed that having an empty package that is just squatting on a name goes against the hex.pm policies so it has been removed and made available again.
Long story short: the elixir_bun package is now retired on hex.pm and replaced by the bun package. If you are updating from
elixir_bunyou just have to replace:elixir_bunwith:bunin your project.Since this is a breaking change I’ve used the opportunity to release version 1.0 as bun can now be considered stable.
Greetings!
belaustegui
Hi all!
I’ve just released bun 1.1.0 which fixes an issue when running under elixir-slim Docker images. Thanks @Wigny for noticing and fixing the issue
Additionally new installations will no use the latest bun version (1.0.26 at the moment of writing this). Remember that you can use the library configuration to pick the bun version that you want to use.
As usual you can check out the GitHub Repo and the Hex.pm package for the release notes and more information.
Happy coding!
Wigny
Hey, thanks for maintaining this nice tool.
Yesterday I was trying to achieve something similar to what the
deno_exlibrary does, but usingbun, which is providing thebunbinary at runtime that later can be called withSystem.cmd/2or usingPort, allowing you to call JavaScript files from Elixir.The problem I faced first was that the library by default downloads the binary in the
_build/directory and then when my project was compiled and released (mix release) the binary was not available anymore. To solve this issue I tried to imitatedeno_exand set thebunpath toApplication.app_dir(:bun, "priv/bin/bun"), but since this function was not meant to be used at compile time, I had to set this configuration in theruntime.exsfile withconfig :bun, path: "..."and ensure to callmix bun.install --runtime-configin themix assets.build task.I know I could set the
bunpath to the applicationprivdirectory, but it’s an umbrella project and it doesn’t make sense for me to put the binary that will be used by a few child applications in a specific application. So for anyone reading this, any suggestions on a better approach to makingbunavailable in the final release?belaustegui
I think that each application that requires the
bunexecutable should havebunas a dependency. This would allow you to set the requiredprivpath per application, so each of them has its ownbunexecutable.Another approach that may work (but I don’t like as the first one) is to just save the bun executable in a well known path and access it directly from each application.
For example if you are using Docker for running the release you could download the bun executable in a particular path in the image and then access it directly in the applications.
belaustegui
Hi all!
I’ve just released bun 1.2.0 which improves the process wrapper. It now uses Bun to wrap itself in a way that automatically shuts down when the stdin closes. This removes the POSIX shell dependency on the development machine.
Thanks @hauleth for noticing and fixing this!
Additionally I’ve updated the default Bun version that is downloaded to 1.0.33, which is the latest stable version released at the moment. As usual, you can override this setting in your configuration.
Check out the GitHub Repo and the Hex.pm package for the release notes and code.
Happy coding!
hauleth
Honestly, I have been using such script for some time now. I just finally decided to port my solution to
bunlibrary (I do not use this library in my project, I use my own wrapper instead).znewbiez1001
@belaustegui Thank you for awesome installer!
But can you support me with this error:
I got that on a Macbook Pro M1. I tried to spot errors and it turned out there wasn’t a case to be matched with the MacBook
inspecting result: [“arm”, “apple”, “darwin23.3.0”]
So can you please push fix codes for this? Thanks in advance!