#web #wasm #yew #framework #ssr

stellation-bridge

The framework experience for Yew

3 releases

0.1.4 Jan 16, 2023
0.1.3 Jan 15, 2023
0.1.1 Jan 15, 2023

#560 in WebAssembly

48 downloads per month
Used in 3 crates

MIT/Apache

31KB
744 lines

Stellation

A framework experience for Yew.

Stellation provides a development stack with:

  1. Tooling around Server-side Rendering Support.
  2. An easy-to-use, SSR-transparent RPC Implementation.
  3. A development server that automatically rebuild upon changes.
  4. A single binary distribution with embedded frontend.

Quickstart Guide

  1. Install required tools

    Stellation uses the following tools:

    • Trunk
    • cargo-generate
    • cargo-make

They can be installed with cargo install trunk cargo-generate cargo-make

  1. Create project

    Run cargo generate futursolo/stellation-templates and follow the prompt.

  2. Start development server

    Run cargo make --quiet start in the project directory.

    (This may take a couple minutes when the project is building for the first time.)


lib.rs:

Bridge between the frontend and backend.

This module is a RPC implementation that facilitates communications between frontend and backend.

It supports the following types:

Bridge has 2 connection methods local and remote. When the resolvable feature is enabled, bridges will be conntected with the local method and can process requests with resolvers. This can be used for server-side rendering and processing requests from a bridge connected with the remote method. If the resolvable feature is disabled, it will send the request to the bridge endpoint which will process the bridge at the server-side. This is usually used for client-side rendering.

When the resolvable feature is enabled, it will require query and mutations to implement their resolver type which is responsible for resolving the request.

You can check out the example for how to implement resolvers.

Dependencies

~11–18MB
~314K SLoC