2
0
Fork 0
mirror of https://github.com/leptos-rs/leptos synced 2025-02-02 23:13:25 +00:00
leptos/examples
2025-01-17 12:16:05 -05:00
..
action-form-error-handling fix: update to wasm-bindgen 0.2.93 () 2024-08-13 15:21:57 -07:00
axum_js_ssr chore: work around wasm-bindgen breakage () 2025-01-17 12:16:05 -05:00
cargo-make feat: Add Compression to Hacker News w/ Islands Example () 2024-06-28 15:01:05 -04:00
counter chore(ci): suppress warnings about unused code in example tests () 2024-11-04 13:08:50 -05:00
counter_isomorphic perf: make LeptosOptions lighter-weight to clone (closes ) () 2024-10-20 20:05:29 -04:00
counter_url_query fix: fix web-sys warnings in server_fn () 2024-08-13 15:46:34 -07:00
counter_without_macros chore(ci): suppress warnings about unused code in example tests () 2024-11-04 13:08:50 -05:00
counters chore(ci): suppress warnings about unused code in example tests () 2024-11-04 13:08:50 -05:00
directives chore(ci): suppress warnings about unused code in example tests () 2024-11-04 13:08:50 -05:00
error_boundary chore: upgrade dependencies () 2024-08-10 20:01:41 -04:00
errors_axum feat: Option<T> read-like traits & deprecate MaybeSignal () 2024-10-25 13:41:26 -04:00
fetch chore: upgrade dependencies () 2024-08-10 20:01:41 -04:00
hackernews feat: add OptionalParamSegment (closes ) () 2024-10-21 21:15:14 -04:00
hackernews_axum feat: add OptionalParamSegment (closes ) () 2024-10-21 21:15:14 -04:00
hackernews_islands_axum change: rename from experimental-islands to islands () 2024-11-16 11:06:18 -08:00
hackernews_js_fetch feat: add OptionalParamSegment (closes ) () 2024-10-21 21:15:14 -04:00
islands change: rename from experimental-islands to islands () 2024-11-16 11:06:18 -08:00
islands_router change: rename from experimental-islands to islands () 2024-11-16 11:06:18 -08:00
js-framework-benchmark fix: update import of tick in test examples 2024-10-01 20:05:22 -04:00
parent_child fix: fix web-sys warnings in server_fn () 2024-08-13 15:46:34 -07:00
portal chore(ci): suppress warnings about unused code in example tests () 2024-11-04 13:08:50 -05:00
router feat: use View Transition API for router animations () 2024-10-19 15:41:20 -04:00
server_fns_axum Migrate rkyv 0.8.x () 2024-10-02 10:03:20 -07:00
slots feat: Option<T> read-like traits & deprecate MaybeSignal () 2024-10-25 13:41:26 -04:00
spread examples: porting to 0.7 and cleaning up 2024-08-01 19:42:20 -04:00
ssr_modes perf: make LeptosOptions lighter-weight to clone (closes ) () 2024-10-20 20:05:29 -04:00
ssr_modes_axum chore: fix leptos_dom reexports (closes ) () 2024-10-27 21:12:41 -04:00
static_routing chore: fix leptos_dom reexports (closes ) () 2024-10-27 21:12:41 -04:00
stores chore: remove log 2024-10-28 20:17:23 -04:00
suspense_tests test: aria-current end-to-end tests () 2024-11-17 14:40:47 +13:00
tailwind_actix feat: improve tailwind config to also catch dynamic classes () 2024-10-25 14:06:19 -04:00
tailwind_axum feat: improve tailwind config to also catch dynamic classes () 2024-10-25 14:06:19 -04:00
tailwind_csr feat: improve tailwind config to also catch dynamic classes () 2024-10-25 14:06:19 -04:00
timer feat: Option<T> read-like traits & deprecate MaybeSignal () 2024-10-25 13:41:26 -04:00
todo_app_sqlite perf: make LeptosOptions lighter-weight to clone (closes ) () 2024-10-20 20:05:29 -04:00
todo_app_sqlite_axum fix: update to wasm-bindgen 0.2.93 () 2024-08-13 15:21:57 -07:00
todo_app_sqlite_csr Remove unused shell() function definition () 2024-11-19 12:17:45 -08:00
todomvc Two-way data binding () 2024-10-01 09:39:45 -07:00
Makefile.toml projects: add sitemap demo project () 2024-05-06 08:46:49 -04:00
README.md feat: allow spreading of both attributes and event handlers () 2024-04-05 14:30:34 -04:00
SSR_NOTES.md doc(examples): reference run instructions () 2023-09-13 19:57:50 -04:00

Examples README

Main Branch

The examples in this directory are all built and tested against the current main branch.

To the extent that new features have been released or breaking changes have been made since the previous release, the examples are compatible with the main branch and not the current release.

Getting Started

The simplest way to get started with any example is to use the “quick start” command found in the README for each example. Most of the examples use either trunk (a simple build system and dev server for client-side-rendered apps) or cargo-leptos (a build system for server-rendered and client-hydrated apps).

Using Cargo Make

You can also run any of the examples using cargo-make. Note that this is completely optional. We use it for CI, and it can be convenient for running the examples, but is not required.

Follow these steps to get any example up and running.

  1. cd to the example you want to run
  2. Make sure cargo-make is installed (for example by running cargo install cargo-make)
  3. Make sure rustup target add wasm32-unknown-unknown was executed for the currently selected toolchain.
  4. Run cargo make ci to setup and test the example
  5. Run cargo make start to run the example
  6. Open the client URL in the console output (http://127.0.0.1:8080 or http://127.0.0.1:3000 by default)
  7. Run cargo make stop to end any processes started by cargo make start.

Here are a few additional notes:

  • Extendable custom task files are located in the cargo-make directory
  • Running a task will automatically install cargo dependencies
  • Each Makefile.toml file must extend the cargo-make/main.toml file
  • cargo-make files that end in *-test.toml configure web testing strategies
  • Run cargo make test-report to learn which examples have web tests

Prerequisites

Example projects depend on the following tools. Please install them as needed.

  • Rust
  • Nightly Rust
    • Run rustup toolchain install nightly
    • Run rustup target add wasm32-unknown-unknown
  • Cargo Make
    • Run cargo install --force cargo-make
    • Setup a command alias like alias cm='cargo make' to reduce typing (Optional)
  • Trunk
    • Run cargo install trunk
  • Node Version Manager (Optional)
  • Node.js
  • pnpm (Optional)