Dev News: Vite Rust-ifies, Roc Language, JS Framework SDKs
The frontend build tool Vite is embracing Rust, from moving to Rolldown in the near future to moving to a Rust core long-term. Evan You, creator of the frontend build tool, outlined the roadmap for Vite to “Rust-ify” at last month’s ViteConf 2023.
Moving to Rolldown will mean a boost in build performance, and later on in dev performance as the team moves performance sensitive parts of Vite to Rust. It will also reduce inconsistencies between dev and build, the team noted. While Rolldown is currently in early stages, the team hopes to open source the codebase before the end of the year.
Vite 5 focused on cleaning up the API by removing deprecated features, streamlining features and closing some long-standing issues, according to the release notes. Rollup 4 also provides a “big boost in build performance,” said the team.
Other changes in this release of Vite:
- CJS Node API has been depreciated;
- Vite 5 requires Node.js 18/20+. Node.js 14/16/17/19 will no longer be supported;
- server.warmup, new feature that improves startup time. “It lets you define a list of modules that should be pre-transformed as soon as the server starts,” the team added. “When using –open or server.open, Vite will also automatically warm up the entry point of your app or the provided URL to open.”
Improvements in Vite 4.3 already increased the speed to up to four times faster for a cold startup and up to two-times faster for hot model replacement (HMR).
You pointed out that Vite’s ecosystem has already expanded to include:
- Angular, which uses Vite as a deg server;
- Preact, which switched the default tooling to Vite in June;
- Redwood, which is now built on Vite;
- Bun, which has supported Vita for awhile now; and
- Remix, which is working with the Vite team on a migration to Vite.
Roc Language for WebAssembly Launches Website
The Roc language launched an official website this week. The Roc site boasts that the new language is user-friendly and fast for both build and run. The language compiles to machine code or WebAssembly.
Use cases for Roc include:
- Creating scripts and command-line interfaces (CLIs). “The compiler produces binary executables, so Roc programs can run on devices that don’t have Roc itself installed,” the documentation noted.
- Building web servers in Roc. The site notes that, behind the scenes, it uses Rust’s “high-performance hyper and tokio libraries to execute your Roc function on incoming requests.”
- Embedding into other languages. Roc functions can be called from other languages. This GitHub project offers basic examples of how to call Roc functions from Python, Node.js, Swift, WebAssembly, and JVM languages.
FusionAuth Launches Open Source SDKs for Vue, React and Angular
The SDKs are designed to make it easier for developers to prioritize authentication for single-page applications (SPAs) via app integration with FusionAuth.
Developers can use FusionAuth to add registration, login and user management features to their applications at scale. The company also has client libraries for Python, Java, Typescript and five other languages, as well as an OpenAPI spec.
TypeScript 5.3 Released
The updates in TypeScript 5.3 include:
- Import attributes. “One use-case of import attributes is to provide information about the expected format of a module to the runtime,” Rosenwasser explained.
- Stable Support resolution-mode in Import Types
- resolution-mode Supported in All Module Modes
- switch (true) Narrowing
- Narrowing On Comparisons to Booleans
- Optimizations by Skipping JSDoc Parsing
- Consolidation Between tsserverlibrary.js and typescript.js
Speaking of TypeScript, if you’ve wondered how to use TypeScript with React, this free tutorial may be of interest.