Giter Club home page Giter Club logo

marz's Introduction


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

marz's People

Contributors

hex2f avatar intincrab avatar sorrycc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.