framework
framework copied to clipboard
support typescript
TODO:
- [x] code blocks
- [x] inline expressions
- [x] imports
- [x] tests
- [ ] documentation
- [ ] do we need the
tstag? if all thejscells are "cleaned up"…
closes #79
We can look at the imports part together after #120 is merged!
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.
imports are working
I've reworked this PR and it's now passing all the JS code (inline, fenced, and imports) through esbuild.
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? 🤔
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.
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?
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.
superseded by #1632