Rob's garden / notes / note

Note

I’ve been really interested in the idea of isomorphic JavaScript recently. With Deno pushing web standards on the backend it’s interesting to see how much you can share between front and back end.

https://fresh.deno.dev is kinda cool but I’m really not a fan of file-based routing and their testing story isn’t there. I was playing around today with my own JSX based SSR, though it isn’t entirely isomorphic JS.

With fetch’s Request & Response and URLPattern you can kinda make a server with routing using web-native primaries then with JSX you can do HTML templating.

Then you can use an actual

to do interactions and handle them on the server and return more templates HTML. Ok this is just PHP isn’t it 😅 I think it’d be interesting to look into streamlining progressively enhanced Ajax stuff next

The other thing I can’t work out with isomorphic #JavaScript is dependencies. ESM is local files or ones at URLs but hosted JavaScript (npm et al) is all about node.js based code. I was exploring this with an S3 bucket of JavaScript at https://esm.r0b.io which can work.

I’m manually uploading code into directories and referencing them via an import_map.json. I’m not sure how to streamline that to be like “npm publish” yet, or how/if to TypeScript it. Ideally self-hostable too.