• Stars
    star
    391
  • Rank 110,003 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸš€ A Fast and Lightweight React Server Components Framework for Bun

Marz

πŸš€ A Fast and Lightweight React Server Components Framework for Bun

Bun Static Badge Discord Static Badge

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.

Step 2: Create Marz

Use the following command to create a Marz project using the interactive create-marz CLI:

bun create marz

Step 3: Run the Server

To start the Marz server, execute the following command:

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.

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 and say hello πŸ‘‹

Authors

More Repositories

1

ARMagazine

Swift
83
star
2

Diluter

βš›οΈ An automatic Redux reducer, taking the pain out of Redux.
JavaScript
48
star
3

vib

V iOS Bundler: Generic utility to bundle and sign iOS binaries.
V
39
star
4

RantScript

A JavaScript wrapper for the FULL devRant API
JavaScript
30
star
5

xnap

πŸ‘Œ Components that snap.
JavaScript
26
star
6

amrpc

Discord RPC for Apple Music on macOS Catalina.
TypeScript
20
star
7

Anime4K

bloc97/Anime4K Implemented as an easy to use JS library.
JavaScript
16
star
8

5mintuts

Various tutorials in 5 minutes.
JavaScript
9
star
9

droppl

The Torrent client that cares ❀
CSS
8
star
10

minichess

A serverless Discord bot to play 5x5 chess using buttons.
JavaScript
7
star
11

DisQR

Authenticate to Discord using their QR sign-in
Swift
5
star
12

OpenDiscord

An open source faithful recreation of the Discord client and API.
4
star
13

ts

Leah's TypeScript Boilerplate
TypeScript
3
star
14

benchup

V
3
star
15

vlang.io

Website rewrite for vlang
HTML
3
star
16

EPIC

EPIC: A simple x86 kernel written in C++
Assembly
3
star
17

Cask

A unique Discord bot that lets you create your own commands using JavaScript, from the chatbox.
JavaScript
3
star
18

discord-fluent-emojis

Python
3
star
19

vcs

V Compilation Service
JavaScript
2
star
20

thonkheck

JavaScript
2
star
21

react

My React boilerplate for 2019, using the new fancy hooks and eveything.
JavaScript
2
star
22

noshi

Shell written in NodeJS, GNU purists around the world hate it!
2
star
23

lunalang

C++
2
star
24

vplt

Plotting library for V
V
2
star
25

devRantronWeb

The website for tahnik/devRantron.
HTML
2
star
26

leahlundqvist

2
star
27

Rekrypt

Bad encryption module.
JavaScript
1
star
28

Notifyrant

A Notifyer For devRant
HTML
1
star
29

node-sql-rs

A Neon based brige for the Rust sqlparser-rs
Rust
1
star
30

dvy

A decentralised video library platform, built on IPFS.
TypeScript
1
star
31

ezselect

jQuary like selection but none of the bloat.
JavaScript
1
star
32

EaSSRy

Easy Server-Side Rendering for NodeJS
JavaScript
1
star
33

THOT

THOT, The hottest bot in town.
JavaScript
1
star
34

THOTBot

THOTBot, The hottest bot in town, now in purple!
JavaScript
1
star
35

keylock

Lock stuff with keys.
JavaScript
1
star
36

ts-react

TypeScript React Boilerplate
TypeScript
1
star
37

rekauth

An open source token based authentication system for PHP
PHP
1
star
38

docker-reverse-proxy

An SSH, HTTP and HTTPS reverse proxy for Docker containers
TypeScript
1
star
39

flippo

TypeScript
1
star
40

redux-boilerplate

A neat and simple boilerplate for React, Redux, React Router and Webpack.
JavaScript
1
star
41

rayen

A simple raycast rendering engine in JavaScript.
JavaScript
1
star