* fix docs.rs logo url
* fix formatting
* bump docusaurus to beta14
* bring back the semicolon
* cache npm for build-website workflow
* Add prebuilt cargo-sweep binary
* Optimize website CI
* per-job caching, stale cache invalidation
* extract fmt job as workflow
move website test as a prerequisite for publish
* fix typo in cargo-sweep executable path
* chmod +x
* rename to main-checks.yml
* --exclude has to be used with --workspace
* revert accidental revert
* Switch from cargo-sweep to rust-cache
* link to this related issue of extra brackets
* remove blanks
* exclude website-test in main tests
* rename suffixes from .mdx to .md
* replace actions-rs/install with wasm-pack-action
fixes#2351
* shouldn't ignore .md because website snippet tests depends on .md files and there can be
#[doc(include("../some.md"))] in the code
* restore accidentally deleted mdx files
* include tools/website-test (for real this time)
* Reorganize docs
* delete wasm-build-tools.mdx
* more small updates
* i hate versioned docs
* seems like I've got the traits of the certain owl who guards over the civilization when it comes to `;`
* just work please
* Update website/docs/concepts/components/lifecycle.mdx
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
* little things
* post merge fixes
* npm update
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
* Make Html a Result.
* Fix tests.
* Implement Suspense.
* Schedule render when suspension is resumed.
* Shift children into a detached node.
* styled example.
* Update wording a little bit.
* Move hint to hint.
* Add some tests.
* Fix clippy.
* Add docs.
* Add to sidebar.
* Fix syntax highlight.
* Component -> BaseComponent.
* Html -> VNode, HtmlResult = RenderResult<Html>.
* Suspendible Function Component.
* Add a method to create suspension from futures.
* Revert extra changes.
* Fix tests.
* Update documentation.
* Switch to custom trait to make test reliable.
* Fix file permission.
* Fix docs.
* Remove log.
* Fix file permission.
* Fix component name error.
* Make Suspension a future.
* yeet Callback::once
* yeet Callback::reform
* remove passive overrides
Event's passive state will be determined by sane defaults set by Yew
* clippy
* docs
* make CI happy
* Revert "yeet Callback::reform"
This reverts commit 33e7770d
* why?
I literally tick-marked reformat before commit. Does it not use rustfmt???
* Update packages/yew/src/callback.rs
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
* remove backticks on wasm-bindgen
* make themed svg for agent life cycle
* wording
* Revert "make themed svg for agent life cycle"
This reverts commit 3b3a892bd36dc9da4b1d8d756b2964a8be707f7c.
* Revert "Revert "make themed svg for agent life cycle""
This reverts commit 5ac75821a15db6063227c4f10557899f07b847a7.
* wording
* jetbrains tips update
* change suffixes from md to mdx
fix broken links for English locale
tree shake and update docusaurus
add docusaurus ideal image plugin
use svg and themed image
delete unused static asset
* move localized landing page
* change GitLocalize project page
* nit pick
* remove ignore to have the block checked
* Use From<Cow> of AttrValue in Link component
* docs about `BrowserHistory::default()`
* remove unused cow import
* remove unused cow import
* lint
* More accurate `BrowserHistory::default()` tips
* Update website/docs/concepts/router.md
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
* Update website/docs/concepts/router.md
Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
Co-authored-by: Simon <simon@siku2.io>
* some documentation fixes
* more fixes
* why it didn't work before is beyond me
* next redirect
* change 0.18 docs folder structure to make it inline with next
* move docs to /docs
now that home is its own page, docs should be under `/docs/`
* tag 0.19.0 version on website
* nested router structure diagram
* add Redirect, nested router documentation.
* add reminder
* fix the comment, duh
* snippets get tested too unless ignored
* fix inconsistent var name in snippet
* Add redirect to nested router example
normal component -> struct component
* Document about acceptable types for path segment
Document about router behaviour at fail to parse
* add missing ignore to snippet
* typo
* normal -> struct
* reformat codeblock and the markdown
functional comp -> function comp
consistent code snippet style
removed two ignores
* add back ignores
* typo, snippet correction. grammar.
* correction
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Add key docs
* add frogments to sodebar
* remove duplicate title
* Apply suggestions from code review
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Apply suggestions from code review
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* remove html comments
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* Initial commit
Forked at: 66d506e13329a06f7dce0b55a9427972b8aad3ff
Parent branch: origin/master
* Add the ability to add child nodes conditionally in html!
* WIP
Forked at: 66d506e13329a06f7dce0b55a9427972b8aad3ff
Parent branch: origin/master
* CLEANUP
Forked at: 66d506e13329a06f7dce0b55a9427972b8aad3ff
Parent branch: origin/master
* Experiment
* Failing test
* More tests
* More tests
* Add new HtmlIterable with syntax `for {...}` instead of `{for ...}`
* Remove HtmlIf from HtmlRoot (already done in HtmlTree)
* WIP
* WIP
* WIP
* WIP
* Revert
* CLEANUP
* WIP
* CLEANUP
* Remove IterableNew
* Renamed HtmlBranch to HtmlRootBraced and moved to mod.rs
* Update yew-macro/tests/html_macro/html-if-pass.rs
Co-authored-by: Simon <simon@siku2.io>
* Suggestion
* Oops
* Added ToNodeIterator to HtmlIf
* Improve error spans
* More html!()
* Move tests to not use browser
* Multiple children in if-expr
* Clippy fix
* Clippy fix again
* Re-trigger CI
* Apply suggestions from code review
Co-authored-by: Simon <simon@siku2.io>
* Replacing ParseResult by syn::Result everywhere
* Remove unnecessary &mut
* Attempt to add test on ToNodeIterator
* Clippy fixes
* Still works for some reason
* Revert "Attempt to add test on ToNodeIterator"
This reverts commit 75b1a85c28df36ad8bf61344eef56e06667da3b6.
* fix CI
* add docs on website
* Apply suggestions from code review
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* apparently I can't hide lines on website
* update stderr file
* will this work?
* fix bug where conditions can't be expressions
* better error message
* clippy & fmt
Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Hamza <muhammadhamza1311@gmail.com>
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* docs: how to add parameters on route
* docs: how to listen for route changes
* docs: how to link to parameterized routes
* docs: router polish
* docs: make router tests pass
* Refactor use ref hooks
`use_ref` has been renamed to `use_mut_ref` and `use_ref` has become a
similar hook for immutable reference.
This is different from React but I think lines up nicely with Rust as a
reference is immutable unless specified to be a mut ref.
* fix CI
Co-authored-by: Hamza <muhammadhamza1311@gmail.com>
* Add documentation for wasm-bindgen
Adds a wasm-bindgen section to docs and gives a high level
description of it's crates and how they are used with Yew.
* Fix typos and formatting
* Expand JS example section
* fix re-export web_sys through yew info
* Add HtmlSelectElement feature
* Fix identing
* Fix code example comment
* Remove `web_sys` re-export
Removes re-exporting the `web_sys` dependency from the yew crate and
removes some `web_sys` features that were only enabled for re-exporting.
* re-export events through yew::events
The events page made a specific reference to the currentTarget of an
event and provided a link to MDN, however, Yew events have the
currentTarget of `body` when using the `html!` macro because of the global mutliplexer.
* Add documentation for possible infinite loops
Explains with an example of how a component could cause an infinite loop
to occur. This applies to both `v0.18` and `master`.
* Capitalize "Yew"
Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Simon <simon@siku2.io>
* Reword to use double-dot syntax instead of "with"
* Implement double-dot syntax for props in components
* Update documentation with new syntax
* Update forgotten doc
* Add descriptive comments
* Check props and base expression
* Make compatible with 1.49.0 by removing then
* Fix website tests
* Update error output
* Implicitly convert string literals to String if they are listed as props
* Remove unused keyword
* Rename function for checking if string literal
* Fix weird formatting
* Update code based on review
* Update website/docs/concepts/html/components.md
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Base expression span includes dot2 now
* Improve specificity of error message
* Chain together error messages
* Add an example failure case to illustrate combined error message
* Update based on review comments
* Fix missing clones
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Add doc-test to test website code snippets
Heavily inspired by tokio-rs/website repo.
* Fix code snippets to pass doc tests
Some code snippets are explicitly ignored and some are not run
to avoid having to include dependencies for one liners.
* Add website code snippet tests to CI
* Fix CI
* Remove doc-test from workspace
* Exclude doc-test from workspace
* Refactor code snippets and tests
Code snippets can import types from doc_test crate i.e.:
```rust
use doc_test::agents::EventBus;
```
This allows for moving some boilerplate away from the example and still
checks that the code compiles correctly.
Also some slight changes to some of the examples and the information
about `ComponentLink` which is deprecated.
* Move doc-test to packages
* Rename doc-test crate to website-test
The new name makes it more clear the purpose of this crate.
* fix ci
* Add documentation for VRef
Documents the way that VRef can be used to hold a web-sys Node value in
Yew.
* Improve phrasing and correct example mistake
Single quotes to double for strings, thankfully we are in Rust not JS