https://github.com/mb21/mastro
Minimal, no-dependencies take on a Deno web framework for MPAs.
https://github.com/mb21/mastro
deno mpa ssg typescript
Last synced: 3 months ago
JSON representation
Minimal, no-dependencies take on a Deno web framework for MPAs.
- Host: GitHub
- URL: https://github.com/mb21/mastro
- Owner: mb21
- Created: 2024-01-04T15:54:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-21T06:41:41.000Z (9 months ago)
- Last Synced: 2024-10-21T22:35:33.186Z (9 months ago)
- Topics: deno, mpa, ssg, typescript
- Language: TypeScript
- Homepage:
- Size: 85.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mastro
A *m*inimal take on an [*Astro*](https://astro.build)-like MPA web framework.
🚧 While the Mastro server framework is still a work in progress, the client-side part is already very usable: see [**Reactive Mastro**](src/reactive/).
## Philosophy
- No magic. Easy to understand codebase using simple JS functions wherever possible. Favour small, [composable functions](https://mb21.github.io/blog/2021/09/11/composable-abstractions.html).
- Zero client-side JavaScript by default.
- No build step or bundler by default.
- Minimal dependencies (see `deno.json`)
- File-based routing: `routes/` contains files with handler functions and that's the only way. No `.md` files with `layout` frontmatter property, no `.astro`-like-frontmatter-magic, no `.html` files, etc.
- JSON and HTML [route handlers](https://blog.val.town/blog/the-api-we-forgot-to-name/) are uniform. A handler takes a `Request` object (and no props, and hopefully no context).
- Server components are simple JS functions that by convention take a props object.
- For client-side components, see [Reactive Mastro](src/reactive/).
## How to run
`cd examples/blog/`
Start dev server:
deno run start
Generate static site:
deno run generate
## TODOs
- Fully implement `src/generate.ts` (SSG) and `src/server.ts` (dev and maybe also prod server)
- publish as package or packages
- Asset handling (on server startup / static site generation?)
- support something like CSS Modules? Then again, read [this great article by Heydon Pickering](https://www.smashingmagazine.com/2016/11/css-inheritance-cascade-global-scope-new-old-worst-best-friends/) if you want to be convinced otherwise.
- image resizing- docs