Skip to content

Commit

Permalink
✨v3 website
Browse files Browse the repository at this point in the history
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
cowboyd committed Jun 22, 2023
1 parent 8b567df commit 034839e
Show file tree
Hide file tree
Showing 110 changed files with 24,479 additions and 11,230 deletions.
2 changes: 2 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"exclude": [
"build",
"website",
"www",
"packages"
]
},
"fmt": {
"exclude": [
"build",
"website",
"www",
"packages",
"CODE_OF_CONDUCT.md",
"README.md"
Expand Down
98 changes: 0 additions & 98 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions website/.editorconfig

This file was deleted.

14 changes: 0 additions & 14 deletions website/.gitignore

This file was deleted.

33 changes: 0 additions & 33 deletions website/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions website/babel.config.js

This file was deleted.

6 changes: 0 additions & 6 deletions website/docs/guides/atom.md

This file was deleted.

7 changes: 0 additions & 7 deletions website/docs/guides/cli-etiquette.md

This file was deleted.

6 changes: 0 additions & 6 deletions website/docs/guides/closing-sockets.md

This file was deleted.

6 changes: 0 additions & 6 deletions website/docs/guides/filewatcher.md

This file was deleted.

99 changes: 0 additions & 99 deletions website/docs/guides/futures.md

This file was deleted.

Loading

0 comments on commit 034839e

Please sign in to comment.