Today we're thrilled to announce our effort to port the TypeScript compiler and language service to native code, gaining a 10x speed boost in build times and editor responsiveness!
https://t.co/zxTchNDMwD
Node.js v23.6.0 is out! 🥳🎉
This release enables the flag --experimental-strip-types by default.
Node.js will execute TypeScript files without additional configuration!
⚠️ This feature is experimental, has limitations and is subject to change.
https://t.co/hIoTQz7B26
@ballingt In those cases, you kind of _want_ to have duplicated and unassignable TS types, because that accurately describes the situation. But for simple functions and values, things that aren't meant to be used nominally, there's no issue.
@ballingt We do this on DT a lot because it's usually just not worth actually duplicating the .d.ts content. The only caveat is if the ESM/CJS JS actually export things that exhibit bad dual-package behavior, like classes that will be checked with `instanceof` or duplicate Symbol()
@ballingt But I mean, for some import that results in TS loading `a/dist/esm-types`, is the same import meaningful at runtime, e.g. will it load a value in Node.js? In other words, do any of the types describe the exports of a JS module, or is it purely a collection of types?
@mitschabaude But Node doesn't do type stripping inside node_modules, so if you're writing a library, you're in this situation where you can run TS during development, but you need to publish JS files. That makes it impossible to satisfy our rule of "write the specifier that works at runtime."
@mitschabaude We already had support for that via --allowImportingTsExtensions, but you were forced into --noEmit with that. That felt good enough for folks targeting Bun and bundlers, because for those scenarios, you never really need to emit .js files at all.
@wooorm@robpalmer2 @remcohaszing @ssalbdivad@johnny_reilly Yeah. Put another way: compile .ts and/or .js files, publish .js and .d.ts files. If you’re skipping the compilation step, you’re authoring .js and .d.ts.
Editing with @britto_gab's work on region-prioritized diagnostics has been so great:
> in our testing on TypeScript’s own checker.ts, a full semantic diagnostics response took 3330ms. In contrast, the response for the first region-based diagnostics response took 143ms!
👏
The release candidate for TypeScript 5.6 is now available for testing! Give it a try today for more new checks, ways to speed-up your builds, new JS features, and more!
https://t.co/fOCHAAgWKv
Dual publishing ESM and CJS is hard. Getting the types incorrect in your package.json is disappointingly easy. If you want something to help you with both, then maybe tsup and Are the Types Wrong can help. Thanks to @atcb for his assistance with this ❤️🌻
https://t.co/O54vdAz9em