Because Preact is cool.
This project does not have any build tooling similar to Webpack, or Vite. Why? Because it is possible to run a minimal setup without build tooling.
Node web frameworks are great. However, with a little bit of routing logic, Nodejs can be a great HTTP server alone. Note: This non-web framework approach is unsuitable for big projects.
Using urlpattern-polyfill, a basic ssr router can be created. Also, this project loads static files in memory for fast access.
See the server-http.mjs
file.
Example of a ssr router using urlpattern
here:
https://examples.deno.land/http-server-routing
npm i
npm run dev
Use VSCode with the lit-html extension - https://marketplace.visualstudio.com/items?itemName=bierner.lit-html.
Preact - https://preactjs.com/guide/v10/getting-started
As there aren't build tools to split server from client components, we might need to maintain a server and a client component in some situations. See Box.mjs
and Box.js
. I am yet to find a more elegant way to handle this.
I use the .js
file extension for client components and the .mjs
file extension for server components.