Kho tháng 12/2025
Tue Dec 16 07:32:32 PM CET 2025
I slept for too long on rice cooker
Watched a video the other day. It never occurred to me I could put more than just rice in the rice cooker. Add half a bouillon cube (a whole one is too much). Add some frozen vegetables, no need to thaw. Add some meat as well if you feel like it. Close the lid. Meal ready in 30 minutes.
Fri Dec 5 04:55:06 PM CET 2025
deno and vite, part 1
Suddenly wanted to look at javascript again (and not because of the react vulnerability). First step though is to go small(-ish). So forget react, let's just start a new server. Which seems to be vite in this case somehow.
Creating a new project is just
deno run -A npm:create-vite-extra --template deno-vanilla
which prepares everything and starting is just
cd vite-project
deno task dev
The project name will be asked during deno run. The --template can
be dropped too and be chosen from a TUI-like list.
Not really sure how URL routing works yet, but any .html file at topdir shows up in the web browser's top URL as well. In dev mode, vite inserts
<script type="module" src="/@vite/client"></script>
which probably helps auto reload the page when the source file is
changed. It should be in <head> node if it's there otherwise it's
directly under <html>. That's 1000 lines or 179kb, no way to
actually read it.
In the .html file, src attribute of <script> tag is rewritten. src
is local path while of course the real path has to be URL. The rest
seems standard typescript.
One interesting bit is the import statement from javascript
apparently can load css as well. We don't even need separate html tag
for that. Or importing an SVG to a variable. The variable apparently
contains the SVG embedded in the URL (with data: "protocol").