Compare commits

..

690 Commits

Author SHA1 Message Date
Greg Johnston
2abb56a9fc chore: clippy 2024-07-24 09:22:20 -04:00
Greg Johnston
ca0c2a6280 example: use a local signal for the input 2024-07-24 09:20:09 -04:00
Greg Johnston
50026be1ae feat: mark branches in AnyView 2024-07-24 09:15:54 -04:00
Greg Johnston
d6e7f44a6a chore: clippy 2024-07-24 09:09:03 -04:00
Greg Johnston
b77559af51 chore: remove unused imports 2024-07-24 09:07:43 -04:00
Greg Johnston
8ce42747fd fix: improve type inference for the default threadsafe signal case 2024-07-24 09:06:27 -04:00
Greg Johnston
8245324989 chore: clippy 2024-07-24 08:15:32 -04:00
Greg Johnston
8f75eca6a6 fix: add missing imports 2024-07-24 08:14:31 -04:00
Greg Johnston
8a22e33d3c docs: fix cfg for docsrs 2024-07-24 07:56:57 -04:00
Greg Johnston
98f849e28e chore: remove unnecessary default generics 2024-07-24 07:56:57 -04:00
Greg Johnston
cf765549fb chore: clippy and fmt 2024-07-24 07:56:57 -04:00
Saber Haj Rabiee
48ded323a8 fix: hackernews_js_fetch example for leptos_0.7 (#2678) 2024-07-24 07:56:57 -04:00
Greg Johnston
acbd96059b feat: allow !Send signals 2024-07-24 07:56:57 -04:00
Greg Johnston
01755bbd82 fix: rename nightly feature for const generic &'static str (d0c11bf6e3\#diff-7b65e42e2b87910c94950caf7f0687fda2f9f98f311099404f5c4afb4a36e50c) 2024-07-24 07:56:57 -04:00
Greg Johnston
75e681a977 chore: remove pub field in Suspend so that Suspend::new() must be used 2024-07-24 07:56:57 -04:00
Greg Johnston
835d4a3e64 chore: fmt 2024-07-24 07:56:57 -04:00
Greg Johnston
90ea25aee1 fix: only create Future once initially, and poll it twice, rather than creating it twice 2024-07-24 07:56:57 -04:00
Greg Johnston
505f192e6a chore: fmt 2024-07-24 07:56:57 -04:00
Greg Johnston
8b0943be06 feat: optional branch-marking in HTML to support initial work on client-side islands routing 2024-07-24 07:56:57 -04:00
Corvus
845447e0ce feat: reintroduce queue_microtask (#2703) 2024-07-24 07:56:57 -04:00
Greg Johnston
78601d69ae fix: allow one-element tuples for route matching 2024-07-24 07:56:57 -04:00
Greg Johnston
a40c591039 example: use path! macro in router example 2024-07-24 07:56:57 -04:00
Greg Johnston
decec8c580 fix: add HTML global on___ attributes 2024-07-24 07:56:57 -04:00
boyswan
e4749dc1a9 feat: add path! macro in router to parse string paths into tuples (#2694) 2024-07-24 07:56:57 -04:00
mahmoud-eltahawy
74112f0690 feat: allow using enums for StaticSegment by implementing AsPath (#2685) 2024-07-24 07:56:57 -04:00
Greg Johnston
0e5a3a4317 fix: set None observer properly in ScopedFuture 2024-07-24 07:56:57 -04:00
Greg Johnston
e0640f92dd fix: remove unnecessary untrack in Show 2024-07-24 07:56:57 -04:00
Greg Johnston
c6a209c0d5 fix: Suspend::new() in router 2024-07-24 07:56:57 -04:00
Greg Johnston
eda56e2758 examples: update to Suspend::new() 2024-07-24 07:56:57 -04:00
Greg Johnston
35a88ee9e4 docs: improved warning location 2024-07-24 07:56:56 -04:00
Greg Johnston
adb7adacd7 fix: require Suspend::new() to ensure the Future is properly scoped at creation time, not at render time 2024-07-24 07:56:56 -04:00
Greg Johnston
22762ecf85 fix: explicitly untrack the children of <Show/> 2024-07-24 07:56:56 -04:00
Greg Johnston
093723ce2e fix: custom elements should support any attribute names 2024-07-24 07:56:56 -04:00
Greg Johnston
71c94d53bf fix: custom elements SSR 2024-07-24 07:56:56 -04:00
Greg Johnston
b88e4637e9 docs: add tachys docs 2024-07-24 07:56:56 -04:00
Greg Johnston
a4fca5bef1 chore: start with a default sandbox, to avoid panics in tests 2024-07-24 07:56:56 -04:00
Greg Johnston
0b87451ab2 docs: finish reactive graph docs for 0.7 2024-07-24 07:56:56 -04:00
Greg Johnston
523786cd4d docs: porting docs from 0.6 to 0.7 2024-07-24 07:56:56 -04:00
Greg Johnston
3e2f69e6a8 chore: remove unused AsyncState 2024-07-24 07:56:56 -04:00
Bruno De Simone
afbc5be655 add allow too_many_arguments (#2684) 2024-07-24 07:56:56 -04:00
Greg Johnston
d937739f26 chore: clippy 2024-07-24 07:56:56 -04:00
Greg Johnston
7bdba127c0 chore: clippy 2024-07-24 07:56:56 -04:00
Greg Johnston
b1724cc336 chore: clear warnings 2024-07-24 07:56:56 -04:00
Greg Johnston
7ca9b485e5 feat: Suspend on style: and class: 2024-07-24 07:56:56 -04:00
Greg Johnston
a25994612f fix: proper building of paths for nested fields 2024-07-24 07:56:56 -04:00
Greg Johnston
6a1732def4 feat: type-erased store Field structs 2024-07-24 07:56:56 -04:00
Greg Johnston
d07579f278 fix: allow creating resources inside Suspense 2024-07-24 07:56:56 -04:00
Greg Johnston
9a58c639ca examples: revert changes to counter 2024-07-24 07:56:56 -04:00
Bruno De Simone
da9b26fd90 remove FromRef implementation from LeptosRoutes axum impl (#2670) 2024-07-24 07:56:56 -04:00
luoxiaozero
7d5f7d3d05 feat: additional ARIA attributes (#2677) 2024-07-24 07:56:56 -04:00
Greg Johnston
d1a71ef1df feat: iteration over reactive store list 2024-07-24 07:56:56 -04:00
Greg Johnston
f517276b2e feat: add arena-allocated/Copy Store 2024-07-24 07:56:56 -04:00
Greg Johnston
44b4268e6a docs: initial work on porting docs from 0.6 to 0.7 2024-07-24 07:56:56 -04:00
Greg Johnston
6923f52d12 feat: initial work on reactive stores 2024-07-24 07:56:56 -04:00
Greg Johnston
59a3c5538e fix: improved API for unsync actions that doesn't require SendWrapper on input 2024-07-24 07:56:56 -04:00
Greg Johnston
3f4a897e60 chore: leptosfmt 2024-07-24 07:56:56 -04:00
Greg Johnston
6355126fd7 fix: properly handle errors in streaming body responses 2024-07-24 07:56:56 -04:00
Greg Johnston
596cd72303 fix: invalid p/ul relationship causing hydration issue 2024-07-24 07:56:56 -04:00
Saber Haj Rabiee
2cac35b910 chore: cargo fmt (#2672) 2024-07-24 07:56:56 -04:00
Greg Johnston
f92520ce98 feat: use codee for shared ser-de codexes with leptos-use (and more possibilities in future) 2024-07-24 07:56:56 -04:00
Greg Johnston
ecc4e588eb chore: remove unused dependencies 2024-07-24 07:56:56 -04:00
Greg Johnston
4289470059 fix: was disposing of Suspense Owner too early 2024-07-24 07:56:56 -04:00
Greg Johnston
60eb68a856 fix: rebuilding NodeRef 2024-07-24 07:56:56 -04:00
Greg Johnston
a0f5ea2189 feat: top-level Suspend without Suspense 2024-07-24 07:56:56 -04:00
Greg Johnston
67bebf385f chore: clippy and clean up unused functions 2024-07-24 07:56:56 -04:00
Greg Johnston
56af98c19f docs: update syntax for Html/Body 2024-07-24 07:56:56 -04:00
Greg Johnston
21101ce44d feat: correct HTML rendering for spread attributes on <Body/> and <Html/> 2024-07-24 07:56:56 -04:00
Greg Johnston
f11163f904 feat: attributes on body and html 2024-07-24 07:56:56 -04:00
Greg Johnston
a36467c117 feat: move to a channel-based implementation for meta 2024-07-24 07:56:56 -04:00
Greg Johnston
2d39922156 feat: support Suspend in attributes 2024-07-24 07:56:56 -04:00
Greg Johnston
ee2d1fb4d3 feat: local resources with .await 2024-07-24 07:56:56 -04:00
Greg Johnston
105b2d088f chore: cfg warnings 2024-07-24 07:56:56 -04:00
Greg Johnston
48c83890a8 fix: MaybeProp None case 2024-07-24 07:56:56 -04:00
Greg Johnston
2699ec2120 reexport SVG and MathML element types 2024-07-24 07:56:56 -04:00
Greg Johnston
390e917ca4 router alpha 3 2024-07-24 07:56:56 -04:00
Greg Johnston
114c1c1cba Form component in 0.7 2024-07-24 07:56:56 -04:00
Greg Johnston
d8c5e67866 fix: don't break Routes SSR now that it uses Suspend 2024-07-24 07:56:56 -04:00
Alicia Garcia-Raboso
fc368f6767 Implement Default trait for signals with a parameter that also implements Default (#2662)
Co-authored-by: alicia.garcia.raboso <alicia.garcia.raboso@bbva.com>
2024-07-24 07:56:56 -04:00
Greg Johnston
63860a1b26 feat: automatically replace Suspense blocks if they are still waiting to be flushed, without JS (replaces PartiallyBlocked) 2024-07-24 07:56:56 -04:00
Greg Johnston
c7f9eb8be2 blocking resources 2024-07-24 07:56:56 -04:00
Greg Johnston
367852a8dc macro alpha 2 2024-07-24 07:56:56 -04:00
Greg Johnston
1792836113 router alpha 2 2024-07-24 07:56:56 -04:00
Luke Naylor
dbd38f1004 Add missing 'form' attribute for <mo> (#2660)
This attribute seems to be missing in the attribute
table on Mozilla Docs, however does appear in the
compatibility table lower down.
This attribute is also frequently used by temml,
a common generator for mathml content.
2024-07-24 07:56:56 -04:00
Greg Johnston
a402a260a9 allow Outlet to be called multiple times 2024-07-24 07:56:56 -04:00
Greg Johnston
b3ba7cf12f fix: prevent panicking if conditionally rendering Outlet 2024-07-24 07:56:56 -04:00
Greg Johnston
0d60051845 remove log 2024-07-24 07:56:56 -04:00
Greg Johnston
df8ca27875 fix: ensure correct ownership chain when passing views through Outlet 2024-07-24 07:56:56 -04:00
Greg Johnston
637bf25317 chore: clippy 2024-07-24 07:56:56 -04:00
Greg Johnston
7cced5d011 support MaybeSignal in view 2024-07-24 07:56:56 -04:00
Kajetan Welc
154f43f3d6 fix: impl Copy for Callback (#2658) 2024-07-24 07:56:56 -04:00
Greg Johnston
e632c8981a fix: update imports and methods 2024-07-24 07:56:56 -04:00
Greg Johnston
1c9428dd2c fix: trait import 2024-07-24 07:56:56 -04:00
Greg Johnston
90dd481e94 impl From<T> for (Arc)Signal<T> 2024-07-24 07:56:56 -04:00
Greg Johnston
9c717ab035 Revert "lazy Future construction for AsyncDerived"
This reverts commit 9e84e1f57c.
2024-07-24 07:56:56 -04:00
Greg Johnston
08f933bcd8 fix: <option> struct generation 2024-07-24 07:56:56 -04:00
Greg Johnston
ffcd0cd27e fix: <option> struct generation 2024-07-24 07:56:56 -04:00
Lucas Åström
d4a0110871 Destructuring let (0.7) (#2655)
* Use `let()` syntax for bindings

This lets users use destructuring when binding more complex values, and we also get better IDE support.

* Update rstml
2024-07-24 07:56:56 -04:00
Greg Johnston
503271e833 fix: nonexistent feature 2024-07-24 07:56:56 -04:00
Greg Johnston
cdb43831b9 fix: rebuilding AnyView 2024-07-24 07:56:56 -04:00
Greg Johnston
e1e7703ec1 support wasm-only 2024-07-24 07:56:56 -04:00
Greg Johnston
d89b64b317 support wasm-only 2024-07-24 07:56:56 -04:00
Greg Johnston
e22f1a721f support wasm-only 2024-07-24 07:56:56 -04:00
Greg Johnston
61c177e7d5 any_spawner tick version 2024-07-24 07:56:56 -04:00
Greg Johnston
2c8454ac60 un-break circular dependency 2024-07-24 07:56:56 -04:00
Greg Johnston
dba780680a chore: update test output 2024-07-24 07:56:56 -04:00
Greg Johnston
5e9218b495 chore: unused import 2024-07-24 07:56:56 -04:00
Greg Johnston
fa679a08a1 restore fallback for compressed version 2024-07-24 07:56:56 -04:00
Greg Johnston
8e68aea7f5 docs: working on memo docs 2024-07-24 07:56:56 -04:00
Greg Johnston
8727642f00 0.7.0-alpha 2024-07-24 07:56:56 -04:00
Greg Johnston
c56b0160ca feat: support reactive and asynchronous ProtectedRoute conditions 2024-07-24 07:56:56 -04:00
Greg Johnston
b6285f6427 fix: correct For behavior when mounting with siblings, and when clearing 2024-07-24 07:56:56 -04:00
Ben Wishovich
868d34f746 Make get_configuration sync (#2647)
* Made get_configuraiton sync

* Update examples
2024-07-24 07:56:56 -04:00
Greg Johnston
da9985bdcd examples: update directives tests 2024-07-24 07:56:55 -04:00
Greg Johnston
250bae1e5a chore: cargo fmt 2024-07-24 07:56:55 -04:00
Greg Johnston
9f9f445031 make RemoveEventHandler a concrete type 2024-07-24 07:56:55 -04:00
Greg Johnston
f9bcaff77e feat: add ElementExt to give access to the same view APIs at runtime that we do at compile time 2024-07-24 07:56:55 -04:00
Greg Johnston
3ca0154e8d feat: add ElementExt to give access to the same view APIs at runtime that we do at compile time 2024-07-24 07:56:55 -04:00
Greg Johnston
4d72ca05b6 chore: cargo fmt 2024-07-24 07:56:55 -04:00
Greg Johnston
879a075129 chore: cargo fmt 2024-07-24 07:56:55 -04:00
Greg Johnston
6be5583633 docs: warn on unused RenderEffect 2024-07-24 07:56:55 -04:00
Greg Johnston
c2381ce983 chore: missing Debug implementations 2024-07-24 07:56:55 -04:00
Greg Johnston
d8ac849cef chore: suppress unnecessary .into() warning 2024-07-24 07:56:55 -04:00
Greg Johnston
8c12d6ec30 cargo fmt 2024-07-24 07:56:55 -04:00
Greg Johnston
dbefaed343 updated directives example 2024-07-24 07:56:55 -04:00
brofrain
a69ec96e75 fix: update HtmlViewState & BodyViewState as well 2024-07-24 07:56:55 -04:00
Kajetan Welc
6f349cf630 fix: do not accidentally mount things before meta tags in the <head> when updating the DOM v2 2024-07-24 07:56:55 -04:00
Greg Johnston
6d0f027d45 remove log 2024-07-24 07:56:55 -04:00
Greg Johnston
ca29be7f08 preliminary work on directives (not useful yet until we have an ElementExt that allows you to do things declaratively from an Element 2024-07-24 07:56:55 -04:00
Greg Johnston
0d7f2c8c2c omit () entirely if it is the only child of an HTML element 2024-07-24 07:56:55 -04:00
Greg Johnston
8067b269bf fix: don't override a text node's 'next sibling after text' position if it's in Either, now that they don't have separate marker nodes 2024-07-24 07:56:55 -04:00
Greg Johnston
cc0198244f fix: do not accidentally mount things before meta tags in the <head> when updating the DOM 2024-07-24 07:56:55 -04:00
Greg Johnston
fbc2461c2c fix docs for hydrate_islands 2024-07-24 07:56:55 -04:00
Greg Johnston
dc03ba0a28 hackernews islands example 2024-07-24 07:56:55 -04:00
Greg Johnston
5787e0c91f update static file serving in Axum examples 2024-07-24 07:56:55 -04:00
Greg Johnston
1e7cf132cb fix islands ci setup 2024-07-24 07:56:55 -04:00
Greg Johnston
6cf69fe08c fix: remove extra comment at end of Suspense now that Either no longer requires it 2024-07-24 07:56:55 -04:00
Greg Johnston
a512fb8be3 feat: provide static file handling/fallback directly in integration 2024-07-24 07:56:55 -04:00
Greg Johnston
91c6c340aa islands example 2024-07-24 07:56:55 -04:00
Greg Johnston
32605f4e96 remove unused tests and dependencies 2024-07-24 07:56:55 -04:00
Greg Johnston
5c956026a0 fix: () in templates 2024-07-24 07:56:55 -04:00
Greg Johnston
d34718ad31 chore: clippy 2024-07-24 07:56:55 -04:00
Greg Johnston
092822d318 fix js-framework-benchmark for stable 2024-07-24 07:56:55 -04:00
Greg Johnston
9ed1acd906 update hackernews_axum to 0.7 2024-07-24 07:56:55 -04:00
Greg Johnston
cab828da6f fix ErrorBoundary starting in error state in CSR 2024-07-24 07:56:55 -04:00
Greg Johnston
3ae26d4aef fix example tests 2024-07-24 07:56:55 -04:00
Greg Johnston
d737ab62c6 remove unnecessary logs 2024-07-24 07:56:55 -04:00
Greg Johnston
b77e640f58 update islands example 2024-07-24 07:56:55 -04:00
Greg Johnston
242ef36f87 chore: unused hooks 2024-07-24 07:56:55 -04:00
Greg Johnston
37e78df9e9 regression test for 7094dee150 2024-07-24 07:56:55 -04:00
Greg Johnston
03330336aa fix: signals mark subscribers dirty, but don't say they're always dirty if they haven't changed 2024-07-24 07:56:55 -04:00
Greg Johnston
8c0a5107f7 make Routes fallback run lazily 2024-07-24 07:56:55 -04:00
Greg Johnston
e7cc1b7f49 make ErrorBoundary fallback run lazily 2024-07-24 07:56:55 -04:00
Greg Johnston
0beb620aba examples: errors_axum 2024-07-24 07:56:55 -04:00
Greg Johnston
2cd576ebd3 chore(ci): fix examples 2024-07-24 07:56:55 -04:00
Greg Johnston
58ac7cdf77 enable reactive-graph hydration when hydration is enabled 2024-07-24 07:56:55 -04:00
Greg Johnston
fcb5d63e47 allow conversion directly from Arc signal types to MaybeSignal 2024-07-24 07:56:55 -04:00
Greg Johnston
c306a40d3b expose Owner::shared_context() 2024-07-24 07:56:55 -04:00
Greg Johnston
c32b21329a 0.7 Provider component 2024-07-24 07:56:55 -04:00
Greg Johnston
bca905e617 fix tests 2024-07-24 07:56:55 -04:00
Greg Johnston
27ee65a7e8 fix reactive styles 2024-07-24 07:56:55 -04:00
Greg Johnston
8640b36b8e fix: correctly rebuild reactive attributes to avoid stale signals 2024-07-24 07:56:55 -04:00
Greg Johnston
77b6255f3c type-erase RenderEffeect functions for binary size improvements 2024-07-24 07:56:55 -04:00
luoxiaozero
f00b8e02c6 feat: Attr exposes PhantomData field (#2641) 2024-07-24 07:56:55 -04:00
Greg Johnston
20ce0f543e chore(ci): remove warnings in tests 2024-07-24 07:56:55 -04:00
Greg Johnston
d40e8ac297 feat: 0.7 query signals 2024-07-24 07:56:55 -04:00
Greg Johnston
f6e83698de chore(ci): add Makefiles for smaller packages 2024-07-24 07:56:55 -04:00
Greg Johnston
a93212c533 chore(ci): only run semver checks if not labeled 'breaking' 2024-07-24 07:56:55 -04:00
Greg Johnston
8e107b042e chore: clippy 2024-07-24 07:56:55 -04:00
Greg Johnston
05dded3f48 rename from new_serde to new 2024-07-24 07:56:55 -04:00
Greg Johnston
153f9af497 remove most remaining marker/placeholder elements 2024-07-24 07:56:55 -04:00
Greg Johnston
1c3c161a1b add trait impls and encodings for SharedValue 2024-07-24 07:56:55 -04:00
Greg Johnston
a91eab4f5b default to SerdeJson encoding for resources, use new_str() for Str encoding 2024-07-24 07:56:55 -04:00
Greg Johnston
255fa85925 feat: synchronous serialized values with SharedValue 2024-07-24 07:56:55 -04:00
Greg Johnston
da77d0fb36 whenever we create a new root Owner, set it as the current owner, which will make it the default owner (e.g., during SSR) instead of None 2024-07-24 07:56:55 -04:00
Greg Johnston
0e360b7e00 fix: can't memoize JS properties, because they can be set between signal updates by user input 2024-07-24 07:56:55 -04:00
Greg Johnston
404de33fb3 fix: correctly escape style and class attributes 2024-07-24 07:56:55 -04:00
Greg Johnston
6712656738 chore: clippy 2024-07-24 07:56:55 -04:00
Greg Johnston
38bb187735 don't require spawn_local for actios 2024-07-24 07:56:55 -04:00
Greg Johnston
f57f0831b8 catch resource reads inside Signal during Suspense 2024-07-24 07:56:55 -04:00
Greg Johnston
1c2b201e1f fix CSS file names 2024-07-24 07:56:55 -04:00
Greg Johnston
2058cee348 update todo app csr 2024-07-24 07:56:55 -04:00
Greg Johnston
140996db6e fix: correctly escape text nodes, except in script/style tags 2024-07-24 07:56:55 -04:00
Greg Johnston
4c9adc7d50 chore: clean up examples for CI 2024-07-24 07:56:55 -04:00
Greg Johnston
196d845b86 fix: provide matched route via context when rebuilding (so <A> works) 2024-07-24 07:56:55 -04:00
Greg Johnston
3dec67a51e unused 2024-07-24 07:56:55 -04:00
Greg Johnston
abe4b39a01 refactor insert_before_this to find parent lazily, and use it for rebuilding reactive components by replacing their whole contents 2024-07-24 07:56:55 -04:00
Greg Johnston
99d8541c83 make sure SendWrapper supports Futures 2024-07-24 07:56:55 -04:00
Greg Johnston
37e5e89c78 move several complex examples into projects 2024-07-24 07:56:55 -04:00
Greg Johnston
5e11ea1753 update js-framework-benchmark example 2024-07-24 07:56:55 -04:00
Greg Johnston
8c54f7b8cf fix test text 2024-07-24 07:56:55 -04:00
Greg Johnston
f6b265ce7f fix: custom Stream implementation for streaming resource data that supports nested data/multiple polled values, rather than taking it all at once at the beginning 2024-07-24 07:56:55 -04:00
Greg Johnston
8b0b24ad72 suspense_tests: actually wait for other resource in nested case 2024-07-24 07:56:55 -04:00
Greg Johnston
69ac71ab04 can save a lookup here 2024-07-24 07:56:55 -04:00
Greg Johnston
7c9ff835e4 remove unused workspace member 2024-07-24 07:56:54 -04:00
Greg Johnston
261856e6f3 update workflows 2024-07-24 07:56:54 -04:00
Greg Johnston
32976b2de4 remove unused leptos_reactive integration 2024-07-24 07:56:54 -04:00
Greg Johnston
508e38d48d remove old router files 2024-07-24 07:56:54 -04:00
Greg Johnston
48d125222a fix Cargo.toml after merge 2024-07-24 07:56:54 -04:00
Greg Johnston
49fb0f681c re-enable all routes 2024-07-24 07:56:54 -04:00
Greg Johnston
7737376672 chore: clean up warnings and logging 2024-07-24 07:56:54 -04:00
Greg Johnston
c9091ffcdc reverted Fn()/FnMut() change 2024-07-24 07:56:54 -04:00
Greg Johnston
2e3a976288 Revert "fix: constrain reactive rendering to Fn(), because using dry_resolve() for Suspense requires idempotent render functions so that they can be called once (to register resources) and called a second time to resolve"
This reverts commit 7ec5c77ba3e8f45bae04a7661a56741f95125adb.
2024-07-24 07:56:54 -04:00
Greg Johnston
e044ab3070 progress on updating suspense tests 2024-07-24 07:56:54 -04:00
Greg Johnston
0a5764868f add server redirects 2024-07-24 07:56:54 -04:00
Greg Johnston
bee7a2c13a fix: relative path resolution 2024-07-24 07:56:54 -04:00
Greg Johnston
b3b1f11b1c simplifying todo examples 2024-07-24 07:56:54 -04:00
Greg Johnston
78d0c75ef4 initial work updating suspense tests 2024-07-24 07:56:54 -04:00
Greg Johnston
a53a30dbed clarify hydrate/csr warning 2024-07-24 07:56:54 -04:00
Greg Johnston
10d5bd704e export actions in prelude 2024-07-24 07:56:54 -04:00
Greg Johnston
69da1f2198 remove Into<_> by default for setting signals, because it interferes with type inference 2024-07-24 07:56:54 -04:00
Greg Johnston
5e32da1690 add support for unsync actions 2024-07-24 07:56:54 -04:00
Greg Johnston
a6ad908cae simplifying and updating server fns example 2024-07-24 07:56:54 -04:00
Greg Johnston
d8bf76963f change name to shell 2024-07-24 07:56:54 -04:00
Greg Johnston
78c1ab6546 update control flow components to new Fn() constraint 2024-07-24 07:56:54 -04:00
Greg Johnston
6abd75463e fix: constrain reactive rendering to Fn(), because using dry_resolve() for Suspense requires idempotent render functions so that they can be called once (to register resources) and called a second time to resolve 2024-07-24 07:56:54 -04:00
Greg Johnston
a395fcdb95 add Debug impl 2024-07-24 07:56:54 -04:00
Greg Johnston
56cfb95df8 fix: actually concatenate nested routes during route generation 2024-07-24 07:56:54 -04:00
Greg Johnston
7d323103c5 reorganize Outlet export 2024-07-24 07:56:54 -04:00
Greg Johnston
0bd39a58ec examples: porting to 0.7 and cleaning up 2024-07-24 07:56:54 -04:00
Greg Johnston
d6ba60a9b0 fix merge 2024-07-24 07:56:54 -04:00
Rakshith Ravi
c9cc2a140f Update import statements in examples (#2625) 2024-07-24 07:56:54 -04:00
Greg Johnston
988aadeef2 examples: use application 404 page 2024-07-24 07:56:54 -04:00
Greg Johnston
e3d1daa87b chore: cargo fmt 2024-07-24 07:56:54 -04:00
Greg Johnston
76d7a5f619 chore: cargo fmt 2024-07-24 07:56:54 -04:00
Greg Johnston
a8be8b2ca9 add warnings if correct features not set for browser 2024-07-24 07:56:54 -04:00
Greg Johnston
6f2467de06 use csr feature so that reactivity runs 2024-07-24 07:56:54 -04:00
Greg Johnston
6bcafb49e4 chore: clippy 2024-07-24 07:56:54 -04:00
Greg Johnston
44fa16dde3 examples: fix input type so tests work, and update text to make the purpose clearer 2024-07-24 07:56:54 -04:00
Greg Johnston
64a4e59266 remove leptos_reactive (moved into reactive_graph and leptos_server) 2024-07-24 07:56:54 -04:00
Greg Johnston
722d77b128 fix: Clone for ArcResource and default to SerdeJson for Resource 2024-07-24 07:56:54 -04:00
Greg Johnston
24b3d9988a chore: clippy 2024-07-24 07:56:54 -04:00
Greg Johnston
aac902c349 fix: don't dispose of parent owners before Suspense children have been rendered 2024-07-24 07:56:54 -04:00
Greg Johnston
644081860f warn if trying to use meta on server side without context 2024-07-24 07:56:54 -04:00
Greg Johnston
0f225daa40 only run RenderEffects when effects are enabled 2024-07-24 07:56:54 -04:00
Greg Johnston
933e015d24 add set_pending to <Transition/> 2024-07-24 07:56:54 -04:00
Greg Johnston
11c2ba553f simplify FlatRoutes logic by using existing OwnedView infrastructure 2024-07-24 07:56:54 -04:00
Greg Johnston
43675b7741 reexport tick() for testing 2024-07-24 07:56:54 -04:00
Greg Johnston
c70c9681e3 fix: ensure that leptos_meta and leptos_router are in SSR mode if using one of the server integrations 2024-07-24 07:56:54 -04:00
Greg Johnston
55725ea11e examples: update hackernews for SSR support 2024-07-24 07:56:54 -04:00
Greg Johnston
41dc042ee7 fix: correctly notify multiple subscribers to same AsyncDerived 2024-07-24 07:56:54 -04:00
Greg Johnston
16f66c5e52 fix: Routes SSR 2024-07-24 07:56:54 -04:00
Greg Johnston
6ff7bca5de fix: correct owner for HTML rendering in FlatRoutes 2024-07-24 07:56:54 -04:00
Greg Johnston
1df939d41e testing: provide tick() that can be called anywhere in tests 2024-07-24 07:56:54 -04:00
Greg Johnston
4845cf989f testing: provide tick() that can be called anywhere in tests 2024-07-24 07:56:54 -04:00
Greg Johnston
ffe09346cd fix portal tests 2024-07-24 07:56:54 -04:00
Greg Johnston
b591140291 fix cleanups in render effects 2024-07-24 07:56:54 -04:00
Greg Johnston
d4f35fb41f chore: clippy 2024-07-24 07:56:54 -04:00
Greg Johnston
d343b373c7 update counters_isomorphic 2024-07-24 07:56:54 -04:00
Greg Johnston
b0c3bb9b10 reexport spawn and spawn_local 2024-07-24 07:56:54 -04:00
Greg Johnston
32a8433d0b ReadSignal from stream 2024-07-24 07:56:54 -04:00
Greg Johnston
1571c907b2 refactor to allow rendering Resource directly in view 2024-07-24 07:56:54 -04:00
Greg Johnston
2baccc8615 removed AnimatedShow example (duplicates the component docs) 2024-07-24 07:56:54 -04:00
Greg Johnston
74fa1da243 properly serialize errors 2024-07-24 07:56:54 -04:00
Greg Johnston
ec617214eb chore: clear warning 2024-07-24 07:56:54 -04:00
Greg Johnston
1b351f5139 pick up on server action error in both server and client 2024-07-24 07:56:54 -04:00
Greg Johnston
1682b6a543 fmt and chores in examples 2024-07-24 07:56:54 -04:00
Greg Johnston
8d634c0d35 fix: serialize an empty string into HTML so it still works as a text node 2024-07-24 07:56:54 -04:00
Greg Johnston
0f820152ca fix: make router fallback lazy 2024-07-24 07:56:54 -04:00
Greg Johnston
a270b7c7c3 add expect_context 2024-07-24 07:56:54 -04:00
Greg Johnston
da824e3e38 fix attr:class when spreading onto a component 2024-07-24 07:56:54 -04:00
Greg Johnston
0255b3991b add ServerAction error handling for any error type (closes #2325) 2024-07-24 07:56:54 -04:00
Greg Johnston
9c44e486f6 remove unused import 2024-07-24 07:56:54 -04:00
Greg Johnston
652c153c6b clean up example 2024-07-24 07:56:54 -04:00
Greg Johnston
b7d9dde973 add CollectView 2024-07-24 07:56:54 -04:00
Greg Johnston
92df0fb145 Actix todo_app_sqlite 2024-07-24 07:56:54 -04:00
Greg Johnston
93bb2e1803 fix: don't drop Owner in FlatRoutes until route has been rendered (thanks @benwis) 2024-07-24 07:56:54 -04:00
Greg Johnston
db25d08ba9 fix: make sure all resource reads are registered 2024-07-24 07:56:54 -04:00
Greg Johnston
48dad26797 chore: clippy and unused dependencies in integrations 2024-07-24 07:56:54 -04:00
Greg Johnston
0b29246972 add some tracing and debug info to HTML elements 2024-07-24 07:56:54 -04:00
Greg Johnston
f63811fbda refactor integrations and add Actix integration 2024-07-24 07:56:54 -04:00
Greg Johnston
a78e649a03 feat: 0.7 nonce support 2024-07-24 07:56:54 -04:00
Greg Johnston
7e23c05f77 ResponseOptions support 2024-07-24 07:56:54 -04:00
Greg Johnston
ad36abed67 fix counters tests 2024-07-24 07:56:54 -04:00
Greg Johnston
7aeade70a6 allow .children() on HTML elements 2024-07-24 07:56:54 -04:00
Greg Johnston
471ab8fbe7 remove async demo 2024-07-24 07:56:54 -04:00
Greg Johnston
7ae5b29f47 fix: writing to lock that has a read 2024-07-24 07:56:54 -04:00
Greg Johnston
f12957a6b2 allow untracking on write guards to support maybe_update 2024-07-24 07:56:54 -04:00
Greg Johnston
b3fd881a8f feat: allow .write() on all writeable signals 2024-07-24 07:56:54 -04:00
Greg Johnston
a70cc73c14 feat: add .by_ref() to create a Future from an AsyncDerived (etc.) that takes a reference, rather than cloning 2024-07-24 07:56:54 -04:00
Greg Johnston
097f3c377a use impl trait in props 2024-07-24 07:56:54 -04:00
Greg Johnston
a711531034 update wasm-bindgen testing approaches 2024-07-24 07:56:54 -04:00
Greg Johnston
b5552fc83e chore: clearing warnings in examples 2024-07-24 07:56:54 -04:00
Greg Johnston
947929b827 additional warnings 2024-07-24 07:56:54 -04:00
Greg Johnston
d5027a6b2d cargo fmt 2024-07-24 07:56:54 -04:00
Greg Johnston
ed061ec6a0 chore: clear up... a few warnings 2024-07-24 07:56:54 -04:00
Greg Johnston
d10cca93f8 update sledgehammer integration 2024-07-24 07:56:53 -04:00
Greg Johnston
1103683e7f remove signal function setter Send-only implementation (dead code) 2024-07-24 07:56:53 -04:00
Greg Johnston
42835815ac remove signal function call Read implementations (dead code) 2024-07-24 07:56:53 -04:00
Greg Johnston
f31dafb398 remove leptos_reactive dependency 2024-07-24 07:56:53 -04:00
Greg Johnston
fa8b58992b oco merge issues 2024-07-24 07:56:53 -04:00
Greg Johnston
db11a387e1 feat: return an async guard from .await rather than cloning the value every time 2024-07-24 07:56:53 -04:00
Greg Johnston
fa92cc21e2 fix return type in async tests 2024-07-24 07:56:53 -04:00
Greg Johnston
e2aa2390fc fix tests that run effects 2024-07-24 07:56:53 -04:00
Greg Johnston
541f734341 feat: return Option from AsyncDerived.get() instead of AsyncState 2024-07-24 07:56:53 -04:00
Greg Johnston
5ed1f29485 example: restore ErrorBoundary 2024-07-24 07:56:53 -04:00
Greg Johnston
aa88a54b74 docs for Owner and context 2024-07-24 07:56:53 -04:00
Greg Johnston
c2d91e78e7 fix tests 2024-07-24 07:56:53 -04:00
Greg Johnston
8d7177ef9c poll AsyncDerived synchronously so that it has the correct value during hydration if it reads from a resource 2024-07-24 07:56:53 -04:00
Greg Johnston
61a6f64b90 correct dirty-checking on AsyncDerived 2024-07-24 07:56:53 -04:00
Greg Johnston
f735ae8d5e fix regular suspense if nothing was read synchronously 2024-07-24 07:56:53 -04:00
Greg Johnston
341840f958 missing dry_resolve on Static 2024-07-24 07:56:53 -04:00
Greg Johnston
3d2e971a93 feat: support *either* .await or reactive reads inside Suspense 2024-07-24 07:56:53 -04:00
Greg Johnston
e245418df8 feat: 0.7 slots 2024-07-24 07:56:53 -04:00
Greg Johnston
d6ab394280 feat: enhanced spreading syntax 2024-07-24 07:56:53 -04:00
Greg Johnston
1f59d98f67 fix external navigations 2024-07-24 07:56:53 -04:00
Greg Johnston
7f4f289fba make WindowListenerHandle Send + Sync so it can be remove via on_cleanup 2024-07-24 07:56:53 -04:00
Greg Johnston
be72416b76 restore ssr/hydration for Routes 2024-07-24 07:56:53 -04:00
Greg Johnston
d878a800ea get nested Routes working again 2024-07-24 07:56:53 -04:00
Greg Johnston
bec7ac8f2e default to Params::get() giving an owned value (which you want in a derived signal), but use reference in the macro 2024-07-24 07:56:53 -04:00
Greg Johnston
5bde17008e add proper dirty checking on AsyncDerived so it can read from memos properly 2024-07-24 07:56:53 -04:00
Greg Johnston
920b340085 make NavigateOptions pub 2024-07-24 07:56:53 -04:00
Greg Johnston
e71e36f70c feat: owning memo 2024-07-24 07:56:53 -04:00
Greg Johnston
a4952b0c78 remove warnings in tests and only run if effects are enabled 2024-07-24 07:56:53 -04:00
Greg Johnston
5fe0e1fa0b fix: prevent memos that have changed from re-triggering the running effect, by setting the Observer during .update_if_necessary() 2024-07-24 07:56:53 -04:00
Greg Johnston
ecb973f74a feat: add Popover API 2024-07-24 07:56:53 -04:00
Greg Johnston
8c1ed5b464 fix Script children 2024-07-24 07:56:53 -04:00
Greg Johnston
0600d7460c fix hydration of Suspend by including the missing placeholder it expects during hydration 2024-07-24 07:56:53 -04:00
Greg Johnston
8fa6fae868 add missing marker comments for Result 2024-07-24 07:56:53 -04:00
Greg Johnston
f98c032aa9 include marker comments in html len 2024-07-24 07:56:53 -04:00
Greg Johnston
281d6841de unused owner 2024-07-24 07:56:53 -04:00
Greg Johnston
fe5943a9f0 impl From/Into for Signal/ArcSignal 2024-07-24 07:56:53 -04:00
Greg Johnston
fbc29586b2 add ArcSignal::derive() 2024-07-24 07:56:53 -04:00
Greg Johnston
e80e9a89ab routing progress indicator 2024-07-24 07:56:53 -04:00
Greg Johnston
66578a94d3 missing min attribute 2024-07-24 07:56:53 -04:00
Greg Johnston
29c6ab1e0b clean up 2024-07-24 07:56:53 -04:00
Greg Johnston
2aa3a1c9d8 remove log 2024-07-24 07:56:53 -04:00
Greg Johnston
94da23184a relax trait bounds on reactive types where possible 2024-07-24 07:56:53 -04:00
Greg Johnston
ed0152d270 add SignalSetter 2024-07-24 07:56:53 -04:00
Greg Johnston
8ea8b0bf47 use transition between navigations 2024-07-24 07:56:53 -04:00
Greg Johnston
b32bcdb0c8 add async transitions that wait for any AsyncDerived created/triggered under them before resolving 2024-07-24 07:56:53 -04:00
Greg Johnston
1a217423dc resolve() on OwnedView 2024-07-24 07:56:53 -04:00
Greg Johnston
0a9a8736ed restore hydration feature for some of its feature-gating benefits for Resource deserialization 2024-07-24 07:56:53 -04:00
Greg Johnston
bd80ea2eb2 cargo fmt 2024-07-24 07:56:53 -04:00
Greg Johnston
c0f6d2fde8 create separate URL/params signals for each route, to prevent updating them and running side effects while navigating away 2024-07-24 07:56:53 -04:00
Greg Johnston
dd3eccae87 fmt 2024-07-24 07:56:53 -04:00
Greg Johnston
7447c0f58e distinguish between dirty and check in effects, so that memos and signals both work correctly 2024-07-24 07:56:53 -04:00
Greg Johnston
2b406e0473 remove unused feature 2024-07-24 07:56:53 -04:00
Greg Johnston
c89ef0de77 updated future impls 2024-07-24 07:56:53 -04:00
Greg Johnston
9f1225b48f check whether ArcAsyncDerived actually needs to run when marked check 2024-07-24 07:56:53 -04:00
Greg Johnston
c0b9d5937b add ancestry debugging for owners 2024-07-24 07:56:53 -04:00
Greg Johnston
682c3cd24c lazy Future construction for AsyncDerived 2024-07-24 07:56:53 -04:00
Greg Johnston
e235b7088d support Resource in CSR for backward-compat 2024-07-24 07:56:53 -04:00
Greg Johnston
a72e1d5c23 allow let: syntax to work 2024-07-24 07:56:53 -04:00
Greg Johnston
6cd82630b7 scope Suspense/Transition correctly within ownership tree 2024-07-24 07:56:53 -04:00
Greg Johnston
056456538e upgrading hackernews example 2024-07-24 07:56:53 -04:00
Greg Johnston
14d664d15b immediately commit URL signal updates 2024-07-24 07:56:53 -04:00
Greg Johnston
fbbbd08e5c reexport A from router::components 2024-07-24 07:56:53 -04:00
Greg Johnston
8bf3f0d8dd add IntoAny to tachys prelude 2024-07-24 07:56:53 -04:00
Greg Johnston
cc0f5096c7 finish support for innerHTML 2024-07-24 07:56:53 -04:00
Greg Johnston
15c11e9a5d feat: iterating over items in children with ChildrenFragment, ChildrenFragmentFn, ChildrenFragmentMut 2024-07-24 07:56:53 -04:00
Greg Johnston
209f8cfc48 only warn about non-reactive accesses if effects are enabled 2024-07-24 07:56:53 -04:00
Greg Johnston
84d6301f71 only run effects on client 2024-07-24 07:56:53 -04:00
Greg Johnston
0792319ae1 resolve() implementation for AnyView 2024-07-24 07:56:53 -04:00
Greg Johnston
4c08d99095 fix deadlock on nested Signals 2024-07-24 07:56:53 -04:00
Greg Johnston
1320470d14 fix FlatRouter SSR/hydration after lazy routes 2024-07-24 07:56:53 -04:00
Greg Johnston
433cf151bb feat: nested islands with context for 0.7 2024-07-24 07:56:53 -04:00
Greg Johnston
7ed3a0d5e6 fix: correct Send + Sync bounds for children 2024-07-24 07:56:53 -04:00
Greg Johnston
21a95fe574 feat: minimal island support in 0.7 2024-07-24 07:56:53 -04:00
Greg Johnston
6ac31c05e1 docs: full docs and doctests for Action/MultiAction 2024-07-24 07:56:53 -04:00
Greg Johnston
452189b49a remove support for rendering guards directly, as they are !Send and holding onto them in State is also a bad idea 2024-07-24 07:56:53 -04:00
Greg Johnston
4ff89d0baa support nightly static values for style:key="value" 2024-07-24 07:56:53 -04:00
Greg Johnston
13692b84f1 revert to using .get() for function calls 2024-07-24 07:56:53 -04:00
Greg Johnston
80597581d7 fix: only rerun effects if they have dirty ancestors (or it's the first run) 2024-07-24 07:56:53 -04:00
Greg Johnston
f3fdc6c9fe start working on porting over docs and tests and 0.7... 2024-07-24 07:56:53 -04:00
Greg Johnston
bf81e3077c fix meta issue with attributes 2024-07-24 07:56:53 -04:00
Greg Johnston
8fbdea92a3 fix tracing issue 2024-07-24 07:56:53 -04:00
Greg Johnston
b75559de8e chore: get tests in a working state 2024-07-24 07:56:53 -04:00
Greg Johnston
f4e0ec865d fix: make Selector Send/Sync 2024-07-24 07:56:53 -04:00
Greg Johnston
ab9a9d6235 docs: runtime warning if you use .track() outside a tracking context 2024-07-24 07:56:53 -04:00
Greg Johnston
75214f3d65 preliminary tracing for tachys 2024-07-24 07:56:53 -04:00
Greg Johnston
a09ca6c999 chore: warnings 2024-07-24 07:56:53 -04:00
Greg Johnston
b497bae682 examples: router in 0.7 2024-07-24 07:56:53 -04:00
Greg Johnston
daf2a77b73 fix: passing context through router 2024-07-24 07:56:53 -04:00
Greg Johnston
98fe3c707c chore: fix warnings about variable case 2024-07-24 07:56:53 -04:00
Greg Johnston
4e2e94f0b1 examples: timer in 0.7 2024-07-24 07:56:53 -04:00
Greg Johnston
9affa1cdc8 feat: Portals in 0.7 2024-07-24 07:56:53 -04:00
Greg Johnston
e878ffbe7b allow either eager or lazy routes 2024-07-24 07:56:53 -04:00
Greg Johnston
9c5ef51cc3 update StoredValue API in callbacks 2024-07-24 07:56:53 -04:00
Greg Johnston
dd86f9502d chore: clippy warnings 2024-07-24 07:56:53 -04:00
Greg Johnston
33046ca84a smooth out StoredValue APIs 2024-07-24 07:56:53 -04:00
Greg Johnston
cd766f82c9 MaybeSignal and MaybeProp 2024-07-24 07:56:53 -04:00
Marc-Stefan Cassola
6620f85307 added a few old deprecated functions to help users port (#2580) 2024-07-24 07:56:53 -04:00
Greg Johnston
40259990d8 implement With(Untracked) for Signal 2024-07-24 07:56:53 -04:00
Greg Johnston
2dc685a1de don't over-rerender nested router 2024-07-24 07:56:53 -04:00
Greg Johnston
0617c2d803 initial async routing work (to support bundle splitting) 2024-07-24 07:56:53 -04:00
Greg Johnston
462ffae95f noop attribute 'spreading' for routers 2024-07-24 07:56:53 -04:00
Greg Johnston
a98cc28c37 support arbitrary attributes on components in view 2024-07-24 07:56:52 -04:00
Greg Johnston
c365e885cd full attribute spreading 2024-07-24 07:56:52 -04:00
Greg Johnston
945222726b update counter_without_macros imports 2024-07-24 07:56:52 -04:00
Greg Johnston
161c968211 stashing 2024-07-24 07:56:52 -04:00
Greg Johnston
c4aa720766 give a route to upgrade any attribute into a cloneable one 2024-07-24 07:56:52 -04:00
Greg Johnston
8616fab88b work on attribute spreading 2024-07-24 07:56:52 -04:00
Greg Johnston
d8bda86f1c disable AddAnyAttr again now that I remember why it was broken 2024-07-24 07:56:52 -04:00
Greg Johnston
0128e0486d reenable AnyAttr 2024-07-24 07:56:52 -04:00
Greg Johnston
2c24fa9b71 reorganizing exports and updating examples 2024-07-24 07:56:52 -04:00
Greg Johnston
3572652db2 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
5db973ded5 fix reorganized exports 2024-07-24 07:56:52 -04:00
Greg Johnston
6d81602b98 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
487676df97 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
a6f052c0e4 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
8addbdb64d module restructuring for 0.7 2024-07-24 07:56:52 -04:00
Greg Johnston
2059435144 let ErrorBoundary own the fallback 2024-07-24 07:56:52 -04:00
Greg Johnston
8d9783a770 make Suspend a transparent wrapper 2024-07-24 07:56:52 -04:00
Greg Johnston
844bad68b8 provide params properly in FlatRouter 2024-07-24 07:56:52 -04:00
Greg Johnston
59120c310d clear some warnings 2024-07-24 07:56:52 -04:00
Greg Johnston
aaa64f5cab rename TupleBuilder to NextTuple and prep for release 2024-07-24 07:56:52 -04:00
Greg Johnston
5ee2544952 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
53ac129e27 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
a46900f56c prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
bdc0ec25f2 prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
ea50d81178 rename any_error 2024-07-24 07:56:52 -04:00
Greg Johnston
58951e499b prep for preview release 2024-07-24 07:56:52 -04:00
Greg Johnston
3f57dab7f1 remove twiggy file 2024-07-24 07:56:52 -04:00
Greg Johnston
b1edf04abb move router crates 2024-07-24 07:56:52 -04:00
Greg Johnston
87ca774d49 comparison demo 2024-07-24 07:56:52 -04:00
Greg Johnston
ad062c0ea3 SSR optimizations for binary size, and flat router 2024-07-24 07:56:52 -04:00
Greg Johnston
499b965305 work on Axum integration and on error boundaries 2024-07-24 07:56:52 -04:00
Greg Johnston
cdd2e06f28 stash 2024-07-24 07:56:52 -04:00
Greg Johnston
aa841cc8ea feat: add <A> 2024-07-24 07:56:52 -04:00
Greg Johnston
060f89c492 add use_navigate and Redirect 2024-07-24 07:56:52 -04:00
Greg Johnston
6268d902d9 preliminary use_navigate work 2024-07-24 07:56:52 -04:00
Greg Johnston
1740ccd329 fix fallback => match update 2024-07-24 07:56:52 -04:00
Greg Johnston
4b44ab47a1 add more hooks and primitives to router 2024-07-24 07:56:52 -04:00
Greg Johnston
247802ab87 nested route CSR working 2024-07-24 07:56:52 -04:00
Greg Johnston
df4be92936 continuing on nested routes 2024-07-24 07:56:52 -04:00
Greg Johnston
3024c54f74 continuing on nested routes 2024-07-24 07:56:52 -04:00
Greg Johnston
8d4501d006 working on reconfiguring nested routing 2024-07-24 07:56:52 -04:00
Greg Johnston
02f256f602 make placeholder-finding code consistent across container types 2024-07-24 07:56:52 -04:00
Greg Johnston
018b212f70 remove logs 2024-07-24 07:56:52 -04:00
Greg Johnston
762ed8685b fix Transition hydration 2024-07-24 07:56:52 -04:00
Greg Johnston
ee2c192b99 remove TryCatch/fallible rendering in favor of better ErrorBoundary model 2024-07-24 07:56:52 -04:00
Greg Johnston
c4e5ba3a61 finish todo_app_sqlite_axum 2024-07-24 07:56:52 -04:00
Greg Johnston
b326f0f4e0 fix Vec hydration 2024-07-24 07:56:52 -04:00
Greg Johnston
5ce5ec3cac add MultiActionForm 2024-07-24 07:56:52 -04:00
Greg Johnston
eda794a1ff add MultiAction/ServerMultiAction 2024-07-24 07:56:52 -04:00
Greg Johnston
fe646d7f6a stash 2024-07-24 07:56:52 -04:00
Greg Johnston
26ec393537 ErrorBoundary SSR and serialization of errors to support hydration 2024-07-24 07:56:52 -04:00
Greg Johnston
e9ab1c0b03 get types working with nested ErrorBoundary/Suspense 2024-07-24 07:56:52 -04:00
Greg Johnston
126a1ebbe9 probably as far as I can go with the current SuspenseBoundary approach 2024-07-24 07:56:52 -04:00
Greg Johnston
9024cec3eb fix static types 2024-07-24 07:56:52 -04:00
Greg Johnston
28bce5d2a6 fix cancellation logic for server fn requests 2024-07-24 07:56:52 -04:00
Greg Johnston
7b7a82a8f1 only subscribe to memo manually if already loaded 2024-07-24 07:56:52 -04:00
Greg Johnston
8d3b737303 Suspense SSR 2024-07-24 07:56:52 -04:00
Greg Johnston
7a5e56df15 updates toward todo_app_sqlite 2024-07-24 07:56:52 -04:00
Greg Johnston
7d3715b480 fix stable examples 2024-07-24 07:56:52 -04:00
Greg Johnston
14b9e76e57 implement rendering traits for signals directly on stable 2024-07-24 07:56:52 -04:00
Greg Johnston
309f373601 suspend!() macro 2024-07-24 07:56:52 -04:00
Greg Johnston
d22f347bbb add Transition 2024-07-24 07:56:52 -04:00
Greg Johnston
fc23614d99 loosen requirements for Show 2024-07-24 07:56:52 -04:00
Greg Johnston
f2f43c1237 working on examples 2024-07-24 07:56:52 -04:00
Greg Johnston
6f71e9d6d6 finish TodoMVC example 2024-07-24 07:56:52 -04:00
Greg Johnston
8317e7edaa simplify Suspense: this should still work with hydration 2024-07-24 07:56:52 -04:00
Greg Johnston
5eae11d1ca working model for Suspense with new version 2024-07-24 07:56:52 -04:00
Greg Johnston
5a0954a61a probably as far as I can go with the current SuspenseBoundary approach 2024-07-24 07:56:52 -04:00
Greg Johnston
d94b29cd05 fix ErrorBoundary/Suspense 2024-07-24 07:56:52 -04:00
Greg Johnston
b79a5422aa feat: ErrorBoundary and Suspense 2024-07-24 07:56:52 -04:00
Greg Johnston
6923eed5fd feat: ErrorBoundary 2024-07-24 07:56:52 -04:00
Greg Johnston
21e21e4f35 fix Cargo.toml merge issues 2024-07-24 07:56:52 -04:00
Greg Johnston
e6973deded working on examples 2024-07-24 07:56:52 -04:00
Greg Johnston
6f63cf7a52 styling with CSS 2024-07-24 07:56:52 -04:00
Greg Johnston
f2c16314be example with isomorphic GTK/web design system 2024-07-24 07:56:52 -04:00
Greg Johnston
e9c649477e gtk example 2024-07-24 07:56:52 -04:00
Greg Johnston
2bb30ef6ed ErrorBoundary component 2024-07-24 07:56:52 -04:00
Greg Johnston
537764d82e Suspense/Transition components 2024-07-24 07:56:52 -04:00
Greg Johnston
c64affe458 GTK example for 0.7 2024-07-24 07:56:51 -04:00
Greg Johnston
488b87bcbf add serde-wasm-bindgen encoding for resources 2024-07-24 07:56:51 -04:00
Greg Johnston
555438c747 add typed children 2024-07-24 07:56:51 -04:00
Greg Johnston
cc04773d5f scope Arena to each request 2024-07-24 07:56:51 -04:00
Greg Johnston
f55f634f95 correctly omit HTML-generating code from AnyView 2024-07-24 07:56:51 -04:00
Greg Johnston
58cd2f92d7 experimental sledgehammer Renderer backend 2024-07-24 07:56:51 -04:00
Greg Johnston
67217aa693 fix async context issues, add flat routing 2024-07-24 07:56:51 -04:00
Greg Johnston
c015695462 test more dynamic string length work 2024-07-24 07:56:51 -04:00
Greg Johnston
1eaa6b6b0b attribute value escaping 2024-07-24 07:56:51 -04:00
Greg Johnston
92f76e9177 work related to 0.7 blog port 2024-07-24 07:56:51 -04:00
Greg Johnston
2a4eb9b484 work related to 0.7 blog port 2024-07-24 07:56:51 -04:00
Greg Johnston
0d5f60c7f2 completing work on meta 2024-07-24 07:56:51 -04:00
Greg Johnston
3be3d72f25 completing work on meta 2024-07-24 07:56:51 -04:00
Greg Johnston
b824f59176 initial work on meta 2024-07-24 07:56:51 -04:00
Greg Johnston
b3a799c6dd initial work on meta 2024-07-24 07:56:51 -04:00
Greg Johnston
2dc462bc8b stash 2024-07-24 07:56:51 -04:00
Greg Johnston
971c57c963 fix nested route rebuilding 2024-07-24 07:56:51 -04:00
Greg Johnston
1f2c9780c2 navigation between nested routes 2024-07-24 07:56:51 -04:00
Greg Johnston
346556082d initial stage for working nested route rendering 2024-07-24 07:56:51 -04:00
Greg Johnston
6a249bd29f stash 2024-07-24 07:56:51 -04:00
Greg Johnston
48c1bca429 stash 2024-07-24 07:56:51 -04:00
Greg Johnston
ee5c5d6f4c get basic routing working 2024-07-24 07:56:51 -04:00
Greg Johnston
2a2f129e40 stash 2024-07-24 07:56:51 -04:00
Greg Johnston
ea09fb253a reorganize 2024-07-24 07:56:51 -04:00
Greg Johnston
ade6f1b7bc working on nesting routing 2024-07-24 07:56:51 -04:00
Greg Johnston
2be7f8d06c reorganize 2024-07-24 07:56:51 -04:00
Greg Johnston
cdfb98adf6 stash 2024-07-24 07:56:51 -04:00
Greg Johnston
b9d37a4571 abstract interface to walk nested routes and to access views 2024-07-24 07:56:51 -04:00
Greg Johnston
0e5dce6d0f reorganize and clean up 2024-07-24 07:56:51 -04:00
Greg Johnston
2ff4e1ea8f nested route matching 2024-07-24 07:56:51 -04:00
Greg Johnston
beff818216 stash 2024-07-24 07:56:51 -04:00
Greg Johnston
ba15a96fe7 stash 2024-07-24 07:56:51 -04:00
Greg Johnston
4c67fb854c work on routing utils 2024-07-24 07:56:51 -04:00
Greg Johnston
1416385fc0 nested route matching working 2024-07-24 07:56:51 -04:00
Greg Johnston
643d2c443b stash 2024-07-24 07:56:51 -04:00
Greg Johnston
1c0aabddd0 use either_of crate 2024-07-24 07:56:51 -04:00
Greg Johnston
a8aaa57e7c nested routes take 1 2024-07-24 07:56:51 -04:00
Greg Johnston
c37f67f858 split EitherOfX into its own crate 2024-07-24 07:56:51 -04:00
Greg Johnston
22f6d9b733 work on routing 2024-07-24 07:56:51 -04:00
Greg Johnston
320848895f work on routing 2024-07-24 07:56:51 -04:00
Greg Johnston
a061102ee4 set up routing 2024-07-24 07:56:51 -04:00
Greg Johnston
10b04c7bae clear warning 2024-07-24 07:56:51 -04:00
Greg Johnston
afbc5de1ad chore: clear warnings 2024-07-24 07:56:51 -04:00
Greg Johnston
7542ca3905 pass on: to components (and lay basis for passing all other attributes) 2024-07-24 07:56:51 -04:00
Greg Johnston
eac71a2c1a working on AddAttr 2024-07-24 07:56:51 -04:00
Greg Johnston
26d7c131a0 remove boilerplate: require that Node, Element, etc. types always be Clone + 'static 2024-07-24 07:56:51 -04:00
Greg Johnston
21e981ab58 parent_child example 2024-07-24 07:56:51 -04:00
Greg Johnston
63de8b321f use AnyError for all try_ rendering errors, so that they can compose 2024-07-24 07:56:51 -04:00
Greg Johnston
71beb92d0e support for guards with class: syntax 2024-07-24 07:56:51 -04:00
Greg Johnston
0ceb6d539a add Borrow implementation to make it easier to abstract over T and Guard<T> 2024-07-24 07:56:51 -04:00
Greg Johnston
343f9299d2 finish error boundary (fix last state transition issue) 2024-07-24 07:56:51 -04:00
Greg Johnston
ce6d751368 progress on error boundary that works with nested reactivity 2024-07-24 07:56:51 -04:00
Greg Johnston
cdcd860608 progress on error boundary that works with nested reactivity 2024-07-24 07:56:51 -04:00
Greg Johnston
7b47457209 error example 2024-07-24 07:56:51 -04:00
Greg Johnston
886411a7b0 enable event delegation 2024-07-24 07:56:51 -04:00
Greg Johnston
8773d57ef0 fix release build 2024-07-24 07:56:51 -04:00
Greg Johnston
8c06c2b62b update TODO.md 2024-07-24 07:56:51 -04:00
Greg Johnston
cf4b0747dc store effects in reactive system 2024-07-24 07:56:51 -04:00
Greg Johnston
80d1ef0e58 todomvc example 2024-07-24 07:56:51 -04:00
Greg Johnston
c69e97bfaf work on async demo 2024-07-24 07:56:51 -04:00
Greg Johnston
a891a7a09e clone values for Futures 2024-07-24 07:56:51 -04:00
Greg Johnston
093e41fc3d make guard types more nestable/flexible so that we can implement render traits on any of them 2024-07-24 07:56:51 -04:00
Greg Johnston
0e8bc744b2 work on async demo 2024-07-24 07:56:51 -04:00
Greg Johnston
557b99426f work on async demo 2024-07-24 07:56:51 -04:00
Greg Johnston
9b0b5138d5 feat: create generic any_spawner crate to share between reactive system and renderer 2024-07-24 07:56:51 -04:00
Greg Johnston
97e4be6f85 add other methods on Stored 2024-07-24 07:56:51 -04:00
Greg Johnston
fb700feffb work on async demo 2024-07-24 07:56:51 -04:00
Greg Johnston
b8f7960f6a stash: working on jsfb 2024-07-24 07:56:51 -04:00
Greg Johnston
d71d39f8ed chore: remove unnecessary log 2024-07-24 07:56:51 -04:00
Greg Johnston
88e1ea9b6b fix: correct owner for rows of For, correct cleanup of arenas 2024-07-24 07:56:51 -04:00
Greg Johnston
5587c5e8b8 fix: close memory leak in tasks waiting on channels 2024-07-24 07:56:51 -04:00
Greg Johnston
be725cb27e feat: typed event targets 2024-07-24 07:56:51 -04:00
Greg Johnston
167474ee55 working on examples 2024-07-24 07:56:51 -04:00
Greg Johnston
ba88bdd082 begin migrating to leptos and leptos_dom packages 2024-07-24 07:56:51 -04:00
Greg Johnston
eee18f8b43 stash 2024-07-24 07:56:51 -04:00
Greg Johnston
ccc01e590f stash 2024-07-24 07:56:18 -04:00
Greg Johnston
a8ea282271 chore: remove leptos_reactive and add reactive_graph 2024-07-24 07:56:18 -04:00
Greg Johnston
5c2f0df4b7 feat: improved ergonomics of read guards 2024-07-24 07:56:18 -04:00
Greg Johnston
46151c4b9f feat: add Readable implementation for all types 2024-07-24 07:56:18 -04:00
Greg Johnston
0fc1692337 feat: add no_std support in appropriate crates 2024-07-24 07:56:18 -04:00
Greg Johnston
511db7ec16 feat: tachys 2024-07-24 07:56:18 -04:00
Greg Johnston
28404e7ee4 feat: add Fn traits 2024-07-24 07:56:18 -04:00
Greg Johnston
e1bb490fa0 docs: note re: execution order (see #2261 and #2262) 2024-07-24 07:56:18 -04:00
Greg Johnston
f6b41535cf feat: modular SharedContext for hydration 2024-07-24 07:56:18 -04:00
Greg Johnston
611ee4c74c chore: split OrPoisoned trait into its own crate for reuse 2024-07-24 07:56:18 -04:00
Greg Johnston
a22242cf53 feat: modular, trait-based, Send/Sync reactive system 2024-07-24 07:56:18 -04:00
Ar4ys
7e75801f7c fix: move lint rules outside of quote_spanned (closes #2527) (#2709) 2024-07-24 07:54:46 -04:00
Dreo
0763a81cf1 fix: remove unnecessary 'static lifetime from argument in function Style::as_value_string() (#2683) 2024-07-12 11:53:48 -04:00
Dreo
3d37f08539 add impl IntoStyle for Style (#2682) 2024-07-12 11:13:29 -04:00
Oleg Shatov
b3db094618 chore: remove cfg-related warnings (#2654) 2024-07-03 06:49:32 -04:00
Oleg Shatov
0c817d51fe fix: accurately update number of pending action dispatches (closes #2652) (#2653) 2024-07-03 06:48:02 -04:00
Chris
fb5d8513ff docs: generate link to definition (#2656) 2024-07-03 06:46:02 -04:00
David Karrick
c53fc67d38 feat: Add Compression to Hacker News w/ Islands Example (#2613)
* Add task for cargo leptos w/ precompression

* Update makefile

* Update deps

* Serve precompressed assets

Code was taken from https://github.com/leptos-rs/cargo-leptos/pull/165#issuecomment-1647843037

Co-authored-by: Sebastian Dobe <sebastiandobe@mailbox.org>

* Dynamically compress html

* Update README

* Refactor: Format for ci

* Refactor: Replace use of format!

* Chore: Remove old build file

* Feat: Hash files

This will prevent users from using an old cached file after updates are made

* Fix: Prevent chicken & egg problem with target/site

* Refactor: Use normal cargo-leptos

---------

Co-authored-by: Sebastian Dobe <sebastiandobe@mailbox.org>
2024-06-28 15:01:05 -04:00
Greg Johnston
ff0c8252b0 fix: do not unescape / and other route characters when following a link (#2651) 2024-06-28 14:29:05 -04:00
Evan Almloff
551f9b0a04 feat: add a StreamingJson encoding (#2623) 2024-06-28 11:49:26 -04:00
Greg Johnston
44cd3272f9 Merge pull request #2639 from Giovanni-Tably/dispose-fix
fix: ensure everything is disposed of consistently
2024-06-28 11:30:31 -04:00
Vasily Zorin
73a9797ef9 book_ru: SUMMARY.md (#2648)
* book_ru: SUMMARY.md

* book_ru: SUMMARY.md

* book_ru: SUMMARY.md
2024-06-27 06:46:36 -07:00
Spencer Ferris
57a00a33a3 docs: Add docs for ToChildren (#2643)
* docs: Add docs for `ToChildren`

As discussed in https://github.com/leptos-rs/leptos/discussions/2640,
the `ToChildren` trait is useful to consumers who want to use the
builder syntax. However, because it is currently annotated with
`#[docs(hidden)]`, it's not visible in docs and also not included in
Jetbrains's auto-complete.

Add a doc comment for the `ToChildren` trait, including doc tests that
demonstrate how to use the trait and how it compares to directly
creating children.

* docs: Fix incorrect examples in `ToChildren` docs

Some examples were added to `ToChildren` that don't compile. This
wasn't caught earlier because no errors were seen in the IDE when
writing the examples. The issue was correctly caught by CI, however.
2024-06-26 14:57:40 -07:00
Adrian
5f445cdfbf Translating titles of sections in SUMMARY (#2542) 2024-06-26 14:56:59 -07:00
Hamir Mahal
c9d0ef5033 chore: simplify string interpolation (#2626) 2024-06-21 07:51:38 -04:00
Giovanni
af85623a22 test: add regression tests 2024-06-20 19:37:08 +01:00
Giovanni
40ecc2bd78 fix: dispose of watch effect normally 2024-06-20 15:36:03 +01:00
Giovanni
41a18a1218 fix: clean up recursively in dispose_node 2024-06-20 15:26:55 +01:00
Giovanni
739d1b2e3e refactor: split a couple of functions 2024-06-20 15:26:37 +01:00
Giovanni
9e6996a59f fix: untrack around all on_cleanups 2024-06-20 15:26:37 +01:00
Giovanni
cca3f1f42d refactor: rename cleanup_property -> dispose_property
The property and its node are removed entirely, so it's more aligned with `dispose_node` than `cleanup_node`.
2024-06-20 15:26:37 +01:00
Greg Johnston
80bbb20089 Merge pull request #2631 from leptos-rs/2610
fix `rkyv` feature interaction with Axum integration
2024-06-14 15:10:26 -04:00
Greg Johnston
33e7ed83cc fix: specify correct serialization trait in server fn handler (closes #2610) 2024-06-14 14:20:50 -04:00
Greg Johnston
dcaa1df63d fix: derive rkyv traits on ServerFnError 2024-06-14 14:19:54 -04:00
Oto Petřík
8606f3d928 fix: try_with should not panic on disposed resources (closes #2620) (#2621) 2024-06-12 20:19:44 -04:00
Thomas Versteeg
32e6ac7bb7 docs: remove duplicated code block in example of For (#2622) 2024-06-12 20:11:57 -04:00
ARSON
b22f3bb3bd fix: extract dyn_bindings impl into DynBindings trait (#2619) 2024-06-12 09:07:56 -04:00
Greg Johnston
00a42daa63 Merge pull request #2611 from leptos-rs/failing-ci
Fix failing CI
2024-06-02 15:39:58 -04:00
Greg Johnston
ec19c59850 chore: update hackernews_js_fetch example to latest versions of leptos and axum 2024-06-02 15:39:01 -04:00
Greg Johnston
b06097d085 chore(ci): fix wasm-pack installation 2024-06-02 15:38:22 -04:00
Greg Johnston
a59561f796 chore: clippy 2024-06-02 15:37:54 -04:00
Greg Johnston
96b448805d v0.6.12 2024-06-02 14:08:08 -04:00
Luxalpa
2ef27cb0bb fix: URL encoding issue (closes #2602) (#2601) 2024-06-02 14:06:41 -04:00
SleeplessOne1917
21a6551ce6 feat: allow slice! macro to index tuples (#2598)
* Allow slice! macro to index tuples

* Undo changes to component tests

---------

Co-authored-by: Greg Johnston <greg.johnston@gmail.com>
2024-05-29 09:07:41 -04:00
Mingwei Samuel
2f4fd87c05 feat: #[component] now handles impl Trait by converting to generic type params, fix #2274 (#2599)
Book needs to be updated to remove this line:
35c380ffc8/src/view/03_components.md (L233)
2024-05-29 09:06:52 -04:00
Hecatron
13ad1b235d projects: example using the bevy 3d game engine and leptos (#2577)
* feat: Added example using the bevy 3d game engine and leptos

* fix: moved example to projects

* workspace fix
2024-05-27 15:55:27 -04:00
David Pitoniak
a2c7e23d54 docs: grammar typo for MultiActon doc comment (#2589) 2024-05-11 15:05:35 -04:00
Greg Johnston
9e65f71db4 fix: only issue NodeRef warning in debug mode (necessary to compile in --release) (#2587) 2024-05-11 15:05:17 -04:00
Luxalpa
7f4a2926c1 fix: StoredValue and Resource borrowMut error during dispose (#2583) 2024-05-11 15:04:57 -04:00
Hecatron
7c5203db19 examples: counter with DWARF debugging (breakpoints and sourcemap) (#2563)
* feat: Added initial dwarf debug counter example

* fix: update to readme and launch.json, task.json

* fix: fix tasks.json for debugging

* fix: added Trunk.toml to fix the port

* fix: moved example to projects
2024-05-11 15:02:33 -04:00
Greg Johnston
3760ced0ec fix: allow temporaries as props (closes #2541) (#2582) 2024-05-08 19:35:57 -04:00
Greg Johnston
f3f3a053ba fix: don't insert empty child for comment/doctype (closes #2549) (#2581) 2024-05-08 07:19:57 -04:00
Antoine Büsch
6a8e4bb453 Fix empty_docs warnings in #[component] macro (#2574) 2024-05-06 22:09:19 -04:00
Luxalpa
20f4323e50 feat: allow customize derives for serverfn input struct (#2545) 2024-05-06 08:54:29 -04:00
martin frances
47bcee0ef4 docs: improve NodeRef warning (#2414) (#2467) 2024-05-06 08:51:32 -04:00
SleeplessOne1917
ac3b95d35a examples: use trunk's built-in way of handling tailwind (#2557)
* Use trunk built-in way of handling tailwind

* Remove package manager from package.json
2024-05-06 08:49:07 -04:00
Greg Johnston
a314a4fcd9 docs: clarify the purpose of local resources (#2543) 2024-05-06 08:48:29 -04:00
Sam Judelson
b2a77f06b9 projects: OpenAPI Utopia (#2556) 2024-05-06 08:48:09 -04:00
Sam Judelson
9741c41356 projects: added an index to projects README (#2555)
The Index gives a high level overview of the projects
2024-05-06 08:47:13 -04:00
Joey McKenzie
4e4a770600 projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
martin frances
289c02fdac Minor: examples/server_fns_axum FileWatcher logs errors to the console. (#2547)
* Minor: examples/server_fns_axum FileWatcher logs errors to the console.

The cause is an assumption that the directory

./watched_files/

exits.

* chore: Now using .gitkeep to preserve directory structure.
2024-05-06 08:45:27 -04:00
itowlson
123d95c34c Update leptos-spin-macro reference (#2570)
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
2024-05-02 15:25:22 -07:00
Greg Johnston
da9711a743 docs: add caveats for ProtectedRoute (#2558) 2024-05-01 07:06:54 -04:00
Greg Johnston
9353316947 chore: create README for projects directory 2024-04-19 10:39:58 -04:00
Sam Judelson
2960dada4a docs: add projects directory with 4 projects (#2500) 2024-04-17 19:30:31 -04:00
kryesh
c1ebaf9d04 feat: add create_query_signal_with_options to leptos_router (#2517) 2024-04-17 19:23:33 -04:00
bicarlsen
9a7dbd50eb feat: ability to use multiple classes in view macro using array syntax. (#2532) 2024-04-17 19:04:33 -04:00
Ethan Niser
410225c4d1 docs: remove unnecessary type parameter and trait bound in component macro 'bad' example (#2520) 2024-04-17 18:53:18 -04:00
ARSON
8b1c0a7013 feat: spread component attrs (#2534)
* add `dyn_bindings` builder method to component

* Revert "add `dyn_bindings` builder method to component"

This reverts commit cdd5e0f682.

* add `dyn_bindings` builder method to component
2024-04-17 14:05:00 -07:00
0e4ef622
6e819737cd fix: make TextProp's IntoView and IntoAttribute impls reactive (#2518) 2024-04-17 14:02:52 -07:00
Adrian
c4560b7e76 Adding Russian book branch (#2516) 2024-04-17 13:22:32 -07:00
Greg Johnston
0d20f6aca8 chore: publish Oco separately as oco_ref crate so that it can be used elsewhere (#2536) 2024-04-16 20:25:34 -04:00
martin frances
158b0bd294 chore(ci): bump trunk-action to 0.5. (#2533) 2024-04-16 19:19:01 -04:00
Ben Wishovich
c8186eea13 Add id to ActionForm and MultiActionForm (#2535) 2024-04-16 14:52:51 -07:00
Greg Johnston
6141e73436 Merge pull request #2531 from leptos-rs/2523
fix: do not submit `<ActionForm>` on `formmethod="dialog"` submission (closes #2523)
2024-04-15 19:52:06 -04:00
Greg Johnston
03a56f8795 chore(ci): latest nightly 2024-04-15 18:33:06 -04:00
Greg Johnston
fe06c6b91b fix: do not submit <ActionForm> on formmethod="dialog" submission (closes #2523) 2024-04-15 16:49:02 -04:00
martin frances
9a51fb17fc Minor: Bumped serde_qs to 0.13. (#2512) 2024-04-14 14:39:44 -07:00
Sam Judelson
35a8ca1f39 Add beginner tip to ErrorBoundary (#2385)
* Add beginner tip to ErrorBoundary

This might seem simple, but the nuances of types and traits confuse many people learning the language.

* edit

* Update error_boundary.rs

* edits

* ignore error block
2024-04-14 14:38:08 -07:00
Ben Wishovich
1ff0a7176d Update spin_sdk to spin v3 (#2525)
* Update spin_sdk to spin v3

* Add id to Body
2024-04-14 14:34:38 -07:00
Greg Johnston
e29d31e686 0.6.11 2024-04-10 09:33:22 -04:00
Greg Johnston
e68f1bbad5 fix: stable Router IDs (closes #2514) (#2515) 2024-04-10 09:31:34 -04:00
Greg Johnston
454a4f4ccb Merge pull request #2511 from leptos-rs/simplify-stable
Simplify stable syntax in examples
2024-04-09 15:30:51 -04:00
Greg Johnston
85a91af7c6 examples: simplify stable syntax for using signals in view 2024-04-09 14:45:19 -04:00
Greg Johnston
871d2c1b9f feat: directly implement IntoView on resources on stable 2024-04-09 14:45:01 -04:00
Greg Johnston
f0c1061161 chore(ci): remove nightly feature on counter_isomorphic (#2510) 2024-04-09 13:18:37 -04:00
Greg Johnston
d74af819a0 fix: invalid Location header when using leptos_actix::redirect() without JS/WASM (#2507) 2024-04-08 20:10:09 -04:00
Ar4ys
36b2f919dd feat: signifiantly improved error reporting in view macro (#2289)
* Added name span to .build in component_to_tokens

* Added #[allow(unreachable_code)] to  leptos::component_view inside component_to_tokens

* Added span to name reference in component_to_tokens

* Added span to leptos::component_props_builder in component_to_tokens

* Added span to props in component_to_tokens

* Added span to "on" method in events component_to_tokens

* Added spans in directive_call_from_attribute_node

* Added spans in fragment_to_tokens and it's ssr version

* Added span to props in slot_to_tokens

* Added span to the whole slot quote

* Changed slots's name span to last slot node

* Added span to the slot vec

* Added #[allow(unreachable_code)] to `.into()` in slot_to_tokens

* Added span to `.build()` in slot_to_tokens

* Added span for the whole component

* Added span to "clone:" directive

* Added span to ".children()"

* Removed unused "_span" param from fragment_to_tokens and fragment_to_tokens_ssr

* Removed unnecessary parenthesis around values in `attribute_to_tokens`

* Removed unnecessary curly braces around value in `spread_attrs`

* Removed unnecessary parenthesis around children in `element_to_tokens`

* Added catch-all span to element_to_tokens

* Formatted `quote!` according to official guidelines

* Updated view/snapshots in leptos_macro

* Added span to spread props in element_to_tokens_ssr

* Removed unnecessary curly braces in element_to_token_ssr

* Updated view/snapshots in leptos_macro

* Added view macro tests to leptos_macro

* Fixed clippy warnings in view macro output

* Updated view snapshots in tests

* Fixed expected_one_let_bind_got_none test in leptos_macro

* Removed snapshot tests in leptos_macro/tests/ui/view

---------

Co-authored-by: Greg Johnston <greg.johnston@gmail.com>
2024-04-08 08:14:33 -04:00
Greg Johnston
ab1c4ca7a6 chore(ci): run all examples under stable and fix remaining linting issue (#2503) 2024-04-05 16:09:23 -04:00
mahmoud-eltahawy
a1a989011a chore(ci): move all examples to run on stable (#2501) 2024-04-05 14:57:48 -04:00
Greg Johnston
43178b56dc chore(ci): move example CI over to stable (#2502) 2024-04-05 14:55:31 -04:00
Lukas Potthast
119c9ea23f feat: allow spreading of both attributes and event handlers (#2432) 2024-04-05 14:30:34 -04:00
Yann Dirson
fc537c14c4 feat: implement IntoView for Rc<str> (#2462)
With-help-from: Greg Johnston <greg.johnston@gmail.com>
Signed-off-by: Yann Dirson <ydirson@free.fr>
2024-04-05 09:58:35 -04:00
mahmoud-eltahawy
15f8bdd4dc stable todo_app_sqlite_axum example (#2493) 2024-04-04 20:12:45 -07:00
Sam Judelson
ca07d29db5 stable examples change (#2497) 2024-04-04 20:11:28 -07:00
Adrian
a82af6110f ex: counter_url_query; to stable (#2499) 2024-04-04 20:09:55 -07:00
Joseph Cruz
03ac6903f2 ci(examples/error-boundary): use stable syntax (#2496) 2024-04-04 20:08:50 -07:00
Joseph Cruz
e5af1456a6 fix(ci): false leptos changes detected (#2491) 2024-04-04 20:06:09 -07:00
mahmoud-eltahawy
8686d5aabb stable todomvc example (#2489) 2024-04-02 13:38:07 -07:00
Greg Johnston
c750f57ddc v0.6.10 2024-04-02 09:39:53 -04:00
Joseph Cruz
cc1f6f0a94 chore(ci): run semver checks on push (#2483) 2024-04-01 20:38:28 -04:00
Greg Johnston
a9034a92b0 fix: handle directives properly in SSR mode (closes #2488) (#2477) 2024-04-01 17:29:30 -04:00
zakstucke
9f1c09e131 feat: add View::on support for CoreComponent::{DynChild, Each} (#2422) 2024-04-01 17:09:05 -04:00
Greg Johnston
b79037b96f fix: correctly handle empty view! {} in hot-reloading code (closes #2421) (#2478) 2024-04-01 16:23:29 -04:00
Greg Johnston
41f3c46830 chore: bump nightly version in examples (#2479) 2024-04-01 15:16:53 -04:00
Greg Johnston
bfac4cba2a chore: cargo fmt 2024-03-31 14:12:33 -04:00
Paolo Barbolini
3e18edb8f9 chore: add repository field to server_fn_macro (#2474) 2024-03-31 14:10:47 -04:00
Joseph Cruz
e926ff24a6 ci: disable semver checks (#2471) 2024-03-30 20:05:20 +00:00
Gunnar Raßmann
d528cbd828 Fix: Environment variables do not overwrite Config.toml options (#2433)
* Fix environment variable parsing

* Fix failing tests

dfgdfgfd

dsf

* Add new test
2024-03-30 00:02:52 +00:00
Alex Lazar
642504f2ba Remove panic for axum ResponseOptions (#2468) 2024-03-29 07:37:12 +00:00
zakstucke
fd2817de26 Allow CDN_PKG_PATH at runtime as well as current build time, preferring it when available. (#2466) 2024-03-28 08:30:54 +00:00
Bart Toersche
73b8c7872e Fix: Small fix for location hash/fragment (#2464) 2024-03-27 06:45:29 +00:00
martin frances
f3d19ca744 Minor: Ran cargo clippy --fix (#2461)
Manually reviewed the changes. All look like reasonable nudges.

A summary :-

In one place removed a redundant call to .clone().

In two places, now using clone_from() which clippy says
**MAY** be an optimisation.
2024-03-23 18:27:31 -07:00
boyswan
0abcc348ca Persist parent span context within resource fetchers (#2456) 2024-03-22 15:51:50 -07:00
Joseph Cruz
572ae5bbdf test(ci): check semver (#2450)
* test(ci): check semver

* chore: simulate change

* fix(ci): add checkout

* fix(ci): version typo

* chore: remove simulated change
2024-03-22 15:51:13 -07:00
martin frances
0b70949118 Bumped base64 to 0.22. (#2457) 2024-03-22 15:07:04 -07:00
martin frances
5819014ccc Chore(ci) bumping tj-actions/changed-files to version 43. (#2454) 2024-03-22 07:23:57 -04:00
Joseph Cruz
630fd4570d fix(ci): trunk command not found (#2453)
* chore: simulate change

* chore: remove print trunk version

* Revert "chore: remove print trunk version"

This reverts commit c203a83b44.

* chore(ci): use jetli/trunk-action

* chore: remove simulated change
2024-03-22 07:23:48 -04:00
Ratul
d1560f9e1f Added missing link for #[server] macro (#2437)
* Added missing link for #[server] macro

Added missing link for #[server] macro

* Removed spurious entry
2024-03-20 14:24:54 -07:00
martin frances
841d7a690a chore: examples/tailwind_axum bumped tailwindcss to 3.4.2. (#2443) 2024-03-19 09:40:24 -07:00
sify21
104c09f3bf register server_fn first to allow for wildcard Route path (#2435)
It's normal to have a `NotFound` page with a wildcard path like this
```
<Routes>
    ...
    <Route path="*any" view=NotFound>
</Routes>
```
In `ssr` mode, most servers do a `first match win` approach, so we
should register server functions before view routes, or else a wildcard
route would block all api requests.

https://discord.com/channels/1031524867910148188/1218508054442545185

Signed-off-by: 司芳源 <sify21@163.com>
2024-03-19 09:37:42 -07:00
Joseph Cruz
ac75999c9f chore(ci): upgrade actions to node 20 (#2444)
* chore(ci): install jq with apt

* chore(ci): install trunk with cargo

* chore(ci): replace toolchain action

* chore(ci): upgrade pnpm cache action

* chore: simulate change

* fix(ci): pnpm cache action typo

* chore: remove simulated change
2024-03-19 09:36:30 -07:00
Richard Laughlin
7ef186f642 For the session_auth_axum example, move the passhash into a separate (#2446)
non-serializable struct.

This prevents it from being returned in the
get_user() API, and prevents it from being unintentionally returned on any
new API the end-user may create on top of this example code.
2024-03-19 09:35:53 -07:00
Joseph Cruz
fda4dba237 build(examples): clean more output (#2420)
* chore(examples): update workspace members

* build(examples): clean e2e crates

* build(examples): clean pkg directories

* chore: remove simulated change comment

* chore: add simulated change

* chore: remove simulated change
2024-03-18 11:58:37 -04:00
Roland Fredenhagen
4e578e335b chore: update attribute-derive (#2438) 2024-03-18 11:39:34 -04:00
Joseph Cruz
97fd8ff6c4 fix(ci): leptos examples fail with bindgen schema error (#2428) 2024-03-13 22:33:54 -04:00
battmdpkq
4faf3fa894 chore: fix types in some comments (#2413)
Signed-off-by: battmdpkq <cmaker@163.com>
2024-03-09 07:38:25 -05:00
Greg Johnston
480d741749 chore: update to gloo-net 0.5 (closes #2411) (#2416) 2024-03-08 15:22:12 -05:00
Álvaro Mondéjar
7928f61401 chore: add lint to disallow prints to stdout (#2404) 2024-03-08 13:18:37 -05:00
Giovanni
2b4f5e0f58 docs: runtime error if setting the same event listener 2x rather than silent failure (#2383)
Delegated event listeners do not support adding more than one event listener of the same type. This can cause confusion if two listeners are added, as one is silently dropped.
2024-03-07 16:49:23 -05:00
Giovanni
943a992570 fix: re-throw errors in delegated event listeners (#2382) 2024-03-07 16:48:21 -05:00
ARSON
372a241d78 feat: allow #[prop(attrs)] on slots (#2396) 2024-03-04 17:34:21 -08:00
Chris Biscardi
c06f6bede2 fix: remove erroneous debug println!()s in islands (#2402) 2024-03-04 06:56:18 -05:00
benwis
3e93a686f4 Fix and release deps 2024-03-03 17:04:34 -08:00
benwis
34cdff4cb3 Update deps in one crate to 0.6.8 2024-03-03 17:02:50 -08:00
John Lewis
530087d77d Add MessagePack codec (#2371)
* feat: added messagepack codec

* fix: deserialize msgpack from bytes, not string
2024-03-03 13:54:23 -08:00
martin frances
4bb43f6207 examples/todomvc - Rename Todos::new() Todos::default(). (#2390) 2024-03-03 13:48:40 -08:00
benwis
9e2fb62857 0.6.8 2024-03-02 18:01:10 -08:00
Ben Wishovich
1da2fff706 Fix missed stuff (#2398) 2024-03-02 17:57:20 -08:00
Greg Johnston
9fd2987447 fix: correctly reset hydration status in islands mode Suspense (closes #2332) (#2393) 2024-03-02 11:57:35 -05:00
zroug
7996f835d0 fix: remove unnecessary trait bound PartialEq from create_owning_memo (#2394) 2024-03-02 07:27:22 -05:00
Greg Johnston
d72b12524e Merge pull request #2395 from leptos-rs/int-ax-doc 2024-03-01 20:08:18 -05:00
Greg Johnston
8e79c5be5c fix: ignore as with other doctests for now 2024-03-01 18:39:55 -05:00
Greg Johnston
de25658c36 Merge pull request #2392 from paul-hansen/fix-ci
fix(ci): "needless borrow" error and example never exiting
2024-03-01 18:37:48 -05:00
Paul Hansen
e2e35a9659 fix(ci) Wait a bit longer for server to start
It took longer than I thought in Github and barely worked, giving it a
bit more of a buffer.
2024-03-01 15:47:59 -06:00
Paul Hansen
bf1ba589c5 fix(ci): Another attempt to fix hanging example 2024-03-01 15:41:22 -06:00
Sam Judelson
f70ebc1289 docs: add note on how to get ResponseOptions (#2380) 2024-03-01 10:47:02 -05:00
Paul Hansen
3cab09e015 fix(ci): error_boundary example never exiting 2024-03-01 09:21:58 -06:00
Paul Hansen
b431315f7c fix(ci): "needless borrow" error 2024-03-01 09:21:58 -06:00
Baptiste
5b40881e77 fix: specify path to wasm_bindgen in island macro (#2387) 2024-03-01 10:15:19 -05:00
benwis
59d3cce3be 0.6.7 2024-02-29 13:38:09 -08:00
965 changed files with 69410 additions and 39635 deletions

View File

@@ -29,4 +29,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-01-29
toolchain: stable

View File

@@ -24,4 +24,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-01-29
toolchain: stable

28
.github/workflows/ci-semver.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: CI semver
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
get-leptos-changed:
uses: ./.github/workflows/get-leptos-changed.yml
test:
needs: [get-leptos-changed]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true' && github.event.pull_request.labels[0].name != 'breaking'
name: Run semver check (nightly-2024-04-14)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Semver Checks
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
rust-toolchain: nightly-2024-04-14

View File

@@ -1,26 +0,0 @@
name: CI Stable Examples
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
get-leptos-changed:
uses: ./.github/workflows/get-leptos-changed.yml
test:
name: CI
needs: [get-leptos-changed]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true'
strategy:
matrix:
directory: [examples/counters_stable, examples/counter_without_macros]
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: stable

View File

@@ -20,6 +20,11 @@ jobs:
matrix:
directory:
[
any_error,
any_spawner,
const_str_slice_concat,
either_of,
hydration_context,
integrations/actix,
integrations/axum,
integrations/utils,
@@ -28,10 +33,14 @@ jobs:
leptos_dom,
leptos_hot_reload,
leptos_macro,
leptos_reactive,
leptos_server,
meta,
next_tuple,
oco,
or_poisoned,
reactive_graph,
router,
router_macro,
server_fn,
server_fn/server_fn_macro_default,
server_fn_macro,
@@ -40,4 +49,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-01-29
toolchain: nightly-2024-04-14

View File

@@ -21,7 +21,7 @@ jobs:
- name: Get example files that changed
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v43
with:
files: |
examples/**

View File

@@ -17,8 +17,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install JQ Tool
uses: mbround18/install-jq@v1
- name: Install jq
run: sudo apt-get install jq
- name: Set Matrix
id: set-matrix

View File

@@ -16,23 +16,37 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get source files that changed
id: changed-source
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v43
with:
files: |
integrations/**
any_error/**
any_spawner/**
const_str_slice_concat/**
either_of/**
hydration_context/**
integrations/actix/**
integrations/axum/**
integrations/utils/**
leptos/**
leptos_config/**
leptos_dom/**
leptos_hot_reload/**
leptos_macro/**
leptos_reactive/**
leptos_server/**
meta/**
next_tuple/**
oco/**
or_poisoned/**
reactive_graph/**
router/**
router_macro/**
server_fn/**
server_fn/server_fn_macro_default/**
server_fn_macro/**
- name: List source files that changed

View File

@@ -27,11 +27,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ inputs.toolchain }}
override: true
components: rustfmt
- name: Add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
@@ -44,8 +42,17 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Install binstall
uses: cargo-bins/cargo-binstall@main
- name: Install wasm-bindgen
run: cargo binstall wasm-bindgen-cli --no-confirm
- name: Install cargo-leptos
run: cargo binstall cargo-leptos --no-confirm
- name: Install Trunk
uses: jetli/trunk-action@v0.4.0
uses: jetli/trunk-action@v0.5.0
with:
version: "latest"
@@ -69,7 +76,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}

View File

@@ -72,12 +72,19 @@ check-examples`.
## Before Submitting a PR
We have a fairly extensive CI setup that runs both lints (like `rustfmt` and `clippy`)
We have a fairly extensive CI setup that runs both lints (like `rustfmt` and `clippy`)
and tests on PRs. You can run most of these locally if you have `cargo-make` installed.
Note that some of the `rustfmt` settings used require usage of the nightly compiler.
Formatting the code using the stable toolchain may result in a wrong code format and
subsequently CI errors.
Run `cargo +nightly fmt` if you want to keep the stable toolchain active.
You may want to let your IDE automatically use the `+nightly` parameter when a
"format on save" action is used.
If you added an example, make sure to add it to the list in `examples/Makefile.toml`.
From the root directory of the repo, run
From the root directory of the repo, run
- `cargo +nightly fmt`
- `cargo +nightly make check`
- `cargo +nightly make test`

View File

@@ -1,17 +1,30 @@
[workspace]
resolver = "2"
members = [
# utilities
"oco",
"any_spawner",
"const_str_slice_concat",
"either_of",
"next_tuple",
"oco",
"or_poisoned",
# core
"hydration_context",
"leptos",
"leptos_dom",
"leptos_config",
"leptos_hot_reload",
"leptos_macro",
"leptos_reactive",
"leptos_server",
"reactive_graph",
"reactive_stores",
"reactive_stores_macro",
"server_fn",
"server_fn_macro",
"server_fn/server_fn_macro_default",
"tachys",
# integrations
"integrations/actix",
@@ -21,27 +34,40 @@ members = [
# libraries
"meta",
"router",
"router_macro",
"any_error",
]
exclude = ["benchmarks", "examples"]
[workspace.package]
version = "0.6.6"
version = "0.7.0-alpha"
rust-version = "1.75"
[workspace.dependencies]
leptos = { path = "./leptos", version = "0.6.5" }
leptos_dom = { path = "./leptos_dom", version = "0.6.5" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.5" }
leptos_macro = { path = "./leptos_macro", version = "0.6.5" }
leptos_reactive = { path = "./leptos_reactive", version = "0.6.5" }
leptos_server = { path = "./leptos_server", version = "0.6.5" }
server_fn = { path = "./server_fn", version = "0.6.5" }
server_fn_macro = { path = "./server_fn_macro", version = "0.6.5" }
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.6" }
leptos_config = { path = "./leptos_config", version = "0.6.5" }
leptos_router = { path = "./router", version = "0.6.5" }
leptos_meta = { path = "./meta", version = "0.6.5" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.5" }
throw_error = { path = "./any_error/", version = "0.1" }
any_spawner = { path = "./any_spawner/", version = "0.1" }
const_str_slice_concat = { path = "./const_str_slice_concat", version = "0.1" }
either_of = { path = "./either_of/", version = "0.1" }
hydration_context = { path = "./hydration_context", version = "0.2.0-alpha" }
leptos = { path = "./leptos", version = "0.7.0-alpha" }
leptos_config = { path = "./leptos_config", version = "0.7.0-alpha" }
leptos_dom = { path = "./leptos_dom", version = "0.7.0-alpha" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.7.0-alpha" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.7.0-alpha" }
leptos_macro = { path = "./leptos_macro", version = "0.7.0-alpha" }
leptos_router = { path = "./router", version = "0.7.0-alpha" }
leptos_server = { path = "./leptos_server", version = "0.7.0-alpha" }
leptos_meta = { path = "./meta", version = "0.7.0-alpha" }
next_tuple = { path = "./next_tuple", version = "0.1.0-alpha" }
oco_ref = { path = "./oco", version = "0.2" }
or_poisoned = { path = "./or_poisoned", version = "0.1" }
reactive_graph = { path = "./reactive_graph", version = "0.1.0-alpha" }
reactive_stores = { path = "./reactive_stores", version = "0.1.0-alpha" }
reactive_stores_macro = { path = "./reactive_stores_macro", version = "0.1.0-alpha" }
server_fn = { path = "./server_fn", version = "0.7.0-alpha" }
server_fn_macro = { path = "./server_fn_macro", version = "0.7.0-alpha" }
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.7.0-alpha" }
tachys = { path = "./tachys", version = "0.1.0-alpha" }
[profile.release]
codegen-units = 1

View File

@@ -163,7 +163,7 @@ The new rendering approach being developed for 0.7 supports “universal renderi
### How is this different from Yew?
Yew is the most-used library for Rust web UI development, but there are several differences between Yew and Leptos, in philosophy, approach, and performance.
Yew is the most-used library for Rust web UI development, but there are several differences between Yew and Leptos, in philosophy, approach, and performance.
- **VDOM vs. fine-grained:** Yew is built on the virtual DOM (VDOM) model: state changes cause components to re-render, generating a new virtual DOM tree. Yew diffs this against the previous VDOM, and applies those patches to the actual DOM. Component functions rerun whenever state changes. Leptos takes an entirely different approach. Components run once, creating (and returning) actual DOM nodes and setting up a reactive system to update those DOM nodes.
- **Performance:** This has huge performance implications: Leptos is simply much faster at both creating and updating the UI than Yew is.
@@ -182,4 +182,4 @@ Sycamore and Leptos are both heavily influenced by SolidJS. At this point, Lepto
- **Templating DSLs:** Sycamore uses a custom templating language for its views, while Leptos uses a JSX-like template format.
- **`'static` signals:** One of Leptoss main innovations was the creation of `Copy + 'static` signals, which have excellent ergonomics. Sycamore is in the process of adopting the same pattern, but this is not yet released.
- **Perseus vs. server functions:** The Perseus metaframework provides an opinionated way to build Sycamore apps that include server functionality. Leptos instead provides primitives like server functions in the core of the framework.
- **Perseus vs. server functions:** The Perseus metaframework provides an opinionated way to build Sycamore apps that include server functionality. Leptos instead provides primitives like server functions in the core of the framework.

40
TODO.md Normal file
View File

@@ -0,0 +1,40 @@
- core examples
- [x] counter
- [x] counters
- [x] fetch
- [x] todomvc
- [x] error_boundary
- [x] parent\_child
- [x] on: on components
- [ ] router
- [ ] slots
- [ ] hackernews
- [ ] counter\_isomorphic
- [ ] todo\_app\_sqlite
- other ssr examples
- [ ] error boundary SSR
- reactivity
- Signal wrappers
- SignalDispose implementations on all Copy types
- untracked access warnings
- ErrorBoundary
- [ ] RenderHtml implementation
- [ ] Separate component?
- Suspense/Transition components?
- callbacks
- unsync StoredValue
- SSR
- escaping HTML correctly (attributes + text nodes)
- router
- nested routes
- trailing slashes
- \_meta package (and use in hackernews)
- integrations
- update tests
- hackernews example
- TODOs
- Suspense/Transition/Await components
- nicer routing components
- async routing (waiting for data to load before navigation)
- `<A>` component
- figure out rebuilding issues: list (needs new signal IDs) vs. regular rebuild

13
any_error/Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[package]
name = "throw_error"
edition = "2021"
version = "0.1.0"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
repository = "https://github.com/leptos-rs/leptos"
description = "Utilities for wrapping, throwing, and catching errors."
rust-version.workspace = true
[dependencies]
pin-project-lite = "0.2"

2
any_error/README.md Normal file
View File

@@ -0,0 +1,2 @@
A utility library for wrapping arbitrary errors, and for “throwing” errors in a way
that can be caught by user-defined error hooks.

148
any_error/src/lib.rs Normal file
View File

@@ -0,0 +1,148 @@
#![forbid(unsafe_code)]
#![deny(missing_docs)]
//! A utility library for wrapping arbitrary errors, and for “throwing” errors in a way
//! that can be caught by user-defined error hooks.
use std::{
cell::RefCell,
error,
fmt::{self, Display},
future::Future,
ops,
pin::Pin,
sync::Arc,
task::{Context, Poll},
};
/* Wrapper Types */
/// This is a result type into which any error can be converted.
///
/// Results are stored as [`Error`].
pub type Result<T, E = Error> = core::result::Result<T, E>;
/// A generic wrapper for any error.
#[derive(Debug, Clone)]
#[repr(transparent)]
pub struct Error(Arc<dyn error::Error + Send + Sync>);
impl Error {
/// Converts the wrapper into the inner reference-counted error.
pub fn into_inner(self) -> Arc<dyn error::Error + Send + Sync> {
Arc::clone(&self.0)
}
}
impl ops::Deref for Error {
type Target = Arc<dyn error::Error + Send + Sync>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
impl<T> From<T> for Error
where
T: error::Error + Send + Sync + 'static,
{
fn from(value: T) -> Self {
Error(Arc::new(value))
}
}
/// Implements behavior that allows for global or scoped error handling.
///
/// This allows for both "throwing" errors to register them, and "clearing" errors when they are no
/// longer valid. This is useful for something like a user interface, in which an error can be
/// "thrown" on some invalid user input, and later "cleared" if the user corrects the input.
/// Keeping a unique identifier for each error allows the UI to be updated accordingly.
pub trait ErrorHook: Send + Sync {
/// Handles the given error, returning a unique identifier.
fn throw(&self, error: Error) -> ErrorId;
/// Clears the error associated with the given identifier.
fn clear(&self, id: &ErrorId);
}
/// A unique identifier for an error. This is returned when you call [`throw`], which calls a
/// global error handler.
#[derive(Debug, PartialEq, Eq, Hash, Clone, Default)]
pub struct ErrorId(usize);
impl Display for ErrorId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt(&self.0, f)
}
}
impl From<usize> for ErrorId {
fn from(value: usize) -> Self {
Self(value)
}
}
thread_local! {
static ERROR_HOOK: RefCell<Option<Arc<dyn ErrorHook>>> = RefCell::new(None);
}
/// Sets the current thread-local error hook, which will be invoked when [`throw`] is called.
pub fn set_error_hook(hook: Arc<dyn ErrorHook>) {
ERROR_HOOK.with_borrow_mut(|this| *this = Some(hook))
}
/// Invokes the error hook set by [`set_error_hook`] with the given error.
pub fn throw(error: impl Into<Error>) -> ErrorId {
ERROR_HOOK
.with_borrow(|hook| hook.as_ref().map(|hook| hook.throw(error.into())))
.unwrap_or_default()
}
/// Clears the given error from the current error hook.
pub fn clear(id: &ErrorId) {
ERROR_HOOK
.with_borrow(|hook| hook.as_ref().map(|hook| hook.clear(id)))
.unwrap_or_default()
}
pin_project_lite::pin_project! {
/// A [`Future`] that reads the error hook that is set when it is created, and sets this as the
/// current error hook whenever it is polled.
pub struct ErrorHookFuture<Fut> {
hook: Option<Arc<dyn ErrorHook>>,
#[pin]
inner: Fut
}
}
impl<Fut> ErrorHookFuture<Fut> {
/// Reads the current hook and wraps the given [`Future`], returning a new `Future` that will
/// set the error hook whenever it is polled.
pub fn new(inner: Fut) -> Self {
Self {
hook: ERROR_HOOK.with_borrow(Clone::clone),
inner,
}
}
}
impl<Fut> Future for ErrorHookFuture<Fut>
where
Fut: Future,
{
type Output = Fut::Output;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
if let Some(hook) = &this.hook {
set_error_hook(Arc::clone(hook))
}
this.inner.poll(cx)
}
}

30
any_spawner/Cargo.toml Normal file
View File

@@ -0,0 +1,30 @@
[package]
name = "any_spawner"
edition = "2021"
version = "0.1.1"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
repository = "https://github.com/leptos-rs/leptos"
description = "Spawn asynchronous tasks in an executor-independent way."
[dependencies]
futures = "0.3"
glib = { version = "0.19", optional = true }
thiserror = "1"
tokio = { version = "1", optional = true, default-features = false, features = [
"rt",
] }
tracing = { version = "0.1", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
[features]
tracing = ["dep:tracing"]
tokio = ["dep:tokio"]
glib = ["dep:glib"]
wasm-bindgen = ["dep:wasm-bindgen-futures"]
futures-executor = ["futures/thread-pool", "futures/executor"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

26
any_spawner/README.md Normal file
View File

@@ -0,0 +1,26 @@
This crate makes it easier to write asynchronous code that is executor-agnostic, by providing a
utility that can be used to spawn tasks in a variety of executors.
It only supports single executor per program, but that executor can be set at runtime, anywhere
in your crate (or an application that depends on it).
This can be extended to support any executor or runtime that supports spawning [`Future`]s.
This is a least common denominator implementation in many ways. Limitations include:
- setting an executor is a one-time, global action
- no "join handle" or other result is returned from the spawn
- the `Future` must output `()`
```rust
use any_spawner::Executor;
Executor::init_futures_executor()
.expect("executor should only be initialized once");
// spawn a thread-safe Future
Executor::spawn(async { /* ... */ });
// spawn a Future that is !Send
Executor::spawn_local(async { /* ... */ });
```

245
any_spawner/src/lib.rs Normal file
View File

@@ -0,0 +1,245 @@
//! This crate makes it easier to write asynchronous code that is executor-agnostic, by providing a
//! utility that can be used to spawn tasks in a variety of executors.
//!
//! It only supports single executor per program, but that executor can be set at runtime, anywhere
//! in your crate (or an application that depends on it).
//!
//! This can be extended to support any executor or runtime that supports spawning [`Future`]s.
//!
//! This is a least common denominator implementation in many ways. Limitations include:
//! - setting an executor is a one-time, global action
//! - no "join handle" or other result is returned from the spawn
//! - the `Future` must output `()`
//!
//! ```rust
//! use any_spawner::Executor;
//!
//! // make sure an Executor has been initialized with one of the init_ functions
//!
//! # if false {
//! // spawn a thread-safe Future
//! Executor::spawn(async { /* ... */ });
//!
//! // spawn a Future that is !Send
//! Executor::spawn_local(async { /* ... */ });
//! # }
//! ```
#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]
use std::{future::Future, pin::Pin, sync::OnceLock};
use thiserror::Error;
pub(crate) type PinnedFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>;
pub(crate) type PinnedLocalFuture<T> = Pin<Box<dyn Future<Output = T>>>;
static SPAWN: OnceLock<fn(PinnedFuture<()>)> = OnceLock::new();
static SPAWN_LOCAL: OnceLock<fn(PinnedLocalFuture<()>)> = OnceLock::new();
/// Errors that can occur when using the executor.
#[derive(Error, Debug)]
pub enum ExecutorError {
/// The executor has already been set.
#[error("Executor has already been set.")]
AlreadySet,
}
/// A global async executor that can spawn tasks.
pub struct Executor;
impl Executor {
/// Spawns a thread-safe [`Future`].
/// ```rust
/// use any_spawner::Executor;
/// # if false {
/// // spawn a thread-safe Future
/// Executor::spawn(async { /* ... */ });
/// # }
/// ```
#[track_caller]
pub fn spawn(fut: impl Future<Output = ()> + Send + 'static) {
if let Some(spawner) = SPAWN.get() {
spawner(Box::pin(fut))
} else {
#[cfg(all(debug_assertions, feature = "tracing"))]
tracing::error!(
"At {}, tried to spawn a Future with Executor::spawn() before \
the Executor had been set.",
std::panic::Location::caller()
);
#[cfg(all(debug_assertions, not(feature = "tracing")))]
panic!(
"At {}, tried to spawn a Future with Executor::spawn() before \
the Executor had been set.",
std::panic::Location::caller()
);
}
}
/// Spawns a [`Future`] that cannot be sent across threads.
/// ```rust
/// use any_spawner::Executor;
///
/// # if false {
/// // spawn a thread-safe Future
/// Executor::spawn_local(async { /* ... */ });
/// # }
/// ```
#[track_caller]
pub fn spawn_local(fut: impl Future<Output = ()> + 'static) {
if let Some(spawner) = SPAWN_LOCAL.get() {
spawner(Box::pin(fut))
} else {
#[cfg(all(debug_assertions, feature = "tracing"))]
tracing::error!(
"At {}, tried to spawn a Future with Executor::spawn_local() \
before the Executor had been set.",
std::panic::Location::caller()
);
#[cfg(all(debug_assertions, not(feature = "tracing")))]
panic!(
"At {}, tried to spawn a Future with Executor::spawn_local() \
before the Executor had been set.",
std::panic::Location::caller()
);
}
}
/// Waits until the next "tick" of the current async executor.
pub async fn tick() {
let (tx, rx) = futures::channel::oneshot::channel();
Executor::spawn(async move {
_ = tx.send(());
});
_ = rx.await;
}
}
impl Executor {
/// Globally sets the [`tokio`] runtime as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
///
/// Requires the `tokio` feature to be activated on this crate.
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn init_tokio() -> Result<(), ExecutorError> {
SPAWN
.set(|fut| {
tokio::spawn(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
tokio::task::spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
}
/// Globally sets the [`wasm-bindgen-futures`] runtime as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
///
/// Requires the `wasm-bindgen` feature to be activated on this crate.
#[cfg(feature = "wasm-bindgen")]
#[cfg_attr(docsrs, doc(cfg(feature = "wasm-bindgen")))]
pub fn init_wasm_bindgen() -> Result<(), ExecutorError> {
SPAWN
.set(|fut| {
wasm_bindgen_futures::spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
wasm_bindgen_futures::spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
}
/// Globally sets the [`glib`] runtime as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
///
/// Requires the `glib` feature to be activated on this crate.
#[cfg(feature = "glib")]
#[cfg_attr(docsrs, doc(cfg(feature = "glib")))]
pub fn init_glib() -> Result<(), ExecutorError> {
SPAWN
.set(|fut| {
let main_context = glib::MainContext::default();
main_context.spawn(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
let main_context = glib::MainContext::default();
main_context.spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
}
/// Globally sets the [`futures`] executor as the executor used to spawn tasks,
/// lazily creating a thread pool to spawn tasks into.
///
/// Returns `Err(_)` if an executor has already been set.
///
/// Requires the `futures-executor` feature to be activated on this crate.
#[cfg(feature = "futures-executor")]
#[cfg_attr(docsrs, doc(cfg(feature = "futures-executor")))]
pub fn init_futures_executor() -> Result<(), ExecutorError> {
use futures::{
executor::{LocalPool, ThreadPool},
task::{LocalSpawnExt, SpawnExt},
};
static THREAD_POOL: OnceLock<ThreadPool> = OnceLock::new();
thread_local! {
static LOCAL_POOL: LocalPool = LocalPool::new();
}
fn get_thread_pool() -> &'static ThreadPool {
THREAD_POOL.get_or_init(|| {
ThreadPool::new()
.expect("could not create futures executor ThreadPool")
})
}
SPAWN
.set(|fut| {
get_thread_pool()
.spawn(fut)
.expect("failed to spawn future");
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
LOCAL_POOL.with(|pool| {
let spawner = pool.spawner();
spawner.spawn_local(fut).expect("failed to spawn future");
});
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
}
}
#[cfg(test)]
mod tests {
#[cfg(feature = "futures-executor")]
#[test]
fn can_spawn_local_future() {
use crate::Executor;
use std::rc::Rc;
Executor::init_futures_executor().expect("couldn't set executor");
let rc = Rc::new(());
Executor::spawn_local(async {
_ = rc;
});
Executor::spawn(async {});
}
}

View File

@@ -3,5 +3,5 @@ alias = "check-all"
[tasks.check-all]
command = "cargo"
args = ["+nightly-2024-01-29", "check-all-features"]
args = ["check-all-features"]
install_crate = "cargo-all-features"

View File

@@ -8,4 +8,11 @@ args = ["fmt", "--", "--check", "--config-path", "${LEPTOS_PROJECT_DIRECTORY}"]
[tasks.clippy-each-feature]
dependencies = ["install-clippy"]
command = "cargo"
args = ["hack", "clippy", "--all", "--each-feature", "--no-dev-deps"]
args = [
"clippy",
"--all-features",
"--no-deps",
"--",
"-D",
"clippy::print_stdout",
]

View File

@@ -3,5 +3,5 @@ alias = "test-all"
[tasks.test-all]
command = "cargo"
args = ["+nightly-2024-01-29", "test-all-features"]
args = ["test-all-features"]
install_crate = "cargo-all-features"

View File

@@ -0,0 +1,12 @@
[package]
name = "const_str_slice_concat"
edition = "2021"
version = "0.1.0"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
repository = "https://github.com/leptos-rs/leptos"
description = "Utilities for const concatenation of string slices."
rust-version.workspace = true
[dependencies]

View File

@@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

View File

@@ -0,0 +1,139 @@
#![no_std]
#![forbid(unsafe_code)]
#![deny(missing_docs)]
//! Utilities for const concatenation of string slices.
pub(crate) const MAX_TEMPLATE_SIZE: usize = 4096;
/// Converts a zero-terminated buffer of bytes into a UTF-8 string.
pub const fn str_from_buffer(buf: &[u8; MAX_TEMPLATE_SIZE]) -> &str {
match core::ffi::CStr::from_bytes_until_nul(buf) {
Ok(cstr) => match cstr.to_str() {
Ok(str) => str,
Err(_) => panic!("TEMPLATE FAILURE"),
},
Err(_) => panic!("TEMPLATE FAILURE"),
}
}
/// Concatenates any number of static strings into a single array.
// credit to Rainer Stropek, "Constant fun," Rust Linz, June 2022
pub const fn const_concat(
strs: &'static [&'static str],
) -> [u8; MAX_TEMPLATE_SIZE] {
let mut buffer = [0; MAX_TEMPLATE_SIZE];
let mut position = 0;
let mut remaining = strs;
while let [current, tail @ ..] = remaining {
let x = current.as_bytes();
let mut i = 0;
// have it iterate over bytes manually, because, again,
// no mutable refernces in const fns
while i < x.len() {
buffer[position] = x[i];
position += 1;
i += 1;
}
remaining = tail;
}
buffer
}
/// Converts a zero-terminated buffer of bytes into a UTF-8 string with the given prefix.
pub const fn const_concat_with_prefix(
strs: &'static [&'static str],
prefix: &'static str,
suffix: &'static str,
) -> [u8; MAX_TEMPLATE_SIZE] {
let mut buffer = [0; MAX_TEMPLATE_SIZE];
let mut position = 0;
let mut remaining = strs;
while let [current, tail @ ..] = remaining {
let x = current.as_bytes();
let mut i = 0;
// have it iterate over bytes manually, because, again,
// no mutable refernces in const fns
while i < x.len() {
buffer[position] = x[i];
position += 1;
i += 1;
}
remaining = tail;
}
if buffer[0] == 0 {
buffer
} else {
let mut new_buf = [0; MAX_TEMPLATE_SIZE];
let prefix = prefix.as_bytes();
let suffix = suffix.as_bytes();
let mut position = 0;
let mut i = 0;
while i < prefix.len() {
new_buf[position] = prefix[i];
position += 1;
i += 1;
}
i = 0;
while i < buffer.len() {
if buffer[i] == 0 {
break;
}
new_buf[position] = buffer[i];
position += 1;
i += 1;
}
i = 0;
while i < suffix.len() {
new_buf[position] = suffix[i];
position += 1;
i += 1;
}
new_buf
}
}
/// Converts any number of strings into a UTF-8 string, separated by the given string.
pub const fn const_concat_with_separator(
strs: &[&str],
separator: &'static str,
) -> [u8; MAX_TEMPLATE_SIZE] {
let mut buffer = [0; MAX_TEMPLATE_SIZE];
let mut position = 0;
let mut remaining = strs;
while let [current, tail @ ..] = remaining {
let x = current.as_bytes();
let mut i = 0;
// have it iterate over bytes manually, because, again,
// no mutable refernces in const fns
while i < x.len() {
buffer[position] = x[i];
position += 1;
i += 1;
}
if !x.is_empty() {
let mut position = 0;
let separator = separator.as_bytes();
while i < separator.len() {
buffer[position] = separator[i];
position += 1;
i += 1;
}
}
remaining = tail;
}
buffer
}

1
docs/book_ru/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
book

2
docs/book_ru/README.md Normal file
View File

@@ -0,0 +1,2 @@
Перевод в процессе, книга скоро будет доступна
> Translation underway, book will be available soon

10
docs/book_ru/book.toml Normal file
View File

@@ -0,0 +1,10 @@
[output.html]
additional-css = ["./mdbook-admonish.css"]
[output.html.playground]
runnable = false
[preprocessor]
[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "3.0.1" # не редактировать: управляется `mdbook-admonish install`

View File

@@ -0,0 +1,345 @@
@charset "UTF-8";
:root {
--md-admonition-icon--admonish-note: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z'/></svg>");
--md-admonition-icon--admonish-abstract: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M17 9H7V7h10m0 6H7v-2h10m-3 6H7v-2h7M12 3a1 1 0 0 1 1 1 1 1 0 0 1-1 1 1 1 0 0 1-1-1 1 1 0 0 1 1-1m7 0h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z'/></svg>");
--md-admonition-icon--admonish-info: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2z'/></svg>");
--md-admonition-icon--admonish-tip: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M17.66 11.2c-.23-.3-.51-.56-.77-.82-.67-.6-1.43-1.03-2.07-1.66C13.33 7.26 13 4.85 13.95 3c-.95.23-1.78.75-2.49 1.32-2.59 2.08-3.61 5.75-2.39 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.23.1-.47.04-.66-.12a.58.58 0 0 1-.14-.17c-1.13-1.43-1.31-3.48-.55-5.12C5.78 10 4.87 12.3 5 14.47c.06.5.12 1 .29 1.5.14.6.41 1.2.71 1.73 1.08 1.73 2.95 2.97 4.96 3.22 2.14.27 4.43-.12 6.07-1.6 1.83-1.66 2.47-4.32 1.53-6.6l-.13-.26c-.21-.46-.77-1.26-.77-1.26m-3.16 6.3c-.28.24-.74.5-1.1.6-1.12.4-2.24-.16-2.9-.82 1.19-.28 1.9-1.16 2.11-2.05.17-.8-.15-1.46-.28-2.23-.12-.74-.1-1.37.17-2.06.19.38.39.76.63 1.06.77 1 1.98 1.44 2.24 2.8.04.14.06.28.06.43.03.82-.33 1.72-.93 2.27z'/></svg>");
--md-admonition-icon--admonish-success: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m9 20.42-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z'/></svg>");
--md-admonition-icon--admonish-question: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m15.07 11.25-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 0 0-2-2 2 2 0 0 0-2 2H8a4 4 0 0 1 4-4 4 4 0 0 1 4 4 3.2 3.2 0 0 1-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10c0-5.53-4.5-10-10-10z'/></svg>");
--md-admonition-icon--admonish-warning: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2 1 21z'/></svg>");
--md-admonition-icon--admonish-failure: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 6.91 17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z'/></svg>");
--md-admonition-icon--admonish-danger: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 15H6l7-14v8h5l-7 14v-8z'/></svg>");
--md-admonition-icon--admonish-bug: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 0 0-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 0 0-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z'/></svg>");
--md-admonition-icon--admonish-example: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 0 1 .75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z'/></svg>");
--md-admonition-icon--admonish-quote: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z'/></svg>");
--md-details-icon: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42Z'/></svg>");
}
:is(.admonition) {
display: flow-root;
margin: 1.5625em 0;
padding: 0 1.2rem;
color: var(--fg);
page-break-inside: avoid;
background-color: var(--bg);
border: 0 solid black;
border-inline-start-width: 0.4rem;
border-radius: 0.2rem;
box-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.05), 0 0 0.1rem rgba(0, 0, 0, 0.1);
}
@media print {
:is(.admonition) {
box-shadow: none;
}
}
:is(.admonition) > * {
box-sizing: border-box;
}
:is(.admonition) :is(.admonition) {
margin-top: 1em;
margin-bottom: 1em;
}
:is(.admonition) > .tabbed-set:only-child {
margin-top: 0;
}
html :is(.admonition) > :last-child {
margin-bottom: 1.2rem;
}
a.admonition-anchor-link {
display: none;
position: absolute;
left: -1.2rem;
padding-right: 1rem;
}
a.admonition-anchor-link:link, a.admonition-anchor-link:visited {
color: var(--fg);
}
a.admonition-anchor-link:link:hover, a.admonition-anchor-link:visited:hover {
text-decoration: none;
}
a.admonition-anchor-link::before {
content: "§";
}
:is(.admonition-title, summary.admonition-title) {
position: relative;
min-height: 4rem;
margin-block: 0;
margin-inline: -1.6rem -1.2rem;
padding-block: 0.8rem;
padding-inline: 4.4rem 1.2rem;
font-weight: 700;
background-color: rgba(68, 138, 255, 0.1);
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
display: flex;
}
:is(.admonition-title, summary.admonition-title) p {
margin: 0;
}
html :is(.admonition-title, summary.admonition-title):last-child {
margin-bottom: 0;
}
:is(.admonition-title, summary.admonition-title)::before {
position: absolute;
top: 0.625em;
inset-inline-start: 1.6rem;
width: 2rem;
height: 2rem;
background-color: #448aff;
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>');
-webkit-mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>');
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-size: contain;
content: "";
}
:is(.admonition-title, summary.admonition-title):hover a.admonition-anchor-link {
display: initial;
}
details.admonition > summary.admonition-title::after {
position: absolute;
top: 0.625em;
inset-inline-end: 1.6rem;
height: 2rem;
width: 2rem;
background-color: currentcolor;
mask-image: var(--md-details-icon);
-webkit-mask-image: var(--md-details-icon);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-size: contain;
content: "";
transform: rotate(0deg);
transition: transform 0.25s;
}
details[open].admonition > summary.admonition-title::after {
transform: rotate(90deg);
}
:is(.admonition):is(.admonish-note) {
border-color: #448aff;
}
:is(.admonish-note) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(68, 138, 255, 0.1);
}
:is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #448aff;
mask-image: var(--md-admonition-icon--admonish-note);
-webkit-mask-image: var(--md-admonition-icon--admonish-note);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) {
border-color: #00b0ff;
}
:is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(0, 176, 255, 0.1);
}
:is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #00b0ff;
mask-image: var(--md-admonition-icon--admonish-abstract);
-webkit-mask-image: var(--md-admonition-icon--admonish-abstract);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-info, .admonish-todo) {
border-color: #00b8d4;
}
:is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(0, 184, 212, 0.1);
}
:is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #00b8d4;
mask-image: var(--md-admonition-icon--admonish-info);
-webkit-mask-image: var(--md-admonition-icon--admonish-info);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-tip, .admonish-hint, .admonish-important) {
border-color: #00bfa5;
}
:is(.admonish-tip, .admonish-hint, .admonish-important) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(0, 191, 165, 0.1);
}
:is(.admonish-tip, .admonish-hint, .admonish-important) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #00bfa5;
mask-image: var(--md-admonition-icon--admonish-tip);
-webkit-mask-image: var(--md-admonition-icon--admonish-tip);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-success, .admonish-check, .admonish-done) {
border-color: #00c853;
}
:is(.admonish-success, .admonish-check, .admonish-done) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(0, 200, 83, 0.1);
}
:is(.admonish-success, .admonish-check, .admonish-done) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #00c853;
mask-image: var(--md-admonition-icon--admonish-success);
-webkit-mask-image: var(--md-admonition-icon--admonish-success);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-question, .admonish-help, .admonish-faq) {
border-color: #64dd17;
}
:is(.admonish-question, .admonish-help, .admonish-faq) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(100, 221, 23, 0.1);
}
:is(.admonish-question, .admonish-help, .admonish-faq) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #64dd17;
mask-image: var(--md-admonition-icon--admonish-question);
-webkit-mask-image: var(--md-admonition-icon--admonish-question);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-warning, .admonish-caution, .admonish-attention) {
border-color: #ff9100;
}
:is(.admonish-warning, .admonish-caution, .admonish-attention) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(255, 145, 0, 0.1);
}
:is(.admonish-warning, .admonish-caution, .admonish-attention) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #ff9100;
mask-image: var(--md-admonition-icon--admonish-warning);
-webkit-mask-image: var(--md-admonition-icon--admonish-warning);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-failure, .admonish-fail, .admonish-missing) {
border-color: #ff5252;
}
:is(.admonish-failure, .admonish-fail, .admonish-missing) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(255, 82, 82, 0.1);
}
:is(.admonish-failure, .admonish-fail, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #ff5252;
mask-image: var(--md-admonition-icon--admonish-failure);
-webkit-mask-image: var(--md-admonition-icon--admonish-failure);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-danger, .admonish-error) {
border-color: #ff1744;
}
:is(.admonish-danger, .admonish-error) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(255, 23, 68, 0.1);
}
:is(.admonish-danger, .admonish-error) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #ff1744;
mask-image: var(--md-admonition-icon--admonish-danger);
-webkit-mask-image: var(--md-admonition-icon--admonish-danger);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-bug) {
border-color: #f50057;
}
:is(.admonish-bug) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(245, 0, 87, 0.1);
}
:is(.admonish-bug) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #f50057;
mask-image: var(--md-admonition-icon--admonish-bug);
-webkit-mask-image: var(--md-admonition-icon--admonish-bug);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-example) {
border-color: #7c4dff;
}
:is(.admonish-example) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(124, 77, 255, 0.1);
}
:is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #7c4dff;
mask-image: var(--md-admonition-icon--admonish-example);
-webkit-mask-image: var(--md-admonition-icon--admonish-example);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
:is(.admonition):is(.admonish-quote, .admonish-cite) {
border-color: #9e9e9e;
}
:is(.admonish-quote, .admonish-cite) > :is(.admonition-title, summary.admonition-title) {
background-color: rgba(158, 158, 158, 0.1);
}
:is(.admonish-quote, .admonish-cite) > :is(.admonition-title, summary.admonition-title)::before {
background-color: #9e9e9e;
mask-image: var(--md-admonition-icon--admonish-quote);
-webkit-mask-image: var(--md-admonition-icon--admonish-quote);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
}
.navy :is(.admonition) {
background-color: var(--sidebar-bg);
}
.ayu :is(.admonition),
.coal :is(.admonition) {
background-color: var(--theme-hover);
}
.rust :is(.admonition) {
background-color: var(--sidebar-bg);
color: var(--sidebar-fg);
}
.rust .admonition-anchor-link:link, .rust .admonition-anchor-link:visited {
color: var(--sidebar-fg);
}

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/">
<link rel="canonical" href="https://book.leptos.dev/">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/15_global_state.html">
<link rel="canonical" href="https://book.leptos.dev/15_global_state.html">

View File

@@ -0,0 +1,55 @@
# Оглавление
- [Вступление](./01_introduction.md)
- [Начало работы](./getting_started/README.md)
- [Leptos DX](./getting_started/leptos_dx.md)
- [Сообщество Leptos и leptos-* Крейты](./getting_started/community_crates.md)
- [Часть 1: Построение UI](./view/README.md)
- [Простой компонент](./view/01_basic_component.md)
- [Динамические атрибуты](./view/02_dynamic_attributes.md)
- [Компоненты и свойства](./view/03_components.md)
- [Итерирование](./view/04_iteration.md)
- [Итерирование более сложных структур через `<For>`](./view/04b_iteration.md)
- [Формы и поля ввода](./view/05_forms.md)
- [Порядок выполнения](./view/06_control_flow.md)
- [Обработка ошибок](./view/07_errors.md)
- [Общение Родитель-Ребёнок в дереве компонентов](./view/08_parent_child.md)
- [Передача Детей другим компонентам](./view/09_component_children.md)
- [Без макросов: синтаксис билдера View](./view/builder.md)
- [Реактивность](./reactivity/README.md)
- [Работа с сигналами](./reactivity/working_with_signals.md)
- [Реагирование на изменения с помощью `create_effect`](./reactivity/14_create_effect.md)
- [Примечание: Реактивность и функции](./reactivity/interlude_functions.md)
- [Тестирование](./testing.md)
- [Асинхронность](./async/README.md)
- [Подгрузка данных с помощью ресурсов (Resource)](./async/10_resources.md)
- [Ожидания (Suspense)](./async/11_suspense.md)
- [Переходы (Transition)](./async/12_transition.md)
- [Действия (Action)](./async/13_actions.md)
- [Примечание: Пробрасывание дочерних элементов](./interlude_projecting_children.md)
- [Управление глобальным состоянием](./15_global_state.md)
- [Маршрутизатор URL](./router/README.md)
- [Определение `<Routes/>`](./router/16_routes.md)
- [Вложенная маршрутизация](./router/17_nested_routing.md)
- [Параметры в пути и в строке запроса](./router/18_params_and_queries.md)
- [`<A/>`](./router/19_a.md)
- [`<Form/>`](./router/20_form.md)
- [Примечание: Стили](./interlude_styling.md)
- [Метаданные](./metadata.md)
- [Рендеринг на стороне клиента (CSR): Заключение](./csr_wrapping_up.md)
- [Часть 2: Рендеринг на стороне сервера (SSR)](./ssr/README.md)
- [`cargo-leptos`](./ssr/21_cargo_leptos.md)
- [Жизненный цикл загрузки страницы](./ssr/22_life_cycle.md)
- [Асинхронный рендеринг и режимы SSR](./ssr/23_ssr_modes.md)
- [Баги возникающие при гидратации](./ssr/24_hydration_bugs.md)
- [Работа с сервером](./server/README.md)
- [Серверные функции](./server/25_server_functions.md)
- [Экстракторы](./server/26_extractors.md)
- [Ответы и перенаправления](./server/27_response.md)
- [Постепенное улучшение и Изящная деградация](./progressive_enhancement/README.md)
- [`<ActionForm/>`](./progressive_enhancement/action_form.md)
- [Развёртывание](./deployment/README.md)
- [Оптимизация размера бинарника WASM](./deployment/binary_size.md)
- [Руководство: Острова](./islands.md)
- [Приложение: Как работает реактивная система?](./appendix_reactive_graph.md)

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/appendix_reactive_graph.html">
<link rel="canonical" href="https://book.leptos.dev/appendix_reactive_graph.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/async/10_resources.html">
<link rel="canonical" href="https://book.leptos.dev/async/10_resources.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/async/11_suspense.html">
<link rel="canonical" href="https://book.leptos.dev/async/11_suspense.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/async/12_transition.html">
<link rel="canonical" href="https://book.leptos.dev/async/12_transition.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/async/13_action.html">
<link rel="canonical" href="https://book.leptos.dev/async/13_action.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/async/index.html">
<link rel="canonical" href="https://book.leptos.dev/async/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/csr_wrapping_up.html">
<link rel="canonical" href="https://book.leptos.dev/csr_wrapping_up.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/deployment/index.html">
<link rel="canonical" href="https://book.leptos.dev/deployment/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/deployment/binary_size.html">
<link rel="canonical" href="https://book.leptos.dev/deployment/binary_size.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/getting_started/index.html">
<link rel="canonical" href="https://book.leptos.dev/getting_started/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/getting_started/community_crates.html">
<link rel="canonical" href="https://book.leptos.dev/getting_started/community_crates.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/getting_started/leptos_dx.html">
<link rel="canonical" href="https://book.leptos.dev/getting_started/leptos_dx.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/interlude_projecting_children.html">
<link rel="canonical" href="https://book.leptos.dev/interlude_projecting_children.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/interlude_styling.html">
<link rel="canonical" href="https://book.leptos.dev/interlude_styling.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/islands.html">
<link rel="canonical" href="https://book.leptos.dev/islands.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/metadata.html">
<link rel="canonical" href="https://book.leptos.dev/metadata.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/progressive_enhancement/index.html">
<link rel="canonical" href="https://book.leptos.dev/progressive_enhancement/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/progressive_enhancement/action_form.html">
<link rel="canonical" href="https://book.leptos.dev/progressive_enhancement/action_form.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/reactivity/14_create_effect.html">
<link rel="canonical" href="https://book.leptos.dev/reactivity/14_create_effect.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/reactivity/index.html">
<link rel="canonical" href="https://book.leptos.dev/reactivity/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/reactivity/interlude_functions.html">
<link rel="canonical" href="https://book.leptos.dev/reactivity/interlude_functions.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/reactivity/working_with_signals.html">
<link rel="canonical" href="https://book.leptos.dev/reactivity/working_with_signals.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/router/16_routes.html">
<link rel="canonical" href="https://book.leptos.dev/router/16_routes.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/router/17_nested_routing.html">
<link rel="canonical" href="https://book.leptos.dev/router/17_nested_routing.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/router/18_params_and_queries.html">
<link rel="canonical" href="https://book.leptos.dev/router/18_params_and_queries.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/router/19_a.html">
<link rel="canonical" href="https://book.leptos.dev/router/19_a.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/router/20_form.html">
<link rel="canonical" href="https://book.leptos.dev/router/20_form.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/router/index.html">
<link rel="canonical" href="https://book.leptos.dev/router/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/server/25_server_functions.html">
<link rel="canonical" href="https://book.leptos.dev/server/25_server_functions.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/server/26_extractors.html">
<link rel="canonical" href="https://book.leptos.dev/server/26_extractors.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/server/27_response.html">
<link rel="canonical" href="https://book.leptos.dev/server/27_response.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/server/index.html">
<link rel="canonical" href="https://book.leptos.dev/server/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/ssr/21_cargo_leptos.html">
<link rel="canonical" href="https://book.leptos.dev/ssr/21_cargo_leptos.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/ssr/22_life_cycle.html">
<link rel="canonical" href="https://book.leptos.dev/ssr/22_life_cycle.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/ssr/23_ssr_modes.html">
<link rel="canonical" href="https://book.leptos.dev/ssr/23_ssr_modes.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/ssr/24_hydration_bugs.html">
<link rel="canonical" href="https://book.leptos.dev/ssr/24_hydration_bugs.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/ssr/index.html">
<link rel="canonical" href="https://book.leptos.dev/ssr/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/testing.html">
<link rel="canonical" href="https://book.leptos.dev/testing.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/01_basic_component.html">
<link rel="canonical" href="https://book.leptos.dev/view/01_basic_component.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/02_dynamic_attributes.html">
<link rel="canonical" href="https://book.leptos.dev/view/02_dynamic_attributes.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/03_components.html">
<link rel="canonical" href="https://book.leptos.dev/view/03_components.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/04_iteration.html">
<link rel="canonical" href="https://book.leptos.dev/view/04_iteration.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/04b_iteration.html">
<link rel="canonical" href="https://book.leptos.dev/view/04b_iteration.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/05_forms.html">
<link rel="canonical" href="https://book.leptos.dev/view/05_forms.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/06_control_flow.html">
<link rel="canonical" href="https://book.leptos.dev/view/06_control_flow.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/07_errors.html">
<link rel="canonical" href="https://book.leptos.dev/view/07_errors.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/08_parent_child.html">
<link rel="canonical" href="https://book.leptos.dev/view/08_parent_child.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/09_component_children.html">
<link rel="canonical" href="https://book.leptos.dev/view/09_component_children.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/index.html">
<link rel="canonical" href="https://book.leptos.dev/view/index.html">

View File

@@ -0,0 +1,2 @@
<meta http-equiv="refresh" content="0; URL=https://book.leptos.dev/view/builder.html">
<link rel="canonical" href="https://book.leptos.dev/view/builder.html">

13
either_of/Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[package]
name = "either_of"
edition = "2021"
version = "0.1.0"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
repository = "https://github.com/leptos-rs/leptos"
description = "Utilities for working with enumerated types that contain one of 2..n other types."
rust-version.workspace = true
[dependencies]
pin-project-lite = "0.2"

1
either_of/Makefile.toml Normal file
View File

@@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

1
either_of/README.md Normal file
View File

@@ -0,0 +1 @@
Utilities for working with enumerated types that contain one of `2..n` other types.

135
either_of/src/lib.rs Normal file
View File

@@ -0,0 +1,135 @@
#![no_std]
#![forbid(unsafe_code)]
//! Utilities for working with enumerated types that contain one of `2..n` other types.
use core::{
fmt::Display,
future::Future,
pin::Pin,
task::{Context, Poll},
};
use pin_project_lite::pin_project;
#[derive(Debug, Clone, Copy)]
pub enum Either<A, B> {
Left(A),
Right(B),
}
impl<Item, A, B> Iterator for Either<A, B>
where
A: Iterator<Item = Item>,
B: Iterator<Item = Item>,
{
type Item = Item;
fn next(&mut self) -> Option<Self::Item> {
match self {
Either::Left(i) => i.next(),
Either::Right(i) => i.next(),
}
}
}
pin_project! {
#[project = EitherFutureProj]
pub enum EitherFuture<A, B> {
Left { #[pin] inner: A },
Right { #[pin] inner: B },
}
}
impl<A, B> Future for EitherFuture<A, B>
where
A: Future,
B: Future,
{
type Output = Either<A::Output, B::Output>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
match this {
EitherFutureProj::Left { inner } => match inner.poll(cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(inner) => Poll::Ready(Either::Left(inner)),
},
EitherFutureProj::Right { inner } => match inner.poll(cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(inner) => Poll::Ready(Either::Right(inner)),
},
}
}
}
macro_rules! tuples {
($name:ident + $fut_name:ident + $fut_proj:ident => $($ty:ident),*) => {
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum $name<$($ty,)*> {
$($ty ($ty),)*
}
impl<$($ty,)*> Display for $name<$($ty,)*>
where
$($ty: Display,)*
{
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
$($name::$ty(this) => this.fmt(f),)*
}
}
}
impl<Item, $($ty,)*> Iterator for $name<$($ty,)*>
where
$($ty: Iterator<Item = Item>,)*
{
type Item = Item;
fn next(&mut self) -> Option<Self::Item> {
match self {
$($name::$ty(i) => i.next(),)*
}
}
}
pin_project! {
#[project = $fut_proj]
pub enum $fut_name<$($ty,)*> {
$($ty { #[pin] inner: $ty },)*
}
}
impl<$($ty,)*> Future for $fut_name<$($ty,)*>
where
$($ty: Future,)*
{
type Output = $name<$($ty::Output,)*>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
match this {
$($fut_proj::$ty { inner } => match inner.poll(cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(inner) => Poll::Ready($name::$ty(inner)),
},)*
}
}
}
}
}
tuples!(EitherOf3 + EitherOf3Future + EitherOf3FutureProj => A, B, C);
tuples!(EitherOf4 + EitherOf4Future + EitherOf4FutureProj => A, B, C, D);
tuples!(EitherOf5 + EitherOf5Future + EitherOf5FutureProj => A, B, C, D, E);
tuples!(EitherOf6 + EitherOf6Future + EitherOf6FutureProj => A, B, C, D, E, F);
tuples!(EitherOf7 + EitherOf7Future + EitherOf7FutureProj => A, B, C, D, E, F, G);
tuples!(EitherOf8 + EitherOf8Future + EitherOf8FutureProj => A, B, C, D, E, F, G, H);
tuples!(EitherOf9 + EitherOf9Future + EitherOf9FutureProj => A, B, C, D, E, F, G, H, I);
tuples!(EitherOf10 + EitherOf10Future + EitherOf10FutureProj => A, B, C, D, E, F, G, H, I, J);
tuples!(EitherOf11 + EitherOf11Future + EitherOf11FutureProj => A, B, C, D, E, F, G, H, I, J, K);
tuples!(EitherOf12 + EitherOf12Future + EitherOf12FutureProj => A, B, C, D, E, F, G, H, I, J, K, L);
tuples!(EitherOf13 + EitherOf13Future + EitherOf13FutureProj => A, B, C, D, E, F, G, H, I, J, K, L, M);
tuples!(EitherOf14 + EitherOf14Future + EitherOf14FutureProj => A, B, C, D, E, F, G, H, I, J, K, L, M, N);
tuples!(EitherOf15 + EitherOf15Future + EitherOf15FutureProj => A, B, C, D, E, F, G, H, I, J, K, L, M, N, O);
tuples!(EitherOf16 + EitherOf16Future + EitherOf16FutureProj => A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P);

View File

@@ -5,34 +5,41 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = ""
CARGO_MAKE_WORKSPACE_EMULATION = true
CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = [
"action-form-error-handling",
"animated_show",
"counter",
"counter_isomorphic",
"counters",
"counters_stable",
"counter_url_query",
"counter_without_macros",
"directives",
"error_boundary",
"errors_axum",
"fetch",
"hackernews",
"hackernews_axum",
"hackernews_islands_axum",
"hackernews_js_fetch",
"js-framework-benchmark",
"login_with_token_csr_only",
"parent_child",
"portal",
"router",
"server_fns_axum",
"session_auth_axum",
"slots",
"spread",
"sso_auth_axum",
"ssr_modes",
"ssr_modes_axum",
"suspense_tests",
"tailwind_actix",
"tailwind_csr",
"tailwind_axum",
"tailwind_csr",
"timer",
"todo_app_sqlite",
"todo_app_sqlite_axum",
"todo_app_sqlite_csr",
"todomvc",
]
@@ -40,11 +47,11 @@ CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = [
workspace = false
description = "Generate the list of workspace members"
script = '''
examples=$(ls |
grep -v .md |
grep -v Makefile.toml |
grep -v cargo-make |
grep -v gtk |
examples=$(ls |
grep -v .md |
grep -v Makefile.toml |
grep -v cargo-make |
grep -v gtk |
jq -R -s -c 'split("\n")[:-1]')
echo "CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = $examples"
'''

View File

@@ -8,7 +8,7 @@ To the extent that new features have been released or breaking changes have been
## 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`](https://trunkrs.dev/) (a simple build system and dev server for client-side-rendered apps) or [`cargo-leptos`](https://github.com/leptos-rs/cargo-leptos) (a build system for server-rendered and client-hydrated apps).
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`](https://trunkrs.dev/) (a simple build system and dev server for client-side-rendered apps) or [`cargo-leptos`](https://github.com/leptos-rs/cargo-leptos) (a build system for server-rendered and client-hydrated apps).
## Using Cargo Make
@@ -17,15 +17,17 @@ You can also run any of the examples using [`cargo-make`](https://github.com/sag
Follow these steps to get any example up and running.
1. `cd` to the example you want to run
2. Run `cargo make ci` to setup and test the example
3. Run `cargo make start` to run the example
4. Open the client URL in the console output (<http://127.0.0.1:8080> or <http://127.0.0.1:3000> by default)
5. Run `cargo make stop` to end any processes started by `cargo make start`.
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](./cargo-make/) directory
- Running a task will automatically install `cargo` dependencies
- Running a task will automatically install `cargo` dependencies
- Each `Makefile.toml` file must extend the [cargo-make/main.toml](./cargo-make/main.toml) file
- [cargo-make](./cargo-make/) files that end in `*-test.toml` configure web testing strategies
- Run `cargo make test-report` to learn which examples have web tests

View File

@@ -11,7 +11,6 @@ actix-files = { version = "0.6", optional = true }
actix-web = { version = "4", optional = true, features = ["macros"] }
console_error_panic_hook = "0.1"
cfg-if = "1"
http = { version = "0.2", optional = true }
leptos = { path = "../../leptos" }
leptos_meta = { path = "../../meta" }
leptos_actix = { path = "../../integrations/actix", optional = true }
@@ -20,8 +19,8 @@ wasm-bindgen = "0.2"
serde = { version = "1", features = ["derive"] }
[features]
csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
csr = ["leptos/csr"]
hydrate = ["leptos/hydrate"]
ssr = [
"dep:actix-files",
"dep:actix-web",

View File

@@ -1,27 +1,18 @@
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
use leptos::{logging, prelude::*};
use leptos_router::{
components::{FlatRoutes, Route, Router},
StaticSegment,
};
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
view! {
// injects a stylesheet into the document <head>
// id=leptos means cargo-leptos will hot-reload this stylesheet
<Stylesheet id="leptos" href="/pkg/leptos_start.css"/>
// sets the document title
<Title text="Welcome to Leptos"/>
// content for this welcome page
<Router>
<main id="app">
<Routes>
<Route path="" view=HomePage/>
<Route path="/*any" view=NotFound/>
</Routes>
<FlatRoutes fallback=NotFound>
<Route path=StaticSegment("") view=HomePage/>
</FlatRoutes>
</main>
</Router>
}
@@ -43,7 +34,7 @@ async fn do_something(
/// Renders the home page of your application.
#[component]
fn HomePage() -> impl IntoView {
let do_something_action = Action::<DoSomething, _>::server();
let do_something_action = ServerAction::<DoSomething>::new();
let value = Signal::derive(move || {
do_something_action
.value()
@@ -57,17 +48,12 @@ fn HomePage() -> impl IntoView {
view! {
<h1>"Test the action form!"</h1>
<ErrorBoundary fallback=move |error| format!("{:#?}", error
.get()
.into_iter()
.next()
.unwrap()
.1.into_inner()
.to_string())
>
{value}
<ActionForm action=do_something_action class="form">
<label>Should error: <input type="checkbox" name="should_error"/></label>
<ErrorBoundary fallback=move |error| {
move || format!("{:#?}", error.get())
}>
<pre>{value}</pre>
<ActionForm action=do_something_action attr:class="form">
<label>"Should error: "<input type="checkbox" name="should_error"/></label>
<button type="submit">Submit</button>
</ActionForm>
</ErrorBoundary>
@@ -91,7 +77,5 @@ fn NotFound() -> impl IntoView {
resp.set_status(actix_web::http::StatusCode::NOT_FOUND);
}
view! {
<h1>"Not Found"</h1>
}
view! { <h1>"Not Found"</h1> }
}

View File

@@ -1,18 +1,11 @@
pub mod app;
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "hydrate")] {
#[cfg(feature = "hydrate")]
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn hydrate() {
use app::*;
use wasm_bindgen::prelude::wasm_bindgen;
console_error_panic_hook::set_once();
#[wasm_bindgen]
pub fn hydrate() {
use app::*;
console_error_panic_hook::set_once();
leptos::mount_to_body(App);
}
}
leptos::mount::hydrate_body(App);
}

View File

@@ -4,25 +4,47 @@ async fn main() -> std::io::Result<()> {
use action_form_error_handling::app::*;
use actix_files::Files;
use actix_web::*;
use leptos::*;
use leptos::prelude::*;
use leptos_actix::{generate_route_list, LeptosRoutes};
use leptos_meta::MetaTags;
let conf = get_configuration(None).await.unwrap();
let addr = conf.leptos_options.site_addr;
// Generate the list of routes in your Leptos App
let routes = generate_route_list(App);
let conf = get_configuration(None).unwrap();
let addr = conf.leptos_options.site_addr;
println!("listening on http://{}", &addr);
HttpServer::new(move || {
// Generate the list of routes in your Leptos App
let routes = generate_route_list(App);
let leptos_options = &conf.leptos_options;
let site_root = &leptos_options.site_root;
App::new()
.route("/api/{tail:.*}", leptos_actix::handle_server_fns())
// serve JS/WASM/CSS from `pkg`
.service(Files::new("/pkg", format!("{site_root}/pkg")))
.leptos_routes(leptos_options.to_owned(), routes.to_owned(), App)
.app_data(web::Data::new(leptos_options.to_owned()))
.leptos_routes(routes, {
let leptos_options = leptos_options.clone();
move || {
use leptos::prelude::*;
view! {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<AutoReload options=leptos_options.clone()/>
<HydrationScripts options=leptos_options.clone()/>
<MetaTags/>
</head>
<body>
<App/>
</body>
</html>
}
}})
//.wrap(middleware::Compress::default())
})
.bind(&addr)?
@@ -44,10 +66,9 @@ pub fn main() {
// prefer using `cargo leptos serve` instead
// to run: `trunk serve --open --features csr`
use action_form_error_handling::app::*;
use leptos::*;
use wasm_bindgen::prelude::wasm_bindgen;
use leptos::prelude::*;
console_error_panic_hook::set_once();
leptos::mount_to_body(App);
mount_to_body(App);
}

View File

@@ -1,14 +0,0 @@
# Animated Show Example
This is a very simple example of the `<AnimatedShow>` component.
The `<AnimatedShow>` component is an extension for the `<Show>` component and it will not take in a fallback, but it will unmount the component from the DOM after a given duration. This makes it possible to have really easy unmount animations with just
CSS.
## Getting Started
See the [Examples README](../README.md) for setup and run instructions.
## Quick Start
Run `trunk serve --open` to run this example.

View File

@@ -1,42 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link data-trunk rel="rust" data-wasm-opt="z"/>
<link data-trunk rel="icon" type="image/ico" href="/public/favicon.ico"/>
<style>
.hover-me {
width: 100px;
margin: 1rem;
padding: 1rem;
text-align: center;
cursor: pointer;
border: 1px solid grey;
}
.here-i-am {
width: 100px;
margin: 1rem;
padding: 1rem;
text-align: center;
color: white;
font-weight: bold;
background: black;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fade-out {
from { opacity: 1; }
to { opacity: 0; }
}
.fade-in-1000 {
animation: 1000ms fade-in forwards;
}
.fade-out-1000 {
animation: 1000ms fade-out forwards;
}
</style>
</head>
<body></body>
</html>

View File

@@ -1,34 +0,0 @@
use core::time::Duration;
use leptos::*;
#[component]
pub fn App() -> impl IntoView {
let show = create_rw_signal(false);
// the CSS classes in this example are just written directly inside the `index.html`
view! {
<div
class="hover-me"
on:mouseenter=move |_| show.set(true)
on:mouseleave=move |_| show.set(false)
>
"Hover Me"
</div>
<AnimatedShow
when=show
// optional CSS class which will be applied if `when == true`
show_class="fade-in-1000"
// optional CSS class which will be applied if `when == false` and before the
// `hide_delay` starts -> makes CSS unmount animations really easy
hide_class="fade-out-1000"
// the given unmount delay which should match your unmount animation duration
hide_delay=Duration::from_millis(1000)
>
// provide any `Children` inside here
<div class="here-i-am">
"Here I Am!"
</div>
</AnimatedShow>
}
}

View File

@@ -1,8 +0,0 @@
use animated_show::App;
use leptos::*;
pub fn main() {
_ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once();
mount_to_body(App);
}

View File

@@ -0,0 +1,44 @@
extend = [
{ path = "./lint.toml" }
]
[tasks.make-target-site-dir]
command = "mkdir"
args = ["-p", "target/site"]
[tasks.install-cargo-leptos]
install_crate = { crate_name = "cargo-leptos", binary = "cargo-leptos", test_arg = "--help" }
[tasks.cargo-leptos-e2e]
command = "cargo"
args = ["leptos", "end-to-end"]
[tasks.build]
clear = true
command = "cargo"
dependencies = ["make-target-site-dir"]
args = ["leptos", "build", "--release", "-P"]
[tasks.check]
clear = true
dependencies = ["check-debug", "check-release"]
[tasks.check-debug]
toolchain = "stable"
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
[tasks.check-release]
toolchain = "stable"
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"
[tasks.lint]
dependencies = ["make-target-site-dir", "check-style"]
[tasks.start-client]
dependencies = ["install-cargo-leptos"]
command = "cargo"
args = ["leptos", "watch", "--release", "-P"]

View File

@@ -15,13 +15,13 @@ clear = true
dependencies = ["check-debug", "check-release"]
[tasks.check-debug]
toolchain = "nightly-2024-01-29"
toolchain = "stable"
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
[tasks.check-release]
toolchain = "nightly-2024-01-29"
toolchain = "stable"
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"

Some files were not shown because too many files have changed in this diff Show More