Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hex2f/marz
🚀 A Fast and Lightweight React Server Components Framework for Bun
https://github.com/hex2f/marz
Last synced: 12 days ago
JSON representation
🚀 A Fast and Lightweight React Server Components Framework for Bun
- Host: GitHub
- URL: https://github.com/hex2f/marz
- Owner: hex2f
- License: mit
- Created: 2023-09-10T11:46:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-28T16:23:13.000Z (about 1 year ago)
- Last Synced: 2024-10-16T17:55:20.309Z (27 days ago)
- Language: TypeScript
- Homepage:
- Size: 1.15 MB
- Stars: 391
- Watchers: 6
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🚀 A Fast and Lightweight React Server Components Framework for Bun# Disclaimer
This project is still in very early development, and is currently meant to serve as a proof of concept. It is not recommended to use this in production.
# Getting Started
Marz is built on top of Bun, so before you begin, make sure to follow Bun's installation guide.
### Step 1: Install Bun
Install Bun by following their installation guide, which can be found [here](https://bun.sh/docs/installation).### Step 2: Create Marz
Use the following command to create a Marz project using the interactive [`create-marz`](https://github.com/hex2f/marz/tree/main/packages/create-marz) CLI:```bash
bun create marz
```### Step 3: Run the Server
To start the Marz server, execute the following command:```bash
bun dev
```This command bundles all your pages and components and starts a server on port 3000.
### Step 4: Define Routes
Routing in Marz is determined by the file structure of your `pages` directory. For example:- A file at `pages/index.tsx` will be served at `/`.
- A file at `pages/about.tsx` will be served at `/about`.Each file is expected to export a named `Page` component. Currently, all `Page` components must be server components, but they can import and use client components. Parameters are supported (e.g., `pages/[id].tsx` or `pages/[id]/about.tsx`) and can be accessed via the `params` prop on the `Page` component.
# Known Issues
### Issue 1: Duplicate Export Error
If you encounter a `"Duplicate export of ..."` error, run Marz with the `MINIFY=true` environment variable set. This is caused by an [issue in Bun](https://github.com/oven-sh/bun/issues/5344).### Issue 2: Page Renders Twice
Currently, the page may render twice. This behavior occurs because the server does not include RSC (React Server Components) hydration with the initial HTML response, so the browser also has to call out to `/__marz` to re-render the page with RSC. This issue will be addressed in a future release.# Contributing
Contributions are very welcome! This project is still in its early stages, so there are many ways to contribute. If you're interested in contributing, please join the [Discord server](https://discord.gg/M6mS2cwXag) and say hello 👋
# Authors
* Leah Lundqvist ([@hex2f](https://github.com/hex2f))