| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@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 :) |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
My master branch does a similar thing with just .d.ts files no JSDoc yet, but exposes the typings, I did that while I was figuring out how to type JSX :) https://github.com/AndrewLeedham/vhtml/tree/master/src |
Sorry, something went wrong.
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 edition-deno directory, with things like './empty-tags' changed to './empty-tags.ts' — this directory would be used directly by deno packages) and would set the deno field in package.json to the edition-deno/vhtml.ts file, with this field used when make-deno-edition is run on dependents of this package. |
Sorry, something went wrong.
@developit did you want me to update my master branch to use checkJs? @balupton Nice! Up to Jason if he wants to support it :) |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
The make-deno-edition workflow does not use the editions autoloader, so no consumer exec cost: deno consumers would load vhtml via http://unpkg.com/vhtml/edition-deno/vhtml.ts. The development exec cost to generate the edition is about a second. For install, we are talking about a few extra files. |
Sorry, something went wrong.
|
@balupton interesting, I didn't know Deno had built-in support for that. Do you know if it's just a static lookup for edition-deno, or are they actually respecting the rules present in package.json? Seems like in the case of this library it would be possible to just statically point to src/vhtml.ts were it to be landed as TS. |
Sorry, something went wrong.
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. ./other.ts), be it relative or absolute (e.g. https://unpkg.com/badges@^4.13.0/edition-deno/index.ts) This means that, anything imported into Deno must be directly resolvable and uses ESM. Which means that Deno has no conception of package.json. For imported TypeScript, that means each import must not omit or occlude the .ts extension. 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, make-deno-edition then makes a directory called edition-deno that has the deno compatible resolutions applied for paths that were successful; if a source file is not compatible, it is ignored if it is optional, or cause the deno edition to fail if it is required. Inside the README.md you then instruct the consumers of your package to point to the unpkg cdn url for the deno edition and its entry, for this package it would become https://unpkg.com/vhtml/edition-deno/vhtml.ts. 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 make-deno-edition handle the deno compatibility. 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 https://unpkg.com/start-of-week@2.7.0/edition-deno/deno.ts, the package.json, etc etc. So the most important thing for now, is for make-deno-edition to be run on the ecosystem primitives (packages that have no dependencies) so that the ecosystem can then build ontop of them, with ever increasing compatibility. |
Sorry, something went wrong.
|
@developit Any thoughts on the rewrite vs allowJS approaches? |
Sorry, something went wrong.
|
Is there any updates on this? Any help needed? |
Sorry, something went wrong.
|
Not really sure, just looking for some guidance from @developit on the approach. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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:
fixes: #25, #19