39 Commits

Author SHA1 Message Date
Michal Kawalec
6e418ae9ae
added a simple send_message in Agent example (#1234)
* added a simple send_message in Agent example

* missing comma
2020-05-16 14:13:49 +08:00
Michal Kawalec
eb841bb7cf
Conditially require serialize (#1195)
* conditially require serialize

* we're using a trait alias and a clearer implementation of the constraints

* after merging with separated agent

* no trait aliases :(

* specialized the types for Drop a bit

* added an additional constraint on an agent

* emitted with fmt fixes

* dropped the useless debug constraint on the input

* fix stdweb examples

* dropped unneeded debug constraints

* linter
2020-05-12 16:43:21 +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
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
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
Leo Ribeiro
d1180c0369 fix native_worker.js 404 error (#900)
* fix native_worker.js 404 error

* fix contribute link

* drops contribute link
2020-01-28 10:56:53 +08:00
Philip Peterson
bf06e36eb7 Some simple proposed renames (#751)
* AgentUpdate -> AgentLifecycleEvent

* Responder::response -> Responder::respond

* AgentLink::response -> AgentLink::respond

* Agent::handle -> Agent::handle_input
2019-12-08 11:03:35 -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
Proesmans Bert
def59a0079 Fixed Multi Thread example (#784)
Link field was not provided on struct Model
2019-12-08 08:58:48 -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
Justin Starry
e08b33d0cd
Fix multi_thread example (#689) 2019-10-09 15:29:52 -04: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
Henry Zimmerman
74583ed64e Remove Transferable trait (#319)
* remove transferable trait

* remove transferable from router example, run cargo fmt

* cargo fmt

* Remove Transferable from multi_thread example
2019-09-29 23:26:29 -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
3963dc3dea Remove old html macro, default to new proc macro 2019-07-02 14:38:35 -04:00
NaokiM03
3023aaa511 Fix script src of examples 2019-02-16 10:32:57 +03:00
Denis Kolodin
2a1903cb4d Update all examples to Rust 2018 2019-02-02 16:03:07 +03:00
Prasanna V. Loganathar
efce1ad087
fix: multi-thread example: link needs to be mutable 2018-11-07 19:26:23 +05:30
Denis Kolodin
bee775616f Detach worker registration from a main initialization routine
Workers become more compact with simple type specification.
2018-06-09 16:23:14 +03:00
Denis Kolodin
7451005c28 Implement separate thread worker with a bridge 2018-06-08 09:44:20 +03:00
Denis Kolodin
d340aaf356 Add a completely new Context based on actors model (agent) 2018-06-08 09:44:20 +03:00
Denis Kolodin
abc9408147 Add local job and a prototype of actored context 2018-06-08 09:44:20 +03:00
Denis Kolodin
0a30abc1b8 Add visibility scopes for agents 2018-06-08 09:44:20 +03:00
Denis Kolodin
258d55f465 Rename Message trait to Transferable
TO avoid confusion with Message of Component
2018-06-08 09:44:20 +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
f9d25a6dff Separate component link off a context 2018-06-08 09:44:20 +03:00
Denis Kolodin
d40b91195d Refactor prelude module for workers 2018-06-08 09:44:20 +03:00
Denis Kolodin
febcb65889 Remove context from multi-thread example 2018-06-08 09:44:20 +03:00
Denis Kolodin
39716ce6aa Implement responses for agents 2018-06-08 09:44:20 +03:00
Denis Kolodin
b0df296fa8 Add interval task to multi-thread example 2018-06-08 09:44:20 +03:00
Denis Kolodin
04591f1763 Add link to agent's scope 2018-06-08 09:44:20 +03:00
Denis Kolodin
c8515af2c2 Move spawn and register methods to a separate Worker trait 2018-06-08 09:44:20 +03:00
Denis Kolodin
8c3e075ae2 Add an environment for agents 2018-06-08 09:44:20 +03:00
Denis Kolodin
8c4f60480e Add fetch service to multi thread example 2018-06-08 09:44:20 +03:00
Denis Kolodin
6e0dd80e3e Add agents 2018-06-08 09:44:20 +03:00