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
..
2021-05-17 17:39:12 +02:00
2021-05-05 21:36:50 +02:00
2021-05-05 21:36:50 +02:00
2020-09-20 13:50:52 +08:00
2021-01-24 00:14:15 +08:00

Contributing to the documentation

Firstly, thanks for considering contributing to Yew. We're a friendly community of humans who collaborate to build (hopefully) awesome software. We try to write software which is easy to use so we ask that you follow a few guidelines when contributing these are laid out in this document.

Note that this document is about contributing documentation not contributing code and only applies to the contents of the docs folder not any other parts of the project.

Can I just submit a PR or do I need to create an issue first?

PRs not attached to previously created issues are welcome if they're a small change. This could be something like fixing a small grammar mistake or a typo.

If your PR is something bigger create an issue beforehand. This will save everyone time and effort:

  1. Multiple people don't end up submitting duplicate PRs doing the same thing.
  2. People have a chance to submit feedback on an idea before someone does a lot of work on it.
  3. It's easy to track progress on the development of the documentation.

Spelling and grammar

We recognize that not everyone who contributes to Yew will have "perfect" grammar or be a native English speaker. We're all human; everyone makes mistakes and nobody will look down on you if you make typos or grammar mistakes (we'll just fix them, merge PRs and move on with life).

To help catch spelling mistakes, we use a spellchecking script which originally came from the Rust Book. If it picks up a spelling "mistake" which isn't actually a mistake, then please add it to the list in ci/dictionary.txt (in alphabetically sorted order).

If in doubt about spelling, grammar or style you might find it useful to consult the Microsoft Style Guide which we sometimes use as a handy reference.

Line wrap

Having really long lines makes it hard to review code and see differences between versions. To solve this problem all lines should be wrapped at 100 characters.

If you're editing a line which is more than 100 characters long, please feel free to shorten it!