Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As part of the migration to v3 we need to be able to update the documentation as well be able to have a method to embed playgrounds into our websites. This will be crucial for Effection, but also in derivative libraries and future products. Goals: 1. Fast deploys, easy previews. 2. Zero build 3. Just HTML™️ 4. Explicit vs Implicit Render This is just simple Deno server that serves HTML templates. The server definition is in `www/server.ts`. It uses a route recognizer to parse path and query parameters, and then calls an HTML template that is expressed in JavaScript (The data structure is defined by https://github.com/cowboyd/html) and then serialized to a DOM using [deno_dom](https://github.com/denoland/deno_dom) and Google's [incremental-dom` library](https://github.com/google/incremental-dom). Tailwind CSS is used as the atomic CSS framework. The documentation, like the v2 website is based on MDX. Ideally, we would like to not require a build step for this, and in development mode we can, by compiling the MDX into a JavaScript module. However, becaue Deno Deploy [does not support dynamic import](denoland/deploy_feedback#1), this is not an option at the moment. Future directions: - I think we can simplify things considerably by using [hast](https://github.com/syntax-tree/hastscript) as the structural representation of the HTML. This means several things: We can apply rehypejs plugins at any level, not just MDX, and also we do not need to use `deno_dom` nor `incremental-dom` for server side rendering since there is a direct transform from `hast` -> `string` - It would be nice to have autocompletion and type checking for tailwind classes. - Because we're based on Effection, we can use really nice helpers to interrupt a request mid-flight to redirect, render 404, etc...
- Loading branch information