_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

experimental TypeScript port

Open rozek opened this issue 3 years ago • 1 comments

First of all: I do not expect you to merge this PR into your branch!

I just started this PR in order to let others follow the changes I had to make to the original code in order to let it run on older devices and browsers.

Nevertheless, I would recommend that you (sooner or later) port your JavaScript code base to TypeScript in order to benefit from its extensive code checks and cross-compilation capabilities

If you want to test this port, just use

<script src="https://unpkg.com/hyperscript-experimental"></script>

instead of the usual script element.

With greetings from Germany,

Andreas Rozek

rozek avatar Jul 29 '22 17:07 rozek

FYI: it's a lot of work, but thanks to your doc comments I'm proceeding quickly and with great confidence

rozek avatar Jul 29 '22 19:07 rozek

closing this PR for now, want to keep hyperscript build free

really appreciate you researching the idea though!

1cg avatar Oct 04 '22 20:10 1cg

Can we at least have typings for typescript users?

I come up with prove of concept

npx tsc --declaration dist/_hyperscript.js --allowJs --emitDeclarationOnly --skipLibCheck

and in your package.json file added

"types": "dist/_hyperscript.d.ts",

and it works on the end-user side

FDiskas avatar Jul 31 '23 11:07 FDiskas

yes, we are planning on working on getting the JSDoc definitions cleaned up & also verifying the existing code w/ it.

1cg avatar Jul 31 '23 13:07 1cg