microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
99k stars 12.29k forks source link

Design Meeting Notes, 5/28/2024 #58686

Open DanielRosenwasser opened 1 month ago

DanielRosenwasser commented 1 month ago

Options for import cjs from "cjs" and require(esm)

https://github.com/microsoft/TypeScript/issues/54102

Checking of string literal union object keys and template types

https://github.com/microsoft/TypeScript/issues/58673

robpalme commented 1 month ago
  • Lots of bundlers say this just echoes the string pkg to the console.
  • esbuild and Webpack do the "Node-specific" behavior

Vite uses esbuild so I'm wondering which bundlers do the non-Node behavior? I checked out the linked issues but could not immediately see a list.

DanielRosenwasser commented 1 month ago

@andrewbranch knows best - Parcel, Bun, and Rollup at least come to mind.

andrewbranch commented 1 month ago

Parcel, Bun, and Rollup are the ones I tested latest versions of in preparation for this design meeting. Versions are a little older, but Vite is included in https://andrewbranch.github.io/interop-test/#default-export-esmodulejs and you can see it’s aligned with Parcel/Bun/Rollup, not esbuild/Webpack. Vite uses Rollup in production and esbuild in development. The report linked above is showing results with Vite instrumented in production mode. I’m not sure whether it’s possible to observe the esbuild interop behavior in Vite development mode.