* Proposed Documentation Improvements
#### Retrieved from https://yew.rs/docs/concepts/wasm-bindgen#jsvalue on 9/24/2022
`JsCast` is nicely structured so far, although I thought this section was worded strangely.
> The `dyn_into` method will consume `self`, as per convention for into methods in Rust, __and the type returned is `Result<T, Self>` this means if the casting fails then the value in `Err` is so you can try again or do something else with the original type.__
I believe this edit conveys the original idea, but makes more sense to the reader:
> The
[`dyn_into`](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen/trait.JsCast.html#method.dyn_into)
method will consume `self`, as per convention for into methods in Rust, and the type returned is
`Result<T, Self>`. This means if the casting fails then the `Self` value in `Err` is preserved. You could try again
or do something else with the original type.
* Update website/versioned_docs/version-0.19.0/concepts/wasm-bindgen/introduction.mdx
Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>
* update latest docs
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>
* fix portal shifting on reconciliation too often
the public vdom api changes to only allow directly
setting a Node as sibling (still optional) instead of a NodeRef.
This was the intention all along, since the NodeRef was
not dynamically tracked, and creating a portal into a subtree
already controlled by yew is not supported anway.
* fix feature soundness
* fix doc tests
* update: Promote use of AttrValue instead of String or Rc<String>
* update: Also mention AttrValue in the elements' page
* format: ran fmt:write to correct formatting issue
* fix: refactor doc comments to conform to compiling rules
* Update introduction.mdx
The `if else` example was syntactically correct, but had a semantic issue of not using the condition variable. Could lead to confusion if you are a newbie.
* Update conditional-rendering.mdx
changed if condition variable in html docs
* Note about tag casing and fixed example
* Added notes about tag casing
* Removed broken part of SVG example
* Slight change to SVG example
* removed some newlines
* Update website/docs/concepts/html/introduction.mdx
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
* RenderFn can be be directly Fn() now.
* Switch switch to function component.
* Make Link a function component.
* Remove non-exhaustive.
* Add migration guide.
* Update Website Docs.
* Fix CI.
* Pushing to Navigator no longer requires an owned instance.
* Fix CI.
* Fix code size.
* Further optimisation.
* Read through the docs and correct spelling and grammar
* Run prettier
* Apply review suggestions
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* adjust translation messages
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* Docs overhaul part2
* fix links and require them for CI
* remove translations for 0.17
* remove a bunch of unused documentation
* run prettier
* fixup links and locations of some translations
* add prettier
* ci
* run prettier
* run prettier in CI
* run prettier --write
* ignore README.md
* specify googleAnalytics
* fmt
* npm run write-translations
* fmt
* ignore i18n json files
they're autogenerated and don't like being formatted
* post merge fixes & some updates
* post merge fixes
I was originally going to put a PR to fix "has not side-effects", but I also re-read this sentence and realized it could be interpreted as saying a pure function returns its parameters, not a deterministic value based on its parameters.
* implement event handling with multiple subtree roots
* add listeners to all subtree roots
* move host element to Registry
* add BSubtree argument
* surface level internal API for BSubtree
* cache invalidation & document limitations
* Update portal documentation
* Add test case for hierarchical event bubbling
* add shadow dom test case
* add button to portals/shadow dom example
* change ShadowRootMode in example to open
BSubtree controls the element where listeners are registered.
we have create_root and create_ssr
Async event dispatching is surprisingly complicated.
Make sure to see #2510 for details, comments and discussion
takes care of catching original events in shadow doms
Figuring out how to use manual event listening with Function Components
took me a while. The new docs already contain a great example!
I add a small cross reference here to make it more discoverable.
Co-authored-by: Peter Kolloch <peter.kolloch@nexxiot.com>
* Convert components concept docs from SC to FC
- moved struct components to advanced topics
- added docs about HOC for Suspense and Context
- added a ease-in topic before components that introduces
HTML/CSS/JS in yew
- edit components concept to use function components
* translations
* fix todo links
* fix tests
* spelling bee
* 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>