use fission::prelude::*;
#[derive(Clone)]
pub struct HomePageHero;
impl From<HomePageHero> for Widget {
fn from(component: HomePageHero) -> Self {
Column {
gap: Some(20.0),
children: vec![
Text::new("Build production apps in Rust")
.size(56.0)
.weight(FontWeight::Bold)
.into(),
Text::new("macOS, Windows, Linux, Web, Android, iOS, Terminal, Static site, and SSR targets share one application model.")
.size(20.0)
.into(),
],
..Default::default()
}
.into()
}
}
use anyhow::Result;
use fission::prelude::*;
use fission::site::{build_from_cli, FissionSite};
#[derive(Default)]
struct SiteState;
impl GlobalState for SiteState {}
fn site_app() -> FissionSite {
FissionSite::new().route_widget::<SiteState, _>(
"/",
"My Product",
Some("A fast, crawlable product site built with Fission.".to_string()),
HomePageHero,
)
}
fn main() -> Result<()> {
build_from_cli(site_app())
}
[site]
css_files = ["site/overrides.css"]
asset_dirs = ["static"]
Symptom | What to check first |
|---|---|
The app compiles but nothing changes | Confirm the component is actually used by the route or shell target you are running. |
An action fires but state does not update | Confirm the reducer is registered with the same action value that the UI dispatches. |
A platform feature reports unsupported | Confirm the target has the capability in fission.toml and the shell registered the provider. |
The page works on one target but not another | Run fission doctor, then inspect target-specific configuration and feature flags. |
Tests are hard to write | Split the product rule into a reducer test first, then add a UI or shell smoke test for the integration. |
Page behavior | Static custom page? | Better target if not |
|---|---|---|
Hero, feature cards, pricing, docs links | Yes | Static site |
Search dialog over generated index | Yes | Static site with search enabled |
Account dashboard with user-specific data | No | Server-rendered route or web app |
Cart drawer with local state | Maybe | WASM island inside a server page |
Live editor or canvas-heavy UI | No | Web target |
fission site check --project-dir . --release
fission site build --project-dir . --release