TypeScript support
Closed this issue · 5 comments
Are there any plans for supporting TypeScript in this library?
Hi @erkannt
What would that look like? It doesn't not support TypeScript (or any compiles-to-JS superset syntax).
Do you mean types for the call signatures and the options?
Yes, something that provides the types you mention to allow enhance to be used inside typescript projects easily.
The cleanest would we a .d.ts
file inside of this repo, but if that goes against the scope of this project I guess there is always the DefinitelyTyped escape hatch.
Motivation is to add progressively enhanced components to an existing web app written in TS that renders everything on the server side. enhance-ssr
looks like a good fit for this that would let us keep components nicely encapsulated.
As Typescript is not a web standard it does not make sense to use in a web standards focused project.
When types become a standard we will support them at that point in time.
Until then we will avoid all costly and time consuming refactors required to support an ever breaking type system that delivers no user facing benefits.
We respect your time too much to subject you to inevitable breaking changes.
Thanks for clarifying. That choice makes sense to me given your objectives.
You can use Enhance SSR with your project. It exports a tagged template literal function that accepts an HTML string and returns a string of HTML.