mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
ed61ea9dd2
* fix: add support for placing attributes on server functions Adding instrumentation to server functions is not straightforward (requires calling out to another ssr-only function which is instrumented). This commit adds all attributes on the server function to both the generated front end and back end functions. If those attributes are only desirable on the backend say, a user can always wrap their attribute in `#[cfg_attr(feature = "ssr", ..)]`. * nit: formatting in example cargo |
||
---|---|---|
.. | ||
animated_show | ||
cargo-make | ||
counter | ||
counter_isomorphic | ||
counter_url_query | ||
counter_without_macros | ||
counters | ||
counters_stable | ||
directives | ||
error_boundary | ||
errors_axum | ||
fetch | ||
gtk | ||
hackernews | ||
hackernews_axum | ||
hackernews_islands_axum | ||
hackernews_js_fetch | ||
js-framework-benchmark | ||
login_with_token_csr_only | ||
parent_child | ||
portal | ||
router | ||
session_auth_axum | ||
slots | ||
ssr_modes | ||
ssr_modes_axum | ||
suspense_tests | ||
tailwind_actix | ||
tailwind_axum | ||
tailwind_csr | ||
timer | ||
todo_app_sqlite | ||
todo_app_sqlite_axum | ||
todo_app_sqlite_csr | ||
todo_app_sqlite_viz | ||
todomvc | ||
Makefile.toml | ||
README.md | ||
SSR_NOTES.md |
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 but not the current release.
To see the examples as they were at the time of the 0.5.0
release, click here.
Cargo Make
Cargo Make is used to build, test, and run examples.
Here are the highlights.
- 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
Getting Started
Follow these steps to get any example up and running.
cd
to the example root directory- Run
cargo make ci
to setup and test the example - Run
cargo make start
to run the example - Open the client URL in the console output (http://127.0.0.1:8080 or http://127.0.0.1:3000 by default)
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
- Run
- Cargo Make
- Run
cargo install --force cargo-make
- Setup a command alias like
alias cm='cargo make'
to reduce typing (Optional)
- Run
- Trunk
- Run
cargo install trunk
- Run
- Node Version Manager (Optional)
- Node.js
- pnpm (Optional)