Skip to content

Migrate to bun#3137

Merged
jonatanklosko merged 2 commits intomainfrom
jk-bun
Feb 20, 2026
Merged

Migrate to bun#3137
jonatanklosko merged 2 commits intomainfrom
jk-bun

Conversation

@jonatanklosko
Copy link
Member

@jonatanklosko jonatanklosko commented Feb 20, 2026

Closes #3106.

Having bun, we no longer depend on global node installation, so I removed the static files from the git repo and we no longer build it on CI. If someone installs escript from GitHub, it will just build the assets behind the scenes (as in all other cases).

I also migrated from esbuild to vite and setup HMR for dev. A vite full build is a bit slower (~1.5s -> ~6.5s), but in dev the dev server rebuilds are slightly more instant, plus I enabled stateful LV update (which works together with HMR) and now styling changes work without reloading the page. There are other DX improvements, for example compilation errors are shown in a popup, while in esbuild the only feedback is logs mixed with phoenix logs.

While at it, I changed jest for vitest and updated all js deps.

Comment on lines +13 to +20
# In case Livebook is used as a library as in nerves_livebook,
# the assets.setup is not called, so we use this custom compiler
# to invoke the task and make the assets work transparently.
if not File.exists?(priv_static_dir) do
Mix.shell().info("Generating priv/static")

:ok = Mix.Task.run("assets.setup")
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could change nerves_livebook to invoke the task, but I think making it work transparently is good. @josevalim wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

@jonatanklosko jonatanklosko merged commit 846360f into main Feb 20, 2026
6 of 7 checks passed
@jonatanklosko jonatanklosko deleted the jk-bun branch February 20, 2026 21:56
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.

Use bun

2 participants