Fifth-Normal-Form
Newbie question: Web development in Deno 2, and .ts to .js transpiling.
The reason I built
Hot does not require any deno.json, nor any package.json, and no node-modules folder. Hot creates its own config file on first use, and that is its only requirement.
The goal was to create an environment for quick development of vanilla HTML, CSS, JavaScript applications that leverage the joy of coding with Typescript.
Hot
, is that I don't care for all the bloat that a tool like Vite adds to your project.Hot does not require any deno.json, nor any package.json, and no node-modules folder. Hot creates its own config file on first use, and that is its only requirement.
The goal was to create an environment for quick development of vanilla HTML, CSS, JavaScript applications that leverage the joy of coding with Typescript.
5 replies
Newbie question: Web development in Deno 2, and .ts to .js transpiling.
I built my own dev server. Think Mini-Vite! Have a look:
https://jsr.io/@ndh/hot
5 replies
std JSON serializer/deserializer with Set and Map support
It would be very hard to beat the performance of native V8 JSON!
Native V8 JSON is extremely fast
See this in action : https://nhrones.github.io/Hot_BuenoCache/
NOTE: First use builds a test dataset in IndexedDB. Run more than once.
Repo at: https://github.com/nhrones/Hot_BuenoCache
6 replies
Without using a framework, how do I compile natively supported TS in Deno into static JS?
For a working example see:
https://nhrones.github.io/Hot_BuenoCache/
Click the see-the-code link on the bottom left of the page!
Or just go to the repo:
https://github.com/nhrones/Hot_BuenoCache
Or just go to the repo:
https://github.com/nhrones/Hot_BuenoCache
6 replies
Without using a framework, how do I compile natively supported TS in Deno into static JS?
You could try a simple util like https://jsr.io/@ndh/build
Or, even better; roll-your-own!
Create the following module -- builder.ts
Just modify the entrypoints and outfile to suit your needs.
You can also specify to bundle or not, and minification or not.
Add the above module to you project root. Then just to run:
deno run -A --quiet builder.tsYou could also add this as a task in deno.json called build.
6 replies
cannot publish package to jsr but it uses a shared file
There is a new Discord server for JSR
https://discord.gg/hMqvhAn9xG. Perhaps you could get help there.
https://discord.gg/hMqvhAn9xG. Perhaps you could get help there.
3 replies
How to add a simple live reload?
Be aware that I'm making many link changes to the code as I move all utilities to JSR. The config utility is in flux as well as the builder utility. Its all there in public repos, but as I untangle the local references to move all to JSR, it may not work without reference errors. I got lazy with these and used local refs for the dependencies. I'll have it all moved in a day or two.
The auto-config is not required. I use it in all dev-tools because I'm lazy. I like to just type 'serve' or 'hot' in any project to get coding. I'm just a hobbyist trying to learn Web-Dev.
30 replies
How to add a simple live reload?
Yes! Whenever index.html is requested, we inject the WebSocket code to the end of the text being sent to the browser. The file itself is never modified. Any .ts-code change forces a new build/bundle to ./dist/bundle.js . This new bundle, or any change to the html or CSS files force either a globalThis.location.reload() or a remove-then-reinstall stylesheets style-refresh by way of the WebSocket.
30 replies
How to add a simple live reload?
An example WebSocket refresh that is injected on serve, and does not modify the html file. It simply modifies the text sent to the browser.
https://github.com/nhrones/Devtools_Hot/blob/main/injector.ts
This server auto-starts the browser, then on any ./src/ or ./dist/ change, it builds/bundles and then auto-refreshes the browser.
It injects the WebSocket code (above) whenever the request URL is for '/' or 'index.html' https://github.com/nhrones/Devtools_Hot/blob/main/server.ts The unique feature is that the watch-function will distinguish between a code change or a stylesheet change. For a stylesheet, it simply refreshes the styles without disturbing the app.
It injects the WebSocket code (above) whenever the request URL is for '/' or 'index.html' https://github.com/nhrones/Devtools_Hot/blob/main/server.ts The unique feature is that the watch-function will distinguish between a code change or a stylesheet change. For a stylesheet, it simply refreshes the styles without disturbing the app.
30 replies