Skip to content

What's New in Bun v1.2 - Faster, More Reliable, and Packed with Features

Published:Β atΒ 03:34 PM

Table of contents

Open Table of contents

😎 What’s New in Bun v1.2

Bun continues to innovate with v1.2, bringing enhancements that focus on performance, reliability, and usability for developers. Whether you’re building modern web apps or optimizing workflows, Bun v1.2 is designed to make your development process faster and easier.

Key Features and Updates

πŸš€ Performance Boosts

πŸ›  Improved Windows Support

  1. Rewritten fs.watch:

    • Enhances speed and reliability.
    • Deduplicates watched paths to reduce memory usage.
    import { watch } from "bun";
    
    watch("src", (event, filePath) => {
      console.log(`${event}: ${filePath}`);
    });
    
  2. Error Fixes:

    • EBUSY: Resolved for vite dev and next dev.
    • ENOENT/EEXIST: Improved handling of tarball extraction for npm packages.

🐚 Bun Shell Enhancements

Bun Shell now supports popular GNU Coreutils commands:

Example:

import { $ } from "bun";

await $`seq 1 5`;
// Output:
// 1
// 2
// 3
// 4
// 5

await $`basename /path/to/file.js`;
// Output: file.js

await $`dirname /path/to/file.js`;
// Output: /path/to

πŸ“¦ Enhanced Package Management

  1. bun install --production Without Lockfile: Perfect for CI environments.

    bun install --production
    
  2. Fixed Crashes in Tarball Downloads: Improved error handling ensures smoother installs for edge cases.

πŸ–‹ TypeScript Parsing Fixes

Complex TypeScript edge cases are now parsed correctly:

type Example = Bar extends string | (infer Baz extends string) ? Baz : never;

These fixes provide seamless compatibility for advanced TypeScript patterns.

Upgrade to Bun v1.2

To get started or upgrade to the latest version:

bun upgrade

For fresh installs:

curl -fsSL https://bun.sh/install | bash

Conclusion

Bun v1.2 is a game-changer for developers seeking speed, reliability, and simplicity. With improved performance, enhanced Windows support, and new features, it’s the ultimate toolkit for JavaScript development.


Next Post
Astro Actions - Seamless Communication Between Client and Server Code