Ripple Fullstack (rijs)

0.9.1 · active · verified Sun Apr 19

rijs (Ripple Fullstack) is a JavaScript framework designed for building realtime, full-stack applications with a focus on simplicity and efficiency. It aims to eliminate boilerplate, complex build pipelines, and excessive transpilation by streaming fine-grained resources directly to clients, enabling lazy loading and preventing over-fetching. The current stable version is 0.9.1. Ripple synchronizes client and server states by replicating an immutable log of actions, with views or other modules reactively updating when the local store changes. Key differentiators include its no-bundling approach, automatic client/server synchronization, and a minimal API for resource management. It promotes a component-based architecture where components are idempotent render functions and can declare their data dependencies for reactive updates. Ripple's core acts as a module map, efficiently resolving resources from a local cache or making new requests. The project appears to have a consistent, though not extremely rapid, release cadence with several notable changes between minor versions, indicating ongoing active development.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart sets up a basic `rijs` server, serves an `index.html` page, and defines a client-side component that displays data reactively loaded from a `rijs` resource.

const ripple = require('rijs')({ port: 3000, dir: __dirname });
const path = require('path');
const fs = require('fs');

// Create a pages directory if it doesn't exist
const pagesDir = path.join(__dirname, 'pages');
if (!fs.existsSync(pagesDir)) {
  fs.mkdirSync(pagesDir);
}

// Create an index.html file
const indexPath = path.join(pagesDir, 'index.html');
fs.writeFileSync(indexPath, `
  <!DOCTYPE html>
  <html>
  <head>
    <title>Ripple App</title>
  </head>
  <body>
    <h1>Welcome to Ripple!</h1>
    <my-app data="greeting"></my-app>
    <script src="/ripple.js"></script>
  </body>
  </html>
`);

// Create a resources directory if it doesn't exist
const resourcesDir = path.join(__dirname, 'resources');
if (!fs.existsSync(resourcesDir)) {
  fs.mkdirSync(resourcesDir);
}

// Define a simple component
const componentPath = path.join(resourcesDir, 'my-app.js');
fs.writeFileSync(componentPath, `
  export default (node, { greeting = 'Default Greeting' }) => {
    node.innerHTML = `<h2>Component says: ${greeting}</h2>`;
  };
`);

// Define a data resource
const dataPath = path.join(resourcesDir, 'greeting.js');
fs.writeFileSync(dataPath, `
  export default 'Hello from Ripple Data!';
`);

console.log('Ripple server starting on http://localhost:3000');
console.log('Open your browser to http://localhost:3000/pages/index.html');

view raw JSON →