The post has been translated automatically. Original language: Russian
The server-side JavaScript runtime Bun has received two versions in a row. Major 1.4.1 was released on September 4, 2026: according to the release notes, 202 tasks were closed in it, which received 236 user votes. The very next day, on September 5, 1.4.2 appeared — a short release almost entirely from the regression fixes of the previous version.
Server, Network, and Runtime
The main change for those who send HTTP from Bun directly is that the built—in Bun.serve() server accepts HTTP/2 on the same port as HTTP/1.1 - there is no need to separate listeners. For web sockets, the pause() and resume() methods have been added - a regular way to control the flow when the consumer does not have time. The Bun.write() function has learned how to stream the Response and Request object bodies to disk, without buffering the entire response in memory.
Native argon2() and argon2Sync() have been added to the cryptographic module. Password hashing using a modern algorithm is now available without third—party native modules. The TLS verification was adjusted separately: the certificate is checked against the hostname from the URL, and not against the value of the Host header.
From the performance numbers stated in the release notes: Buffer operations became faster up to 9.2 times due to embedding in the JIT compiler, AsyncLocalStorage - about twice, output of large objects via Bun.inspect() — up to 43 times. Plus, runtime deletes the generated JIT code after a long downtime, which reduces memory consumption by an inactive process.
Build, Dependencies, and Tests
The package manager has received two offline modes: one sets dependencies strictly from the cache, the second does not go for metadata again. Packages inside the workspace now receive a self-contained node_modules directory. The collector has improved the removal of unused code during dynamic imports: for libraries built on the re-export of the entire module, the bundle size has decreased by 85 percent. Compilation into a standalone executable file supports cross-platform bytecode assembly, and the executable files themselves have become 45 percent smaller. An isolation mode has appeared in the test runner, which prevents module graphs from flowing between test files.
What was fixed in 1.4.2
The first regression was in the collector: nested variables could be renamed the same way within the same block, and the output was syntactically incorrect code with an error about declaring var, obscuring let, const, or class. This was most noticeable on imports of the Elysia framework.
The second was a memory leak in AsyncLocalStorage: the values of the external storage remained alive if timers or promises were created inside the context exit or nested startup. In worker_threads, the order of events has been corrected: "online" comes first again, which is why libraries tied to this sequence used to hang.
The rest: about 350 tightened commits of the WebKit engine, eliminating rare JIT crashes in long-lived processes, fixing freezes on the musl library, that is, in Alpine, and double-closing file descriptors in Linux.
What does this mean in practice?
If Bun is running on the battle circuit, it's worth updating to 1.4.2 right away: the collector's regression does not break any code, but only certain structures, so it's easy not to catch it on a small project and get a non-working artifact already in the release build.
Check two places separately. The first is TLS: if the client went to the service at an address other than the Host header (a typical story for internal load balancers), a new check may start dropping connections. The behavior is correct, but the configuration will have to be repaired. The second is HTTP/2 on a shared port: if there is a proxy in front of the application with its own ideas about the protocol version, make sure that the negotiation proceeds as you expect.
The stated accelerations should not be taken on faith: figures like "up to 9.2 times" refer to specific microtests, and not to the average application, so measure the load on your profile.
The draft text was prepared with the participation of AI, the facts were checked against the original source — the official blog of the Bun project with notes for releases 1.4.1 and 1.4.2.
Серверный JavaScript-рантайм Bun получил две версии подряд. Крупная 1.4.1 вышла 4 сентября 2026 года: по заметкам к выпуску в ней закрыто 202 задачи, набравшие 236 голосов пользователей. Уже на следующий день, 5 сентября, появилась 1.4.2 — короткий выпуск почти целиком из исправлений регрессов предыдущей версии.
Сервер, сеть и рантайм
Главное изменение для тех, кто отдаёт HTTP из Bun напрямую: встроенный сервер Bun.serve() принимает HTTP/2 на том же порту, что и HTTP/1.1 — разделять слушателей не нужно. Для веб-сокетов добавили методы pause() и resume() — штатный способ управлять потоком, когда потребитель не успевает. Функция Bun.write() научилась потоково писать на диск тела объектов Response и Request, без буферизации всего ответа в памяти.
В криптографический модуль завезли нативные argon2() и argon2Sync() — хеширование паролей современным алгоритмом теперь доступно без сторонних нативных модулей. Отдельно поправили проверку TLS: сертификат сверяется с именем хоста из URL, а не со значением заголовка Host.
Из чисел производительности, заявленных в заметках к выпуску: операции с Buffer стали быстрее до 9,2 раза за счёт встраивания в JIT-компиляторе, AsyncLocalStorage — примерно вдвое, вывод больших объектов через Bun.inspect() — до 43 раз. Плюс рантайм удаляет сгенерированный JIT-код после длительного простоя, что снижает потребление памяти неактивным процессом.
Сборка, зависимости и тесты
Менеджер пакетов получил два офлайн-режима: один ставит зависимости строго из кеша, второй не ходит за метаданными повторно. Пакеты внутри рабочего пространства теперь получают самодостаточный каталог node_modules. В сборщике улучшили удаление неиспользуемого кода при динамических импортах: для библиотек, построенных на реэкспорте всего модуля целиком, размер бандла уменьшился на 85 процентов. Компиляция в самостоятельный исполняемый файл поддерживает кросс-платформенную сборку байткода, и сами исполняемые файлы стали меньше на 45 процентов. В тестовом раннере появился режим изоляции, который не даёт графам модулей протекать между тестовыми файлами.
Что починили в 1.4.2
Первый регресс — в сборщике: вложенные переменные могли переименовываться одинаково в пределах одного блока, и на выходе получался синтаксически некорректный код с ошибкой про объявление var, затеняющее let, const или class. Заметнее всего это проявлялось на импортах фреймворка Elysia.
Второй — утечка памяти в AsyncLocalStorage: значения внешнего хранилища оставались живыми, если таймеры или промисы создавались внутри выхода из контекста или вложенного запуска. В worker_threads исправили порядок событий: «online» снова приходит первым, из-за чего раньше подвисали библиотеки, завязанные на эту последовательность.
Остальное: около 350 подтянутых коммитов движка WebKit, устранение редкого падения JIT в долгоживущих процессах, починка зависаний на библиотеке musl, то есть в Alpine, и двойного закрытия файловых дескрипторов в Linux.
Что это значит на практике
Если Bun работает на боевом контуре, обновляться стоит сразу на 1.4.2: регресс сборщика ломает не любой код, а только определённые конструкции, поэтому его легко не поймать на маленьком проекте и получить нерабочий артефакт уже в релизной сборке.
Отдельно проверьте два места. Первое — TLS: если клиент ходил на сервис по адресу, отличающемуся от заголовка Host (типичная история для внутренних балансировщиков), новая проверка может начать ронять соединения. Поведение правильное, но конфигурацию чинить придётся. Второе — HTTP/2 на общем порту: если перед приложением стоит прокси со своими представлениями о версии протокола, убедитесь, что согласование идёт так, как вы ожидаете.
Заявленные ускорения не стоит принимать на веру: цифры вида «до 9,2 раза» относятся к конкретным микротестам, а не к среднему приложению, так что замеряйте на своём профиле нагрузки.
Черновик текста подготовлен с участием ИИ, факты сверены с первоисточником — официальный блог проекта Bun с заметками к выпускам 1.4.1 и 1.4.2.