paint-brush
TypeScript 5.6, Bun Integrates C, Fastify v5, and more - This Week in JSby@thisweekinjavascript

TypeScript 5.6, Bun Integrates C, Fastify v5, and more - This Week in JS

by This Week in JavaScriptSeptember 23rd, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In this edition, we'll cover the latest on TypeScript 5.6 and its new ts-blank-space compiler, Bun's experimental support for compiling C code in JavaScript, the release of Fastify v5, Safari 18's Web API enhancements, and ESLint's updated version support policies. Let's dive in!
featured image - TypeScript 5.6, Bun Integrates C, Fastify v5, and more - This Week in JS
This Week in JavaScript HackerNoon profile picture

Hello JavaScript Enthusiasts!


Welcome to the first issue of "This Week in JavaScript"! In this edition, we'll cover the latest on TypeScript 5.6 and its new ts-blank-space compiler, Bun's experimental support for compiling C code in JavaScript, the release of Fastify v5, Safari 18's Web API enhancements, and ESLint's updated version support policies. Let's dive in!


TypeScript 5.6 Introduces ts-blank-space Compiler

First up, TypeScript 5.6 was announced last week, and everyone's talking about ts-blank-space! It's a super-fast type-stripping compiler that takes TypeScript and turns it into JavaScript by simply removing type annotations and replacing them with whitespaces.


Why is this exciting?

  • Speed Boost: Skips complex transformations and type checking, making it about 5.6 times faster than the usual TypeScript compiler.
  • Accurate Debugging: Keeps error stacks accurate without the need for sourcemaps, making debugging easier.
  • Limitations: While it supports a modern subset of TypeScript, it doesn't handle features like JSX or some older syntax just yet.


Overall, ts-blank-space is a solid option for developers looking to speed up their TypeScript compilation process!


Bun Adds Experimental Support for Native C Code

Next big news: you can now compile C code in JavaScript, thanks to Bun! Bun v1.1.28 has added experimental support for compiling native C code and then running its functions from JavaScript.


What's the big deal?

  • Seamless Integration: Mix C code with your JavaScript effortlessly.
  • Fast Compilation: Built-in TinyCC compiler compiles C code in milliseconds, so it won't slow down your workflow.
  • Low Overhead: Just 2 nanoseconds per call, making it even faster than N-API or WebAssembly.
  • Access System Features: Now you can access system-specific features, like the macOS Keychain, directly from JavaScript.
  • Simplified Setup: No need for complicated build steps or native addon setups—it's all simplified.


While it's not designed for large-scale C projects, this feature is a game-changer for JavaScript developers who want a smoother way to tap into the power of C.


Fastify v5 Released with Exciting Updates

Moving on to Fastify! Fastify v5 has just been released, and it's packed with exciting updates.


What's new?

  • Node.js v20 Required: This version now requires Node.js v20 and above, allowing you to take advantage of the latest features.
  • Deprecated APIs Removed: The removal of deprecated APIs makes the framework cleaner and easier to maintain.
  • Performance Improvements: It's about 5 to 10% faster than v4.


If you're looking for a high-performance Node.js framework, now's a great time to check out Fastify v5.


Safari 18 Brings Web API Enhancements

If you weren't already aware of the new macOS, iOS, and iPadOS releases, Safari 18 has also been released.


Highlights include:

  • Web API Enhancements: Numerous Web API improvements enhance compatibility and performance, such as support for URL.parse(), a way to parse URLs which returns null rather than an exception when parsing fails.
  • Improved JS Regex Support: Better support for Unicode in JavaScript regular expressions.


These updates mean your web apps will run smoother and more efficiently on Apple devices.


ESLint Updates Version Support Policies

Finally, ESLint has introduced new version support policies to ensure your code stays clean and up-to-date with the latest JavaScript features.


Why does this matter?

  • Stay Current: If you struggle with keeping your codebase in sync with rapid JavaScript updates, this policy change ensures that ESLint evolves with the language itself.
  • Better Tooling: Updated policies mean better tooling and linting for modern JavaScript features.