1700 Commits

Author SHA1 Message Date
Jasper
c51ab7f094
Added missing licenses to Cargo.toml files and updated to use SPDX syntax (#1822) 2021-04-25 23:24:14 +02:00
allan2
3e13321751
Specify target to make example work (#1817)
* Update build-a-sample-app.md

The target needs to specified. The example won't work without it.

* Change word
2021-04-17 19:58:05 +02:00
Hudson Shykowski
cc51208a48
Implement .into_inner() for Json (#1816)
* Implement .into_inner() for Json

This allows users to use .into_inner() the same way it would be possible
in the serde crate. Previously, it was only possible via dump.0 (which
looks gross), or Json(dump).

* Fix an error using HtmlBlock

The definition uses {content, brace} but the usage used [brace, content}

* Update packages/yew/src/format/json.rs

Co-authored-by: Simon <simon@siku2.io>
2021-04-12 20:04:38 +02:00
sansx
e5dca45257
Fix chinese docs (#1814) 2021-04-07 17:53:25 +02:00
Tom Cavanaugh
b9fb7a1abc
Update Counter example (#1812)
* Add stylesheet, comments

* Additional css tweaks

* Fir formatting

* Apply suggestions from code review

Co-authored-by: EC2 Default User <ec2-user@ip-172-31-51-38.ec2.internal>
Co-authored-by: Simon <simon@siku2.io>
2021-04-05 23:54:55 +02:00
gitlocalize-app[bot]
58395f89e3
Translate using-cargo-web.md via GitLocalize (#1810)
Co-authored-by: sansx <646924078@qq.com>
2021-04-04 15:30:29 +02:00
gitlocalize-app[bot]
6eb884079d
Update chinese translations (#1807)
* Translate index.md via GitLocalize

* Translate agents.md via GitLocalize

* Translate components.md via GitLocalize

* Translate html.md via GitLocalize

* Translate services.md via GitLocalize

* Translate format.md via GitLocalize

* Translate elements.md via GitLocalize

* Translate lists.md via GitLocalize

* Translate refs.md via GitLocalize

* Translate using-cargo-web.md via GitLocalize

* Translate using-wasm-pack.md via GitLocalize

* Translate components.md via GitLocalize

* Translate literals-and-expressions.md via GitLocalize

* Translate using-wasm-bindgen.md via GitLocalize

* Translate examples.md via GitLocalize

* Translate callbacks.md via GitLocalize

* Translate build-a-sample-app.md via GitLocalize

* Translate choose-web-library.md via GitLocalize

* Translate project-setup.md via GitLocalize

* Translate project-setup.md via GitLocalize

* Translate properties.md via GitLocalize

* Translate starter-templates.md via GitLocalize

* Translate router.md via GitLocalize

* Translate roadmap.md via GitLocalize

* Translate zh-CN.json via GitLocalize

Co-authored-by: sansx <646924078@qq.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
2021-04-04 01:36:44 +02:00
Yuta Hinokuma
bad4c77f61
update nom 6.1.2 and fix compile errors. (#1806) 2021-04-02 13:44:20 +02:00
sansx
bf3d97928a
Fix caution description (#1802) 2021-03-31 15:42:31 +02:00
Muhammad Hamza
991abab7e1
Update Rust version for macro tests to 1.51 & enable const generics tests (#1801)
* update rust version for macro test to 1.51

* enable const generic tests

* run integration tests using MSRV

* am blind

* clippy, fmt

* apply suggestion
2021-03-30 22:35:21 +02:00
gitlocalize-app[bot]
164d5546b4
Update translation of 'more' part (#1797)
* Translate testing.md via GitLocalize

* Translate roadmap.md via GitLocalize

* Translate external-libs.md via GitLocalize

* Translate debugging.md via GitLocalize

Co-authored-by: sansx <646924078@qq.com>
2021-03-22 16:06:15 +01:00
sansx
7900630805
Fix square bracket (#1796) 2021-03-22 16:05:47 +01:00
gitlocalize-app[bot]
ccf96436f2
update translation of advanced-topics part (#1795)
* Translate optimizations.md via GitLocalize

* Translate optimizations.md via GitLocalize

* Translate how-it-works.md via GitLocalize

* Translate how-it-works.md via GitLocalize

Co-authored-by: sansx <646924078@qq.com>
Co-authored-by: daief <1437931235@qq.com>
2021-03-20 13:30:08 +01:00
gitlocalize-app[bot]
90b8d7499f
update translation of more/css.md (#1793)
* Translate css.md via GitLocalize

* Translate css.md via GitLocalize

Co-authored-by: daief <1437931235@qq.com>
Co-authored-by: sansx <646924078@qq.com>
2021-03-18 19:43:58 +01:00
gitlocalize-app[bot]
243986597c
Translate using-trunk.md via GitLocalize (#1792)
Co-authored-by: sansx <646924078@qq.com>
2021-03-17 19:27:30 +01:00
Richard Walters
8309df32ca
Fix fetch test for same-origin referrer URL (#1788)
The `yew_services::fetch::tests::fetch_referrer_same_origin_url`
test broke for Chrome after Chrome changed the default
`Referrer-Policy` from `no-referrer-when-downgrade` to
`strict-origin-when-cross-origin`
(See: https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default)

The test makes a cross-site fetch (from the headless test
origin to the httpbin server) and the new default policy
causes the path to be stripped from the `Referer` header,
whereas the old policy didn't.

Fix this problem by explicitly setting the referrer policy
to the previous default `no-referrer-when-downgrade` when
making the test fetch.  This makes the test pass with Chrome
and should have no effect for other browsers which are
still using a default of `no-referrer-when-downgrade`
(i.e. Firefox).

Tested with both Chrome and Firefox:

* wasm-pack test --chrome --headless -- --features "wasm_test httpbin_test"
* wasm-pack test --firefox --headless -- --features "wasm_test httpbin_test"
2021-03-13 13:16:50 +01:00
Richard Walters
311ff2ad5d
Fix issues in WebSocketTask during connection (#1783) (#1785)
During the connection handshake:

* `WebSocketTask::is_active` erronously returns `false`.
* Dropping `WebSocketTask` drops the `WebSocket` without
  calling `WebSocket::close` on it, resulting in the WebSocket
  "leaking"; it will typically continue the connection
  handshake and remain connected to the server, despite the
  client having dropped the object representing it.

Fix these by considering the task to be active if the
WebSocket `ready_state` is *either* `WebSocket::OPEN` or
`WebSocket::CONNECTING`.

Add two tests to check that a `WebSocketTask` returns `true`
for `is_active` while it's connecting, and that dropping
the `WebSocketTask` while it's connecting results in
the underlying WebSocket being closed properly.
2021-03-12 19:57:18 +01:00
Richard Walters
712f783907
Fix issues in WebSocketTask during connection (#1783) (#1785)
During the connection handshake:

* `WebSocketTask::is_active` erronously returns `false`.
* Dropping `WebSocketTask` drops the `WebSocket` without
  calling `WebSocket::close` on it, resulting in the WebSocket
  "leaking"; it will typically continue the connection
  handshake and remain connected to the server, despite the
  client having dropped the object representing it.

Fix these by considering the task to be active if the
WebSocket `ready_state` is *either* `WebSocket::OPEN` or
`WebSocket::CONNECTING`.

Add two tests to check that a `WebSocketTask` returns `true`
for `is_active` while it's connecting, and that dropping
the `WebSocketTask` while it's connecting results in
the underlying WebSocket being closed properly.
2021-03-12 19:45:00 +01:00
Richard Walters
51e071467a
Fix issues in WebSocketTask during connection (#1783) (#1785)
During the connection handshake:

* `WebSocketTask::is_active` erronously returns `false`.
* Dropping `WebSocketTask` drops the `WebSocket` without
  calling `WebSocket::close` on it, resulting in the WebSocket
  "leaking"; it will typically continue the connection
  handshake and remain connected to the server, despite the
  client having dropped the object representing it.

Fix these by considering the task to be active if the
WebSocket `ready_state` is *either* `WebSocket::OPEN` or
`WebSocket::CONNECTING`.

Add two tests to check that a `WebSocketTask` returns `true`
for `is_active` while it's connecting, and that dropping
the `WebSocketTask` while it's connecting results in
the underlying WebSocket being closed properly.
2021-03-12 19:26:32 +01:00
Richard Walters
a1fa79d99e
Clean up asserts in WebSocket services test (#1784)
In `test_invalid_url_error`:

* First `assert` followed by `if let` is redundant.
* Second `if let` requires suppression of
  `irrefutable_let_patterns` since there is only one variant.
* Second `if let` necessitates a third "catch-all else" assert.

Replacing all of this with a single `assert!(matches!(...))`
makes it easier to read and removes the need for the
lint suppression without changing what's being tested.
2021-03-12 19:24:51 +01:00
Simon
37401402a1
Allow the use of Rust keywords for element names (#1772)
* time for more hygiene

* update corresponding tests

* while I'm at it

* now let's fix the actual issue

* fix the publish examples CI while I'm at it

* resolve clippy warnings
2021-02-28 15:49:58 +01:00
Luke Chu
bc46062864
Refactor html tag peeking (#1738)
* Fix html macro tests

* Fix generics with lowercase type param

* Satisfy clippy

* Parse generics with multiple type params

* Reorganize tests

* Remove Peek for HtmlTree

* Add additional test

* cargo fmt

* Remove peek_component_type

* Remove failing tests
2021-02-27 15:49:45 +01:00
Muhammad Hamza
d1f15b6f86
Add docs for adding minimal editor support (#1716)
* Add docs for adding minimal editor support

* fight with aspell

* add link to ij-rust issue about proc-macro generated items

* apply suggestions
2021-02-25 11:41:01 +01:00
Muhammad Hamza
3f9b698931
Fix use_context example in docs (#1770) 2021-02-25 11:39:02 +01:00
gitlocalize-app[bot]
114b6d2c5a
Translate Getting Started for French (#1768)
* Translate build-a-sample-app.md via GitLocalize

* Translate build-a-sample-app.md via GitLocalize

* Translate build-a-sample-app.md via GitLocalize

* Translate build-a-sample-app.md via GitLocalize

* Translate using-trunk.md via GitLocalize

* Translate using-trunk.md via GitLocalize

* Translate using-wasm-pack.md via GitLocalize

* Translate using-wasm-pack.md via GitLocalize

* Translate starter-templates.md via GitLocalize

* Translate starter-templates.md via GitLocalize

Co-authored-by: Luke Chu <lukewchu@outlook.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
2021-02-24 23:09:37 +01:00
Luke Chu
f98b00e243
Rename INTRODUCTION.md to index.md (#1767) 2021-02-24 19:26:51 +01:00
gitlocalize-app[bot]
8d96a447ba
Translate INTRODUCTION.md via GitLocalize (#1765)
* Translate INTRODUCTION.md via GitLocalize

* Translate INTRODUCTION.md via GitLocalize

Co-authored-by: Mubelotix <mubelotix@gmail.com>
Co-authored-by: Luke Chu <lukewchu@outlook.com>
2021-02-24 19:07:24 +01:00
Luke Chu
ee8eae19e9
Generic functional components (#1756)
* Generic functional components

* Add some tests

* Clippy

* Fix generic-props-fail snapshot

* Add docs for generic function components

* Add some more docs

* Fix trait bounds in docs

* Fix docs

* Improve lifetime error messages

* Fix parsing for const generics

* Use fully qualified path for pass test

* Remove TODO message

* Suggested change

Co-authored-by: Simon <simon@siku2.io>

* Update test

Co-authored-by: Simon <simon@siku2.io>

* Update test

Co-authored-by: Simon <simon@siku2.io>

* Update stderr snapshots

* Combine quote implementations

* Fix warning about type alias bounds

Co-authored-by: Simon <simon@siku2.io>
2021-02-24 19:05:48 +01:00
Luke Chu
08864f56c9
Enable French in documentation (#1764) 2021-02-24 18:59:45 +01:00
gitlocalize-app[bot]
645c9b2071
Translate fr.json via GitLocalize (#1763)
* Translate fr.json via GitLocalize

* Translate fr.json via GitLocalize

Co-authored-by: Mubelotix <mubelotix@gmail.com>
Co-authored-by: Luke Chu <lukewchu@outlook.com>
2021-02-24 18:59:33 +01:00
gitlocalize-app[bot]
20409c68eb
Translate function-components.md via GitLocalize (#1761)
* Translate function-components.md via GitLocalize

* Translate function-components.md via GitLocalize

* Update website/translated_docs/fr/concepts/function-components.md

Co-authored-by: Luke Chu <lukewchu@outlook.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: Simon <simon@siku2.io>
2021-02-24 18:01:56 +01:00
Martin Beták
f93fa3c8b2
yewtil: functional_component: Enable empty params (#1755)
* Automatically derive also the `Default` trait for function components
  without any properties.
2021-02-22 00:47:55 +01:00
Xavientois
f27e268f7e
Add support for the unit struct in Properties derive (#1752)
* Add support for the unit struct in Properties derive

* Add test to show that the code now compiles

* Fix fmt lint
2021-02-20 14:45:17 +01:00
xosxos
49a96257d9
Update README.md (#1750)
I was trying to get this to work by copy pasting but I suppose that line is outdated?
2021-02-19 21:25:58 +01:00
Teymour Aldridge
b074b4b87d
Add a note explaining the need for a <base> tag. (#1743) 2021-02-14 23:20:05 +01:00
Simon
03abde607b
Update logo URL 2021-02-13 13:25:56 +01:00
Teymour Aldridge
b694865151
Remove reference to npm_and_rest example (#1733)
It no longer exists.
2021-02-06 15:16:48 +01:00
Teymour Aldridge
0b90a3df0a
Fix duplicate with props error messages. (#1730)
* Fix duplicate `with props` error messages.

* Fix error span.

* Use `quote!` for error message.

Co-authored-by: Simon <simon@siku2.io>

Co-authored-by: Simon <simon@siku2.io>
2021-02-05 23:43:13 +01:00
Teymour Aldridge
04fe2086f0
Fix clippy warnings on yew services. (#1731) 2021-02-05 20:30:00 +01:00
Teymour Aldridge
e0be985082
Replace #[to="..."] attribute with #[at="..."] attribute. (#1717)
* Replace `#[to="..."]` attribute with `#[at="..."]` attribute.

* Fix attribute formatting

* Fix spelling
2021-02-05 18:48:26 +01:00
Teymour Aldridge
aaa03374dc
Fix router example. (#1729) 2021-02-05 18:41:37 +01:00
Max
3a5037a1cf
Docs: add --locked flag for trunk installation (#1722)
* Add --locked flag for trunk installation

* docs: add --locked flag for trunk
2021-01-30 16:21:33 +08:00
Philip Peterson
ed5b394072
Run pr-flow with stable toolchain (#1720) 2021-01-29 13:01:36 +08:00
Simon
2f926a9151
Add viewport meta tag to fix mobile version of the TodoMVC example (#1715) 2021-01-24 12:29:59 +01:00
Paolo Barbolini
de5021ba16
Bump minimum serde_yaml version in order to appease deps.rs (#1714) 2021-01-24 12:11:48 +01:00
Philip Peterson
5fc4387dc5
Rip out stdweb (#1697)
* feat: Remove usage of stdweb

* Cleanup Cargo.toml

* yew-services fixes

* fix doc test

Co-authored-by: Justin Starry <justin.starry@icloud.com>
2021-01-24 00:14:15 +08:00
Justin Starry
5adb142be5
Add Makefile.toml for yew-services (#1713) 2021-01-23 23:57:33 +08:00
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
Mindaugas Vinkelis
e5eda4e0fa
Added callback_future_once in yewtil (#1696) (#1712) 2021-01-23 20:22:28 +08:00
Justin Starry
aef2ee56c6
Fix CI by using local ws echo server (#1711) 2021-01-23 18:59:48 +08:00