observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.57k stars 123 forks source link

TypeScript #1632

Closed mbostock closed 2 months ago

mbostock commented 2 months ago

Reboot of #129. Fixes #79.

TODO

Unlike #129, I expressly avoided allowing TypeScript in inline expressions, which allows us to avoid running the esbuild transform on them, and in turn avoids the problem of esbuild converting expressions to expression statements and then losing implicit display. Not also that there is no implicit display in ```ts blocks. I think this is an acceptable tradeoff, at least for now, as you get the primary benefits of TypeScript modules and TypeScript fenced code blocks and only if you explicitly opt-in to using TypeScript.

Also unlike #129, this only allows TypeScript to be imported with the .js, as we do for .jsx. This is the recommended practice because it means the import path doesn’t change after transpilation.

Fil commented 2 months ago

The next release is going to be HUGE!

mpj commented 2 months ago

oh my