-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert to TypeScript #26
base: master
Are you sure you want to change the base?
Conversation
@developit let me know your thoughts on this, if you would prefer keeping this JS only then I can release something on DefinitelyTyped. I'll do some cleanup and add some docs and JSDoc etc if this is likely to get merge :) |
Nice! This looks great. I might take a crack at a JS + JSDoc + checkJs version of what you have here just to compare, since it seems like most of the typing ends up being for the outward-facing API. |
My master branch does a similar thing with just |
Considering this package has no external dependencies, if a conversion to typescript is done, rather than just js + jsdoc, then this package could use https://github.com/bevry/make-deno-edition to make itself compatible with deno (make-deno-edition publishes a |
@developit did you want me to update my master branch to use @balupton Nice! Up to Jason if he wants to support it :) |
Editions incurs a substantial install and exec cost, I don't think it's something worth doing for a library that just has two sources. @AndrewLeedham I'll take a look at your master to compare. Sounds like we have a similar preferred setup, haha. |
The make-deno-edition workflow does not use the editions autoloader, so no consumer exec cost: deno consumers would load vhtml via |
@balupton interesting, I didn't know Deno had built-in support for that. Do you know if it's just a static lookup for |
I'll clarify this in more detail to come over the coming period, with tutorials and videos, however the quick version is: Deno only supports already resolved paths (e.g. This means that, anything imported into Deno must be directly resolvable and uses ESM. Which means that Deno has no conception of What bevry/make-deno-edition does however, is go through your source edition (the directory containing your package's typescript source files), and resolves them all:
With this, Inside the Users of this package who are writing native deno code, can then use that URL directly, or they can just write node, browser, and deno comaptible code by letting That is the essentials. This can be taken and automated further, with utilities like bevry/projectz to automate the README.md instructions, and bevry/boundation to automate the entire package management and compatibility; for instance using all of these, allows the package start-of-week to have a custom entry for browsers, node, and deno - with everything else automated, the readme, including the installation instructions, which includes the deno instructions which directs the user to So the most important thing for now, is for |
@developit Any thoughts on the rewrite vs allowJS approaches? |
Is there any updates on this? Any help needed? |
Not really sure, just looking for some guidance from @developit on the approach. |
I followed the way https://github.com/developit/mitt is setup.
This is likely a breaking change as
minified:main": "dist/vhtml.min.js"
no longer exists.Some notes about the changes:
<command/>
since it is obsolete: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/command#Browser_compatibilityempty-tags.d.ts
file (via rimraf) generated by microbundle as that code is bundled via rollup. Not sure if that is a microbundle, rollup-plugin-typescript2 or configuration issue, but I couldn't find a workaround.onClick
withonclick: string
as passing functions is not currently supported: perhaps they can be added back with Interest in supporting react style event handlers? #24fixes: #25, #19