Giter Club home page Giter Club logo

maho's Introduction

Maho

A framework for building server-rendered or static websites, powered by React and esbuild.

This framework is not production-ready yet, since esbuild itself is not mature enough, (but evanw is working on that).

maho

Each rebuild is a full bundle (both server-side and client-side) yet takes only <100ms.

Differences to Vite / Snowpack

They all use esbuild too but:

  • Maho can also do server-side rendering
  • Maho uses esbuild for the whole bundle process instead of only using it to compile TypeScript, FYI they use Rollup in production build which is still much slower than esbuild.
  • Maho is a React framework, Vue integration will be done in another framework: Ream, and the progress totally depends on my funding status.

Install

yarn add maho

Usage

This basic usage is very similar to Next.js.

You can create new project with create-maho-app.

# For npm
npx create-maho-app my-app

# For yarn
yarn create maho-app my-app

# For pnpm
pnpx create-maho-app my-app

Roadmap

Nested routes and dynamic routes

Work in Progress.

Server-side data fetching

Work in Progress.

export const load = async () => {
  const posts = await getPosts()
  return {
    posts
  }
}

export default () => {
  const { posts } = useData()

  return <div>
    {posts.map(post => <div key={post.id}>{post.title}</div>)}
  </div>
}

Code splitting

๐Ÿšง upstream: esbuild: only work with esm format

CSS support

๐Ÿšง upstream: esbuild

Though directly importing CSS in your JavaScript / TypeScript code is not yet supported, you can use CSS-in-JS solutions like emotion without any configuration, alternatively you can have CSS files in ./public folder and reference them using <link> tag in your components.

Hot reloading

Currently it supports live reload.

License

MIT ยฉ EGOIST (Kevin Titor)

maho's People

Contributors

egoist avatar

Watchers

James Cloos 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.