framework icon indicating copy to clipboard operation
framework copied to clipboard

support typescript

Open Fil opened this issue 2 years ago • 8 comments
trafficstars

TODO:

  • [x] code blocks
  • [x] inline expressions
  • [x] imports
  • [x] tests
  • [ ] documentation
  • [ ] do we need the ts tag? if all the js cells are "cleaned up"…

closes #79

Fil avatar Nov 09 '23 11:11 Fil

We can look at the imports part together after #120 is merged!

cinxmo avatar Nov 09 '23 14:11 cinxmo

Related #136 which moves imported local ES modules to an _import path, which means we can rewrite these files more easily during preview and build.

mbostock avatar Nov 09 '23 20:11 mbostock

imports are working

Fil avatar Nov 11 '23 23:11 Fil

I've reworked this PR and it's now passing all the JS code (inline, fenced, and imports) through esbuild.

Fil avatar Dec 11 '23 13:12 Fil

This is a first step that allows you to write ts (or copy/paste ts) and run the code. But the hope is that we'll be able to get type checking with a VSCode extension #882? 🤔

Fil avatar Mar 13 '24 06:03 Fil

As a user I don't want tsc to run with the framework, or at least not in dev, I can do that separately before deploy, once.

Storybook also ran tsc for the users and it made it very slow, they added a config flag to skip checks, which is a blessing, on by default now iirc.

I think the value of TypeScript will be provided by the editor itself running the checks and autogenerated definitions to glue parts of the framework together (that can come later)

Just being able to load ts files is plenty of gain.

codingedgar avatar Aug 18 '24 07:08 codingedgar

Now that I read it again, I want to clarify.

tsc should be able to run and detect errors, just not constantly in dev, but as a stand alone command; would expect npx tsc to work.

Not sure if thats what you mean it's not working?

codingedgar avatar Aug 18 '24 07:08 codingedgar

Yes we should consider landing this without enforcing type checking and just stripping type annotations. We’ll need to merge main but that should be doable.

mbostock avatar Aug 18 '24 11:08 mbostock

superseded by #1632

Fil avatar Sep 04 '24 13:09 Fil