working on a CSS framework
(much inspired by @benjaminhollon's `readable-css`!)
updates to follow.
progress:
rewrote my router in JS with `expressjs`. much simplifed, much cleaner.
just got errors to work in now!
writing an HHTP server, but i think i massively underestimated the complexity of something like this.
i wanted to actually parse requests, which was a mistake, because parsing the request line alone took 200 LoC. at least headers were easy..
you can now use arbitrary NPM packages server-side.
this was one of the last major caveats to my SSR system!
`index.html` (abridged)
```js
server.onload = () => {
console.log(`1 is ${server.imports.isOdd(1) ? '' : 'not '}odd.`);
};
```
`imports.mjs`
```js
import isOdd from "is-odd";
export { isOdd };
```
(`is-odd` is added as a dependency in the local `package.json`)
implemented SSR. it was so much simpler than i thought (i've been overcomplicating this in my head for ages XD)
anyways. i think i want to restructure this project, and then i'll finish the HTML preprocessor. this is cool af, though!
demo:
the TODOs are being read from a file & rendered on the server (first image). the refresh button uses data "fetched" by the browser (second image).
source:
<https://github.com/Hex5DA/rtc/blob/master/examples/ssr/index.html>