Skip to content

IgorNadj/rsf-zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSF Zero

A minimal micro-framework with React Server Functions support.

Installation

yarn add rsf-zero
# or
pnpm add rsf-zero
# or
npm install rsf-zero

Then follow setup.

Quick intro to Server Functions

React Server Functions allow you to mark functions to run on the server:

'use server';

// Server function
export const addComment = async (comment: Comment) => {
  await db.comment.create(comment);
}
import { addComment } from './addComment.ts';

export const AddCommentButton = (comment: Comment) =>
  <Button onClick={() => addComment(comment)} />

More examples

See /example/src/App.tsx.

Reference Docs

Motivation

RSF Zero is designed to be a dead simple micro-framework.

Read the blog post for the motivation behind it.

🕊 Minimal: Add whatever you want on top, nothing bundled that you don't use
🕊 Simple: Add 'use server' to run something on the server, and you're done, nothing new to learn
🕊️ Done: Instead, spend your spare time sipping a tea or looking at a nice bird

About

RSF Zero

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors