9 Commits

Author SHA1 Message Date
Kaede Hoshikawa
f43760e3ca
Update Yew Router as per #2113 (#2118)
* Add Redirect Comp.

* Fix router behaviour.

* Fix output.

* Fix pr-flow.

* Remove Redirect.

* Readd 77b46bf.

* Router Context, History and Location.

* Finish Porting.

* Add Switch, Fix example.

* Add state.

* Fix pr-flow.

* Fix pr-flow.

* Fix unstable feature for 1.49.

* Add documentation.

* Error Types & Simplify Implementation.

* Add some tests.

* Update documentation.

* Fix route outside of a Switch.
2021-11-11 13:08:42 +02:00
mc1098
adb3fcfce1
Update dependencies (#2064)
General review of dependencies, removing ones that are not used and
bumping up minor versions to avoid breakage.

Consistent use of caret so that we use the most recent minor/patch
version of a dependency when building Yew crates.
2021-09-19 11:14:08 +02:00
mc1098
5ea6aec804
Fix multiple field enum tokens (#1988)
A small change so that enums with multiple fields are comma seperated.
2021-08-04 20:44:21 +02:00
Hamza
8fc81b47ee Fix issues after cherry-picking 2021-06-05 23:00:58 +02:00
Muhammad Hamza
5fec49c3c6
Clean-up and optimize router a little bit (#1869)
* fix some spaghetti and make optimization along the way

* don't make DOM API call and re-recognize route every time current route is obtained

This has the drawback of requiring the `Routable` enum to be `Clone`. Generally, this shouldn't be an issue as cloning the value *should* be cheaper than making a DOM API call and then running the route recognition process

* fmt, tests, doc

* fix

* warn, not log

* make utils tests unit tests

* fix macro test

* cleanup router on destroy, update docs

* Clone bound + docs

* apply review
2021-05-31 20:30:50 +02:00
Muhammad Hamza
af440761ed
Rewrite router (#1791)
* rewrite router

* add support for 404 routes

* support base urls

* parse query params

* don't use js snippets lol

* cleanup code, update example

* bruh fmt

* test router

* add more tests

* wasm_test feature, CI

* Add rustdocs

* update docs on website

* use enum for routes, add derive macro for it

* fix 404 handling

* fix tests

* formatting

* update docs, little cleanup

* fix example

* misc fixes

* add routable macro tests

* document routable macro, rustfmt

* fix test, add makefile

* Replace the children based API with callback based one

* update example

* update docs

* update Cargo.toml

* clippy & fmt

* cleanup code

* apply review

* more fixes from review

* fix warnings

* replace function component with struct component, update docs

* formatting

* use `href` getter instead of reading attribute

* apply review

* use serde to parse query parameters

* use js_sys::Array for search_params + formatting

* fix doc test

* Apply suggestions from code review

Co-authored-by: Simon <simon@siku2.io>

* Update docs/concepts/router.md

apply suggestion

Co-authored-by: Simon <simon@siku2.io>

* apply review (part 2)

* use serde for parsing query

* a more modular implementation

* docs for query parameters

* fix doc

* Apply suggestions from code review

Co-authored-by: Simon <simon@siku2.io>

* fixes (from review)

* formatting

* use new functions

* not_found returns `Option<Self>`, to_route -> to_path

* Apply suggestions from code review

Co-authored-by: Simon <simon@siku2.io>

* remove PartialEq + Clone bound

* docs

* fix example

Co-authored-by: Simon <simon@siku2.io>
2021-05-17 17:39:12 +02:00
Jasper
c51ab7f094
Added missing licenses to Cargo.toml files and updated to use SPDX syntax (#1822) 2021-04-25 23:24:14 +02:00
Teymour Aldridge
e0be985082
Replace #[to="..."] attribute with #[at="..."] attribute. (#1717)
* Replace `#[to="..."]` attribute with `#[at="..."]` attribute.

* Fix attribute formatting

* Fix spelling
2021-02-05 18:48:26 +01:00
Philip Peterson
e6a3ae7301
Move top-level crates to packages/<crate> (#1680)
* Move crates to packages/*

* Update Cargo.toml

* Update links

* Fix pull-request.yml

* Update examples Cargo.toml

* Update relative paths

* Update tests

* Fix path
2021-01-12 11:32:48 +08:00