Muhammad Hamza
ab76a446f1
Move yew/services to yew-services crate ( #1693 )
...
* move yew/services to yew-services crate
* fix stdweb examples
* remove services feature usage from workflow
* attempt at making CI pass
* remove unused feature
* add feature i missed during merge
* okay, it should compile now
* apply review
* fix yew-stdweb & aplease fmt
* misc fixes
Co-authored-by: Justin Starry <justin.starry@icloud.com>
2021-01-23 22:49:00 +08: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
Jay Graves
2bbb35027f
Add a ticking clock to the timer example ( #1617 )
...
* Add a ticking clock to the timer example.
* Remove unneeded use of js_sys.
* Update examples/timer/Cargo.toml
Co-authored-by: Simon <simon@siku2.io>
* Update examples/timer/index.html
Co-authored-by: Simon <simon@siku2.io>
* Use local scss instead of Bulma.
* Refactor out the time function and restructure the html.
* Refactor the clock.
Remove Msg::StartClock
Remove Model.clock_job
Model._standalone now takes 2 IntervalTasks
Model.get_current_time is now Static
Renamed Msg::Tock to Msg::UpdateTime
* Remove disabled button style.
* Remove CSS line from improvements.
Co-authored-by: Simon <simon@siku2.io>
2020-10-15 17:56:53 +02:00
Simon
66d506e133
Update documentation for the new examples ( #1586 )
...
* fix todomvc example
* update READMEs now that we're hosting the examples
* update documentation
* add trunk template
* Improve wording
2020-09-23 03:47:28 +02:00
Simon
c946b99610
Overhaul examples ( #1559 )
...
* 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
2020-09-22 00:17:48 +02:00
Teymour Aldridge
e0aec40fe0
Make methods static. ( #1313 )
...
* Make methods static.
* Fix a call.
* Fix examples.
* Fix examples.
* Fix rest of examples.
* Fix yew-functional.
* Fix interval service example.
* Fix webgl example.
* Fix dialogue service example.
* Use `Default` trait instead of `new()` in `npm_and_rest` example.
* Use `Default` trait instead of `new()` in `npm_and_rest` example.
* Remove use of the `Option` algebraic data type.
* Fix clippy warnings.
2020-06-22 15:32:04 +08:00
fbucek
528ec66fbc
updated examples, added build script ( #1165 )
...
* script for building examples
minimal example updated to work with wasm-pack
minimal_wb exampel to be used with wasm-bindgen directly
* minimal is wasm-bindgen as default ( wp wasm-pack )
* examples updated to work with wasm-bindgen
* script to run all yew/examples
* upated example doc, added script to multi-thread
* cargo fmt, disabled build_examples.sh
* one build.sh for examples, updated doc
* removed build size optimalization
* wasm-pack requirement info in lib.rs
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/readme.md
* Update examples/build.sh
Co-Authored-By: Justin Starry <justin.m.starry@gmail.com>
* Update examples/build.sh exit trap
Co-Authored-By: Justin Starry <justin.m.starry@gmail.com>
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
2020-04-29 22:57:55 +08:00
Sebastian Zivota
3b669fab70
Make examples compile with wasm-pack ( #1124 )
...
Co-authored-by: Sebastian Zivota <sebastian.zivota@mailbox.org>
2020-04-24 16:17:59 +08:00
Justin Starry
fa8a1d9f00
Reorganize examples and general repo layout ( #1092 )
...
* Reorganize crates
* Remove symlink
* Check examples
* Cleanup CI scripts
* nits
* cleanup
* cargo fmt
* Fix yew-stdweb
* cargo clippy --all
* stdweb-examples
* run_emscripten_checks.sh
* Fix typo
* fix typo
* yew-stdweb
* Run tests from yew-stdweb
* fix webgl script
2020-04-20 22:22:24 +08:00
Justin Starry
8edf136da6
Make Component::change impl mandatory ( #1071 )
2020-04-04 16:12:07 +08:00
Justin Starry
d38ce422f9
Add support for building with web-sys ( #961 )
...
* Enable travis
* `web-sys` general conversion (#826 )
* Moved patches from different PRs.
* Add bits & pieces and some services.
* Rename `stdweb` feature to `std_web`.
* Move tests and examples to different PR.
* Revert some `cargo_web` handling removal.
* Missed something.
* Implement `console_error_panic_hook`.
* Update Cargo.toml
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* Move document creation to util convenience method (#855 )
* `web-sys` listener conversion (#813 )
* `web-sys` listener initial try.
* Improve macros?
* Remove generic from `EventListenerHandle`.
* Fix build.
* A cleaner solution?
* Even cleaner.
* Fix `build.rs`.
* Minor improvements.
* Following the yew toml style.
* Fixing visibility.
* Fix `rustfmt`.
* Add `web-sys` re-exports.
* Move general changes to different PR.
* Remove compat.
* Actually remove `compat.rs`.
* Rename `stdweb` feature to `std_web`.
* Move to gloo's `EventListener` and some polish.
* Remove outdated comment.
* Change `EventHandler` to be cancelled on drop.
* `web-sys` html conversion (#817 )
* Converting all `html` parts.
* Format.
* Move general changes to different PR.
* Removed compat.
* Rename `stdweb` feature to `std_web`.
* Remove redudant function copy.
* Some polish.
* Move to gloo's `EventListener`.
* Replace `unwrap`s with `expect`s.
* `web-sys` agent conversion (#818 )
* Converting `agent`.
* Remove wrong `cfg` in imports.
* Move general changes to different PR.
* Some optimisations.
* Rename `stdweb` feature to `std_web`.
* Fix `ArrayBuffer` to `Uint8Array` conversions.
* Add js module worker.
* Use `cfg-if`` and `cfg-match` to make things clearer.
* Fix `std_web` build.
* Add some polish.
* Add build guards for invalid build configs (#866 )
* `web_sys` cfg conversion (#862 )
* Use `cfg-if` and `cfg-match` and some polish.
* Mistakes were made.
* Missed line during rebasing.
* Mistakes were undone.
* Remove global.
* Remove part of `global!`.
* `web-sys` services conversion (#827 )
* Convert `console`.
* Finish services.
* Some polish.
* Fix `ArrayBuffer` to `Uint8Array` conversions.
* Fix aborting fetch leading to error and some polish.
* Replaced some `unwrap`s with `expect`s.
* Use `cfg_if` and `cfg_match` and do some polish.
* Proper scoping.
* Some fixes.
* Move fetch and reader services to different PR.
* Revert split.
* Fix CI builds (#877 )
* Fix derive_props_test
* Move tests (#897 ) (#898 )
* `web-sys` fetch service conversion (#867 )
* Split implementation.
* Import global.
* Import global.
* Revert split.
* Make fetch available again.
* Revert "Revert split."
This reverts commit 6e3f101dbedde2142f041467a8ae40ef5e3920c5.
* Re-revert split.
* Some polish.
* Move to `wasm_bindgen_futures`.
* Switch to `thiserror`.
* wip
* Update src/services/fetch/web_sys.rs
Co-Authored-By: daxpedda <daxpedda@gmail.com>
* Some more polish.
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
* `web-sys` reader service conversion (#868 )
* Split reader implementation.
* Revert split.
* Remove leftover files.
* Make reader available again.
* Revert "Revert split."
This reverts commit 8abdc9cf2b014ab61fef2c48d1af8927d9a5a330.
* Revert "Remove leftover files."
This reverts commit 188c6eb9693881c9987061de8deb29c6f4c613a4.
* Re-revert split.
* Polish.
* Forgot some part.
* Some polish.
* Some polish.
* `web-sys` examples/tests conversion (#841 )
* Fix examples/tests to work with `web_sys`.
* Update `StorageService` usage.
* Split `stdweb` and `web-sys` examples.
* Fixing the shell script.
* Trying to reset file permissions.
* Update to new reader API.
* Update to new fetch API.
* Update to new fetch API.
* Re-enable examples CI.
* Deleted duplicate example.
* Some fixes.
* Fix rand build.
* Fix spawning workers in combination with `wasm-bindgen`. (#901 )
* Fix component rendering process (#913 )
* wip
* Fix component rendering process
* Simplify yew-macro a bit (#902 )
* yew-macro: Simplify Properties validation
* Fix most clippy warnings
* Fix clippy warnings (#912 )
* Import Task trait in dashboard example
* Remove duplicate vtag tests
* Fix prevent_default() by non-passive (#958 )
* Fix prevent_default() by non-passive
* Fix cargo fmt
* Remove `Option` from most services.
* Remove `Option` from resize service.
* Apply fetch changes.
* Apply reader service changes.
* Fix `node_refs` example.
* Remove web-sys travis branch
Co-authored-by: daxpedda <daxpedda@gmail.com>
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Jet Li <jing.i.qin@icloud.com>
2020-02-29 17:25:42 +08:00
Konstantin Matsiushonok
5629f37b57
fix(task): remove cancel method from Task trait( #884 ) ( #899 )
...
In order to avoid misuse It was decided to remove `cancel` from `Task` trait
and delegate such logic to `Drop`.
2020-01-28 08:12:56 +08:00
Justin Starry
f61667be97
Remove generics from virtual dom ( #783 )
...
* Fix tests
* Remove generics from virtual dom
* Prep for degenerify
* Fix examples
* Remove props cloning
* Fix tests
2019-12-08 10:47:51 -08:00
Justin Starry
f48bc90edb
Use callbacks in examples ( #781 )
2019-12-07 16:56:26 -08:00
Justin Starry
ffbb9e0ac3
Rename methods and loosen mutability for component link and agent ( #780 )
...
* Rename methods and loosen mutability for component link and agent
* Update send_back to callback
* mut link -> link
2019-12-07 18:18:33 -05:00
Benjamin Reynolds
01c0dd0633
Use trait objects with explicit dyn in examples ( #687 )
...
Fixes #685
Address deprecations warnings in the examples directory:
warning: trait objects without an explicit `dyn` are deprecated
2019-10-08 09:53:44 -04:00
Justin Starry
43e9347269
Add render method to Component and auto implement Renderable ( #563 )
...
* Add render method to Component and auto implement Renderable
* More cleanup
* Rename Renderable method from view to render
* Doc fixes
* fix
* Update CHANGELOG.md
2019-09-30 22:23:25 -04:00
Justin Starry
38300e6597
cargo fmt --all
2019-07-30 00:51:18 -04:00
Justin Starry
fe3d6249d3
Use updated jsx syntax in examples and documentation
2019-07-05 21:49:12 -04:00
Justin Starry
f9cf5ea47f
Bump example recursion limits
2019-06-13 10:29:53 -04:00
Denis Kolodin
2a1903cb4d
Update all examples to Rust 2018
2019-02-02 16:03:07 +03:00
Denis Kolodin
fc7f7a97ea
Add start_app method
2019-02-02 01:26:04 +03:00
Denis Kolodin
07573eb4b8
Require mutable reference for send_back method call
2018-08-20 21:40:24 +03:00
Denis Kolodin
126f847d34
Remove CTX type of examples
2018-06-08 09:44:20 +03:00
Denis Kolodin
e73f025b09
Remove context argument from examples
2018-06-08 09:44:20 +03:00
Denis Kolodin
a8dd243d09
Add component's link to all examples
2018-06-08 09:44:20 +03:00
Denis Kolodin
ffd8a9890c
Rename Msg type of Component to Message
2018-04-26 15:47:33 +03:00
Denis Kolodin
4eb37aed55
Adapt examples to a new loop with a scheduler
2018-04-25 11:52:13 +03:00
Denis Kolodin
deb838b2e1
Fix examples for the new context reference
2018-04-23 22:54:24 +03:00
Denis Kolodin
992c4e21a7
Hide Scope behind App
2018-04-20 22:24:52 +03:00
Denis Kolodin
6530de086c
Example of a standalone callback which sends nothing to a scope
2018-04-20 20:46:03 +03:00
Denis Kolodin
8f227f949b
Move examplef out of showcase
2018-04-15 09:41:51 +03:00
Denis Kolodin
86af2b9d1c
Move demos into the showcase
2018-04-09 22:04:57 +03:00
Denis Kolodin
1cec52140f
Set properties on component creation
...
Fixes bug with initial value in custom_components example
2018-02-08 22:05:37 +03:00
Denis Kolodin
daf1ddd51d
Add Renderable trait, remove redundant App struct, rename ScopeRef to Env
2018-01-15 02:07:47 +03:00
Denis Kolodin
4618497bf7
Merge branch 'master' into components
2018-01-12 22:43:20 +03:00
Denis Kolodin
8a6f387eac
Fix missing docs
2018-01-12 10:57:24 +03:00
Denis Kolodin
7b758fbd1e
Fix all examples
2018-01-12 01:53:18 +03:00
Denis Kolodin
808d8b4fab
Add create method to Component trait
...
And remove Default trait requirement.
2018-01-09 10:47:20 +03:00
Denis Kolodin
5cd1fc688d
Rewrite examples with Component approach
...
Models were not split into multiple small components
2018-01-09 01:20:11 +03:00
Denis Kolodin
baaaaf1a2e
Merge pull request #85 from rivertam/mount-point
...
Add mount points
2018-01-07 12:09:17 +03:00
Denis Kolodin
4a1873e79d
Rename land method to mount
2018-01-07 11:53:11 +03:00
rbalicki2
51a310117a
fix a bunch of typos
2018-01-06 22:35:56 -05:00
Denis Kolodin
85ef55f8c9
Extract event loop from App instance
2018-01-06 16:52:45 +03:00
Denis Kolodin
70e0786277
Add support of used-defined contexts to TimeoutService and IntervalService
2017-12-31 19:00:36 +03:00
Denis Kolodin
665223066b
Remove name parameter from count method of the console service
...
Remove trace call from timer demo.
2017-12-29 23:40:40 +03:00
Ben Berman
6304d989cb
Add many console methods
2017-12-29 15:16:06 -05:00
Denis Kolodin
c28f985e20
Little refactoring and cleaning
2017-12-29 08:31:54 +03:00
雷东升
9420386cdd
add ConsoleService
2017-12-29 12:21:35 +08:00
Denis Kolodin
ce864db352
Add Interval Service to Timer example
2017-12-26 22:15:15 +03:00