* made <textarea> a void element
* added defaultvalue special attr to <textarea>
* updated error message when trying to pass children to textarea
* updated docs, fixed formatting
* fixed hydration test
* fixed suspense test
* fixed heading in docs
* fixed clippy warnings
* fixed SSR, added SSR test for precedence of value over defaultvalue
* fixing wasm-bindgen-test screwups & replacing deprecated function use
* modernize github workflows
this mainly fixes some inconsistencies in style, outdated or wrong comments and action version
- replace Legit-Labs/action-download-artifact with actions/download-artifact
- fix Swatinem/rust-cache arguments
- fix benchmark transformations
- expand feature soundness lints
- wording and capitalization in comments
* fix no_run on crate level doc
* fix some more small issues
* Split repository into multiple workspaces, update CI
* pull_request_target for build-website workflow
This should allow the workflow to read secrets instead of requiring a different, publish-website workflow to be needed to publish the side
* pull_request_target for build-api-docs workflow
This should allow the workflow to read secrets instead of requiring a different, publish-api-docs workflow to be needed to publish the side
* use `paths` instead of `path_ignore` for examples
* cleanup main-checks.yml
* it's rustfmt, not fmt
* correct paths for workflow files
* it's rustfmt, not fmt: part 2 electric bolgoo
* me idiot: part infinity
* ???
* main checks should be the same then?
* ??? part 2
* it should work now
* more fixes
* checkout before using file, actually use stable for wasm-bindgen-cli
* Revert "pull_request_target for build-api-docs workflow"
This reverts commit 38977292c8.
* Revert "pull_request_target for build-website workflow"
This reverts commit 1638a0cd24.
* Benchmark workflow uses pull_request event
* pull_request for size-cmp
- Remove agents example
- Agents example is replaced by web_worker_fib as they both serve the same purpose now that trunk 0.15 has been released
- Clean up CI setup and ensure that examples are deployed in publish-examples.yml as they're built in size-cmp.yml
* simple counter application with functional components
* clean up some comments
* use the word 'function' instead of 'functional'
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* add the counter functional example package to workspace root cargo toml
* add data-trunk link tag in index html
* include counter functional into the examples readme file
Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
* 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)
* example of function memory game
* refactor: remove unnecessary manual PartialEq implementation
* refactor: remove unnecessary license note
* refactor: update implementation and doc with suggestions
* refactor: fix format and lint issues
* 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.
* correctly reflect the status of multi_thread example
* commiting a partially working example ported from 0.18 to next
* make the app actually start
* remove example from github workflows
* rust-fmt
* cargo make pr-flow done succesfully :)
* update per comments
* fix build errors
* fix cargo fmt
* fix stuff
* Apply suggestions from code review
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Update examples/web_worker_fib/src/app.rs
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
* Remove space
* Update .github/workflows/publish-examples.yml
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
Co-authored-by: SpanishPear <shrey.somaiya@gmail.com>
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
* Remove crm example
* Add password_strength example
* Update README
* Remove .DS_Store
* Update README
* Cargo fmt
* Apply suggestions from code review
* Update list of examples
* update the pr to work with latest master
* fix readme
* add newline
Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Julius Lungys <32368314+voidpumpkin@users.noreply.github.com>
* feat(examples): add function components todo example
* chore(examples): apply feedback for function components example
* chore(examples): apply more feedback for function components example
* feat(examples): implement custom hook for edit boolean toggle
* chore(examples): prep for merge, add more documentation
* chore(examples): add more descriptive comment to function component hook, fix cargo.toml
* 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
* Naive implementation of destroy app
* Move functions get_component_link and destroy
The function get_component_link and destroy on App does not require
Component::Properties to be Default. So move them to their own impl
block.
* Change the fn signatures for the other mount fns too
* Add example of how to use the apps dynamically
* Rename example
* Change title of example html file
* Update examples/dyn_create_destroy_apps/src/counter.rs
Co-authored-by: Simon <simon@siku2.io>
* Change fn signatures of App to not take Self
* app.rs thorugh to public API: only make it possible to create an
instance of an App by mounting it. And only make it possible to mount
an App by creating it. This prevents double mounting.
* Change Scope::mount_in_place to take &self instead of self, because it
doesn't have too.
* Fix examples to compile with new App signature
* Fix tests to compile with new App signature
* Remove pub pulic App::mount* API
* Make the documentation compile again with the new start_app API
* Make the examples compile again with the new start_app API
* Make the yew packages compile again with the new start_app API
* rename module yew::app to yew::app_handle
* Fix identation in styling file for dyn_create_destroy_app ex
* Fix naming in examples/dyn_create_destroy_apps/README.md
Co-authored-by: Simon <simon@siku2.io>
* Use Self instead of AppHandle to create AppHandle
Co-authored-by: Simon <simon@siku2.io>
* Fix the start_app_in_body docs
Co-authored-by: Simon <simon@siku2.io>
* Remove comparison with Elm in the start_app docs
Co-authored-by: Simon <simon@siku2.io>
* Fix english in dyn_create_destroy_apps example
Co-authored-by: Simon <simon@siku2.io>
* Impl Deref instead of AsRef for AppHandle
* Formatting
* Remove AppHandle::new use Default trait instead
* Rename the Yew::start_app* function names
* Revert "Remove AppHandle::new use Default trait instead"
This reverts commit 97e4897c1e.
* remove default impl for AppHandle
* Make the tests compile again
* Make the examples compile again
* Add dyn_create_destroy_apps to examples/README.md
* Remove mount_to_body_with_props
Co-authored-by: Simon <simon@siku2.io>
* Use yew getters instead of query selectors
Co-authored-by: Simon <simon@siku2.io>
* Remove AppHandle::new
* Remove unused function
* code style fix
* Fix compile error
* Add func set_custom_panic_hook
This commit adds the function set_custom_panic_hook. In addition Yew
will now check if a custom panic is registered when one of start_app*
functions are called, if that is not the case a default panic hook is
registered.
* Fix docs for set_custom_panic_hook
Co-authored-by: Simon <simon@siku2.io>
Co-authored-by: Nicklas Warming Jacobsen <nwj@skybox.gg>
Co-authored-by: Simon <simon@siku2.io>
* Add attribute macro for functional components
* make rustfmt happy
* add docstring for macro
* Add example for functional components
* make rustfmt and clippy happy
* oops
* https://tenor.com/view/come-on-brad-gregory-upset-freaking-out-overwhelmed-gif-17476366
* remove functional example
* remove useless feature, fix order of deps, fix docs
* various fixes
* make rustfmt happy
* oopsie
* bruh i forgot
* handle generics, box Block
* handle >1 parameters
* don't do `TokenStream1`, make rustfmt happy
* ensure const, async and extern functions can't be used, better error messages
* thanks rustfmt
* transparently consume FnArg
* add tests, fix error message
* seriously?
* fix these 2
* More test cases, better errors, formatting
* docs
* properly use #![no_implicit_prelude] for passing tests
* pass all attributes as is
* add Makefile.toml
* docs
* update test
* docs
* hooks docs
* Add docs for FunctionalProvider trait
* oopsie
* is this it?
* lets try this
* bruh moment
* better error message for bad return type, use function name for function struct, fix order in dictionary.txt
* better error messages
* replace `function` with `functional`
* completely replace `function` with `functional`
* completely replace `functional` with `function`: part 2
Missed this in previous commit
* revert package/crate names back
* formatting + fix workflow
* proc macros are fragile
* fix what i broke
* fixes
* Update docs
Co-authored-by: Simon <simon@siku2.io>
* Improve examples in docs
Co-authored-by: Simon <simon@siku2.io>
* update how #[function_component(_)] is explained
* finish "macro" -> "attribute", docs updates
* move contribute note to the top
* update #[function_component(_)] docstring
* Update docs
Co-authored-by: Simon <simon@siku2.io>
* oops, missed this
Co-authored-by: Simon <simon@siku2.io>
* Move hello world to a more appropriate place
* forgot to update the stderr file
* apparently this example didn't compile
* improve example
Co-authored-by: Simon <simon@siku2.io>
* remove old files
* update counter
* update crm example
* Add readme for counter
* update custom_components
* update webgl example
* update two_apps
* update todomvc
* mark special case multithread
* update dashboard
* update examples readme
* file_upload example
* fragments example
* futures example
* game_of_life example
* inner_html example
* js_callback example
* keyed_list example
* remove large_table
* remove minimal
* mount_point example
* I can't count apparently
* nested_list example
* node_refs example
* timer example
* store example
* pub_sub example
* rip npm_and_my_sanity
* use a title™️
* clean up multi_thread
* fix format
* boids part 1
* boids part 2
* add workflow
See: <https://github.com/siku2/yew/pull/13>
* remove my little scratchpad again
* add boids to examples table
* runtime-generated list in nested_list example
* update workflow
* first batch of yewtil examples
* clippy "futures"
* remove old yew-router examples
* add a new router example to the main examples
* remove remaining yewtil examples
* more progress
* update for testing purposes
* author list
* improve content generation
* revert this mistake
I thought it would be great to use `unimplemented!()` in case the component doesn't have any properties.
This helps avoid the mistake of forgetting to update the change method when adding props later on.
What I didn't consider is that just because the props are () that doesn't mean that Yew isn't going to call it...
So yeah, it's still a good idea for update, but certainly not for change.
* missed a few
* turn router switch example into test
* seems to be working
* make it possible to host the router example on a sub-path
* create a 404 file for SPA
* remove the three examples and update table
* remove the 404 file because it isn't working anyway
* fix small router issue relating to the sub-path hack
* It appears!
* boid example works well (#1539)
* remove clippy and fmt warnings (#1539)
* fix typo and remove vector.add, sub, mul (#1539)
* remove triangle
* rename the filename
* remove fmt errors
* define size square function (#1540)
* clippy in tests
* add pull request workflow
* fix formatting
* add names to steps
* fix clippy
* update
* avoid mutable
* use wasm target
* install it too
* except there
* let's give chrome a spin
* clippy has some more to say
* only run specific tests
* fix tests on chrome
* add cache
* rename benchmark for consistency
* re-enable geckodriver
* clean up old files
* remove all mentions of Travis
* check all examples
* let's try with a bigger timeout
* test both browsers at the same time
* chrome really doesn't like me
* finish up
* run for pushes to master
* improve caching
* fix order in workspace members
* clippy use --all-targets
* rename workflow file
* Apply suggestions from code review
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* use stable toolchain for lints
* run lints on nightly too
* add doctest for yew-stdweb
* allow failure for nightly clippy steps
* let's try it on the job level again
* always run all lint steps
* only run lints on stable toolchain
* use 'no_run' instead of 'ignore'
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* New example to showcase keyed elems reordering issue
* Allow building examples in release mode
* Fix ordering issue with keyed virtual nodes
* review comments for build.sh
* review comments for examples/keyed_list
* fix style.css to keyed_list example
* remove ahash
* Add GitHub issue to TODO in key.rs
* Address some review comments in virtual_dom
* New diffing algorithm for keyed vlists
* Add forgotten dependency for yew-stdweb
* Add tests for vlist diffing
* Removed VDiffNodePosition
* Fix usage of next_sibling for vlist
* Fix tests for stdweb
* Mitigate issue with moving VLists when children are all VLists
Note: The new UT is failing, I now. I want to discuss that before
maybe fixing it (moving all VList children?).
* Fix issue with inserting into vlist that is not last child
* Refactor VDiff trait to make way for keyed list fixes
* Fix quote_spanned macro invocations
* Revert some minor changes (style, Debug)
* Revert some minor changes (style, Debug)
* Fix self-referencing NodeRef issue
* All VList tests pass
* Fix algorithm choice in degenerated case
* Remove stdweb and non keyed tests
* Key from finite list of types
* WIP moving VList tests to diff_layouts
* Removed unnecessary Vec
* Fix VComp NodeRef self linking issue
* Add logs to diff_layouts tests
* WIP moving VList tests to diff_layouts
* WIP Failing test moving VComp
* Add VComp move_before
* Fix list component change method
* Fix bad merge
* Add more protection against node ref cycles
* Remove commented tests
* Feedback and clippy
* Failing test
* tests pass
Co-authored-by: Justin Starry <justin.starry@icloud.com>
* first sketch of a stateful agent
* share the data with listeners only immutably
* rename the stateful agent to Store
* moved stuff around, fixed missing parts
* removed a useless directory
* fmt fixes
* added missing comments