19 Commits

Author SHA1 Message Date
Muhammad Hamza
18f004bc57
Fix cargo make config and tests (#2640)
* remove pr-flow, run all the tests when asked

* make tests that were never run pass

* run tests cargo make properly

* use wasm-pack-base test for running wasm tests

* cargo make config should be good

* update CI
2022-04-28 21:04:55 +05:00
Muhammad Hamza
c28a71e78e
Use nightly for Rustfmt (#2630)
* add rustfmt.toml, use nightly in CI, update contributing docs

* run `cargo +nightly fmt`
2022-04-21 23:21:15 +05:00
Kaede Hoshikawa
f39afdc5e1
Remove benchmarks for now as it does not work at all. (#2495) 2022-03-07 18:28:58 +05:00
WorldSEnder
78d4204a9a
Introduce explicit internal datastructures modeling dom state (#2330)
* detach destructures now

* add failing keyed-list issue

* crude port to the new bundle infrastructure

* port over the infrastructure

the new bcomp is especially nice and lost a few unwraps owed to not having
to reserve space for a scope before rendering.
Note also that bsuspense has been slimmed a bit, storing the suspended flag
implicitly in the state.
some naming is not perfect yet and has to be adjusted still.

* mass rename: apply -> reconcile

* get rid of move_before in favor of shift

* generate id directly when creating a new scope

* bundle for text nodes

* work on naming: ancestor -> bundle

* slightly optimize list reconciler, add doccomments

* address review

* add internal documentation

* address review comments

rename fields in bsuspense
convert to gloo::events

* move even more stuff into dom_bundle to scope exports

- app_handle and layout_tests are now in there
- items are publically re-exported in crate::dom_bundle
- dom_bundle itself is private
- btag and bcomp get their own submodules
- bcomp now contains the lifecycle and scope impls

* move replace into Reconcilable

* move lifecycle and scope back into html as per review

* move back Value and InputFields into html

* actually only type-check format args in production

* fix documentation link

* move btag_impl up into containing module

* shift comps immediately

shifting the rendered Nodes does not tie into the lifecycle,
as such it can happen immediately

* use list-bundle in tag-bundle

* fix cargo make tests

* improve 05_swap benchmark

* fix a blunder where I swapped operands

* fix naming of BNode variants
2022-03-06 08:37:07 +05:00
Matt
6669d1873e
Optimize CI caching and path filtering (#2340)
* 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)
2022-01-18 10:49:11 +01:00
Kaede Hoshikawa
d8c2550fc7
Server-side Rendering (without hydration) (#2335)
* Basic render to html implementation.

* Remove HtmlWriter.

* Escape html content.

* Add non-suspense tests.

* Add Suspense tests.

* Gated "ssr" feature.

* Add example.

* Fix tests.

* Fix docs.

* Fix heading size.

* Remove the unused YewRenderer.

* Remove extra comment.

* unify naming.

* Update docs.

* Update docs.

* Update docs.

* Isolate spawn_local.

* Add doc flags.

* Add ssr feature to docs.

* Move ServerRenderer into their own file.

* Fix docs.

* Update features and docs.

* Fix example.

* Adjust comment position.

* Fix effects being wrongly called when a component is suspended.

* Fix clippy.

* Uuid & no double boxing.

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2022-01-12 18:43:09 +05:00
Julius Lungys
f749ca3c83
Move/Remove tools (#2274)
* move tools

* delete yew-validation

* update paths

* fix cargo.toml
2021-12-15 22:53:01 +01:00
Julius Lungys
4875430852
generate 0.19 CHANGELOG.md (#2199)
* Generate 0.19 CAHNGELOG.md

* remove tokens

* merge router CHANGELOG

* Apply suggestions from code review

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>

* add empty line

* update according to comments 1

Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
2021-11-29 18:02:04 +00:00
Janis Petersons
a442ce5df5
Component lifecycle scheduler optimizations (#2065)
* yew: partial render deduplication implementation

* yew/scheduler: batching and comment fixes

* yew/scheduler: clippy fixes

* yew/vcomp: add lifecycle debug logging

* ci: add release clippy and cargo check passes

* ci: fix release check

* ci: remove duplicate check calls
2021-09-22 17:57:14 +02:00
mc1098
ed2e1ea00e
Add testing for website code blocks (#2014)
* 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
2021-08-28 13:17:28 +02:00
bakape
d89f1ccc5c
Optimize VTag construction, memory footprint and patching (#1947)
* yew-macro: optimize VTag construction in html! macro

* yew/vtag: decrease VTag memory footpting and construction args

* yew,yew-macro: optimize VTag contruction, memory footprint and diffing

* yew/vlist: revert to VTag boxing

* yew-macro: add clippy allow for nightly rust

* yew-macro:  fix allow namespace

* *: bump MSRV to 1.49.0

* yew/vnode: restore == for VTag comparison

* yew/vtag: clean up reference casting

* yew-macro/html_element: fix error span regression
2021-07-18 18:26:52 +02: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
Philip Peterson
ed5b394072
Run pr-flow with stable toolchain (#1720) 2021-01-29 13:01:36 +08: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
Justin Starry
aef2ee56c6
Fix CI by using local ws echo server (#1711) 2021-01-23 18:59:48 +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
Simon
b6e98adac0
Adopt cargo-make (#1541)
* format and cleanup

* remove bash scripts

* update pr template

* ignore router examples

* add pr-flow task

* I really don't know what I'm doing

* add wasm_bench feature

* well that explains one of my issues

also, that Geckodriver issue seems to be resolved

* run macro tests on 1.45.2

* update the documentation

* test flags no longer necessary

* remove benchmark instructions

* finishing touch
2020-09-14 15:39:27 +02:00
Sagie Gur-Ari
7e7b8baaec
Add cargo-make files (#1504)
* Migrate run_stable_checks shell script to cargo-make

* simplify makefile

* More improvements based on new cargo-make features in development

* initial work on migrating run_tests to cargo-make

* do not test examples

* Enforce cargo-make minimal version 0.32.2

* Start/stop httpbin docker container

* Update Makefile.toml

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

* Update Makefile.toml

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

* use new cleanup task feature to ensure we cleanup docker container

* bump min cargo-make version

* Use configurable or default port number and also validate docker is installed

* spelling mistake fix

* fixing env set

* ensure min cargo-make version

Co-authored-by: Simon <simon@siku2.io>
2020-08-29 00:17:15 +02:00