1107 Commits

Author SHA1 Message Date
Justin Starry
f659052723
Fix children re-render component bug (#980)
* Fix children re-render component bug

* cargo clippy
2020-02-29 23:48:47 +08:00
Justin Starry
c02609ac4f
Improve docs.rs main page (#979) 2020-02-29 20:37:29 +08:00
Justin Starry
b4d5227e62
Clean up exported apis and doc visibility (#977)
* Clean up exported apis and doc visibility

* Remove unused ScopeHolder

* Change ComponentLink to alias of Scope

* cargo fmt
2020-02-29 19:58:07 +08:00
Justin Starry
d80e2f3e8a
Fix vtag test warning (#978) 2020-02-29 19:57:50 +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
yossarian
2a7d7acb43
Contributor testing docs improvement (#969)
* initial

* Update CONTRIBUTING.md

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
2020-02-27 08:53:28 +08:00
Justin Starry
6a759329d1
Bump rust version for macro tests (#965) 2020-02-25 22:30:26 +08:00
Miklós Tusz
90a7cdb9b5
Add WebGL example (#908) 2020-02-22 14:32:41 +08:00
yossarian
92aab6c97c
Fix contributing test instructions (#957) 2020-02-22 09:32:12 +08:00
Filippo Merli
b534a4c83a
Add components interaction example (#951)
This add a small example of how to use agents in order to send
messages between components.
2020-02-18 19:45:41 +08:00
Justin Starry
a5e74e7d1d
Update CHANGELOG.md 0.12.0 2020-02-16 16:14:14 +08:00
Justin Starry
6cc4449aec
Prepare v0.12 release (#953) 2020-02-16 16:13:28 +08:00
Matthew Fisher
df14a9fc3e
fix: link all outstanding TODO items to a ticket (#949)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-02-15 20:52:33 +08:00
leo-lb
12da2b5119
Implement more of FetchOptions (#602)
* Implement more of FetchOptions

Add referrer, referrer_policy and integrity

* Pass options to Request constructor instead of fetch

* Derive Debug on ReferrerPolicy and Referrer

* WIP: Add tests

* Add tests for referrer and redirect

* Add FetchService `integrity` field test

* Add FetchService `integrity` field fail test and refactor

* Add FetchService `referrer_policy` field tests

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
2020-02-13 18:02:25 +08:00
Jonas Platte
1ede16795a ComponentLink: Allow send_message and send_message_batch through shared references (#931) 2020-02-10 18:08:43 +08:00
Justin Starry
bf0a6bbeb2 Update README.md 2020-02-10 16:24:49 +08:00
Justin Starry
f703bdd987
Clean up readme (#930)
* Clean up README

* Remove bors
2020-02-09 18:00:13 +08:00
Justin Starry
12981dd193 Update README.md 2020-02-09 11:03:29 +08:00
Liquidblock
839b793b17 Fix wrong order of classes when reordering or adding classes to the front (#927)
* Fix wrong order of classes when reordering or adding classes in the front/middle (#926)

* Fix coding style (#926)

* Use set_attribute(class, className) for classes (#926)
2020-02-08 21:38:05 +08:00
Justin Starry
87f76f7736
Rename NodeRef.try_into to avoid trait conflicts (#917) 2020-02-04 20:17:07 +08:00
Justin Starry
aedce8bfbc
Implement PartialEq for ChildrenRenderer (#916) 2020-02-04 20:16:42 +08:00
Justin Starry
ee4792c7f6
Fix ResizeTask drop (#915) 2020-02-03 09:52:28 +08:00
Justin Starry
3dca0c7758
Fix component rendering process (#913)
* wip

* Fix component rendering process
2020-02-02 23:12:45 +08:00
Justin Starry
c422a5ed1b
Fix clippy warnings (#912) 2020-02-02 15:45:09 +08:00
Jonas Platte
063c25472e
Simplify yew-macro a bit (#902)
* yew-macro: Simplify Properties validation

* Fix most clippy warnings
2020-01-29 22:18:01 +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
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
Clifford T. Matthews
a42cca35a6 Allow binary-only and text-only websocket connects (#389) (#851)
This allows the various formats (e.g., CBOR) that can't be converted
in or out of Text to be used in a websocket by specifying you want to
use a binary-only connection.  A text-only connection is provided for
symmetry.
2020-01-27 10:17:47 +08:00
Justin Starry
38f4054f97
Move tests (#897) 2020-01-26 17:36:16 +08:00
Justin Starry
d4868b0e58
Install wasm-bindgen-cli if it does not exist on CI (#894) 2020-01-24 18:07:42 +08:00
Peter Mezei
b4bd3f1054 Update README.md (#890)
Agent example updated
2020-01-22 18:05:24 +08:00
Justin Starry
79b94645b6 Update issue templates 2020-01-22 15:38:11 +08:00
Clifford T. Matthews
287f0d60bb Expose the formatting macros. (#883)
This allows users to create their own encoding wrappers.

The provided documentation uses real-life examples from within yew.
This commit also fixes a minor oversight, where use of the
text_format_is_an_error macro required the end-user to explicitly use
the text_format macro instead of simply bringing it in itself.
2020-01-20 07:20:10 +08:00
AlephAlpha
6e63014d57 Add default value for properties (takes a function instead of an expression) (#881)
* Add `default` value for properties

* Default values specified by paths instead of exprs

* Fix misleading error message

* Remove confusing Option
2020-01-20 00:21:32 +08:00
AlephAlpha
3195b50d12 Add Transformer impls to handle handle Option<T> properties (#878)
* Add Transformer impls to handle handle Option<T> properties

* Add test

* More tests
2020-01-19 21:39:08 +08:00
Clifford T. Matthews
ffadafe0c2 Removes CborPacked. (#873)
In serde_cbor 0.9, the helper function to_vec_packed created the smallest
CBOR representation of data.  When serde_cbor 0.10 was introduced, that
function was left in place and the documentation for it didn't change, but
its behavior did.  Specifically, enum variants that carry data would no
longer have the variant encoded efficiently; instead it was encoded as a
String.  As such, using to_vec_packed is not the way to get a compact
representation if your data contains enums which carry data.

Since there hasn't been a yew release yet that has CBorPacked in it,
this commit removes CborPacked.
2020-01-19 12:12:56 +08:00
jess
1abef04207 Added financial contributors to the README (#880) 2020-01-18 11:12:59 +08:00
daxpedda
1f4c415eac Switch from failure to anyhow and thiserror. (#863)
* Switch to `anyhow` and `thiserror`.

* Fix doc tests.

* Fix fmt.

* Some polish.
2020-01-15 21:55:09 +08:00
dependabot-preview[bot]
a4423122de Update serde_cbor requirement from 0.10.2 to 0.11.1 (#869)
Updates the requirements on [serde_cbor](https://github.com/pyfisch/cbor) to permit the latest version.
- [Release notes](https://github.com/pyfisch/cbor/releases)
- [Commits](https://github.com/pyfisch/cbor/compare/v0.10.2...v0.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-15 19:08:08 +08:00
Justin Starry
f3f52906e8
Remove default build target because it breaks trybuild tests (#876) 2020-01-15 19:07:49 +08:00
Justin Starry
3d7bad917c
Improve html! "for" iterable ergonomics (#875)
* Improve html! iteratable ergonomics

* feedback
2020-01-15 17:57:25 +08:00
AlephAlpha
e38ed00ae1 Fix names of touch event listeners (#872) 2020-01-14 22:04:57 +08:00
dependabot-preview[bot]
943d2ca093 Update autocfg requirement from 0.1.3 to 1.0.0 (#860)
Updates the requirements on [autocfg](https://github.com/cuviper/autocfg) to permit the latest version.
- [Release notes](https://github.com/cuviper/autocfg/releases)
- [Commits](https://github.com/cuviper/autocfg/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-09 16:53:44 +08:00
Clifford T. Matthews
ba66c3eb75 Allow binary-only formats (e.g., CBOR) with websockets (#389) (#847)
This allows the various formats that can't be converted in or out of
Text to be used in the callback that a websocket will use.  It also
supports the packed version of CBOR.

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
2020-01-09 10:28:43 +08:00
Justin Starry
99220f542f
Update wasm-bindgen and fix cargo config (#853)
* Update wasm-bindgen and fix cargo config

* clippy
2020-01-08 15:08:32 +08:00
Clifford T. Matthews
5d27094370 Implements CborPacked, a more compressed variant of CBOR. (#849) 2020-01-07 12:17:34 +08:00
Justin Starry
5361f51981
Update Cargo.toml 2020-01-07 09:57:43 +08:00
Justin Starry
88ea0ab145
Update Cargo.toml 2020-01-07 09:55:27 +08:00
Justin Starry
a8c383d932
Update FUNDING.yml 2020-01-07 09:28:05 +08:00
Justin Starry
bad5302412
Update FUNDING.yml 2020-01-07 09:24:56 +08:00