88 Commits

Author SHA1 Message Date
Muhammad Hamza
ccaa06a2fa
Clippy + update lock files (#2949) 2022-11-05 16:05:08 +01:00
Kaede Hoshikawa
da09755c27
Separate Yew Platform (#2893)
* Remove pinned module.

* Create Yew Platform.

* Remove some additional dependencies.

* Fix clippy.

* Restore wasm-bindgen-futures.

* Fix docs.

* Migrate to prokio.

* Fix docs warnings.

* Fix dependencies.
2022-10-21 06:56:15 +09:00
Kaede Hoshikawa
5f7dd1d972
Upgrade tokio to v1.21.1 (#2869)
* Remove tokio-util.

* Unpin tokio.

* Revert test workaround.
2022-09-13 16:49:39 +02:00
Kaede Hoshikawa
e9ef79f0a4
Update dependencies (#2867)
* Update dependencies.

* Fix clippy.
2022-09-11 21:31:51 +09:00
Kaede Hoshikawa
278d2ce08e
Polled SSR Stream (#2824)
* Switch to pinned channels.

* Fix ServerRenderer so it's not blocked until the result is resolved.

* Fix tests.

* Remove unused SendError.

* Implement a stream to be polled alongside rendering.

* Update Buffer Size.

* Make Send renderer work.

* Remove pinned channels.

* Unified Naming.

* Optimise code.

* Restore capacity.

* Remove unused profile.

* Default to separate resolver.

* Reduce allocations on string.

* Adjust API.

* Remove duplicate trait bound.

* Update docs.

* Remove capacity setting.

* Unsafe?

* Separate files.

* Adjust inlining.

* Fix test.

* Update notice.

* Update documentation.

* Fix tests.
2022-09-11 01:25:00 +05:00
Kaede Hoshikawa
989d804947
Fix Clippy for 1.63 (#2825) 2022-08-12 22:16:05 +09:00
Kaede Hoshikawa
7562b650b1
SSR Benchmark (#2800)
* Add benchmark binary.

* Add benchmark workflow.

* Fix rendering stream.

* Revert "Fix rendering stream."

This reverts commit 651dd157520dccd19da337130713335a04c80f2d.

* Naming.

* Write to writer.

* Move result calculation into a method.

* Fix round calculation.

* Apply optimisation flag.

* Should be applied to profile bench.
2022-08-03 20:18:02 +09:00
Kaede Hoshikawa
924792c002
Enable Dependabot for Examples and Tools (#2785)
* Enable dependabot for examples and tools.

* Make everything to use Gloo.

* Require features for binaries.

* Update every Friday.
2022-07-21 01:23:22 +09:00
Muhammad Hamza
2e4a919679
Split the huge workspace into smaller & improve CI (#2774)
* Split repository into multiple workspaces, update CI

* pull_request_target for build-website workflow

This should allow the workflow to read secrets instead of requiring a different, publish-website workflow to be needed to publish the side

* pull_request_target for build-api-docs workflow

This should allow the workflow to read secrets instead of requiring a different, publish-api-docs workflow to be needed to publish the side

* use `paths` instead of `path_ignore` for examples

* cleanup main-checks.yml

* it's rustfmt, not fmt

* correct paths for workflow files

* it's rustfmt, not fmt: part 2 electric bolgoo

* me idiot: part infinity

* ???

* main checks should be the same then?

* ??? part 2

* it should work now

* more fixes

* checkout before using file, actually use stable for wasm-bindgen-cli

* Revert "pull_request_target for build-api-docs workflow"

This reverts commit 38977292c87f4f5b55a09eb458f9acb083158570.

* Revert "pull_request_target for build-website workflow"

This reverts commit 1638a0cd241f1cd195afae27405714f5111819e7.

* Benchmark workflow uses pull_request event

* pull_request for size-cmp
2022-07-07 00:17:03 +05:00
dependabot[bot]
814e52daac
Update gloo requirement from 0.7 to 0.8 (#2766)
Updates the requirements on [gloo](https://github.com/rustwasm/gloo) to permit the latest version.
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Commits](https://github.com/rustwasm/gloo/compare/0.7.0...0.8.0)

---
updated-dependencies:
- dependency-name: gloo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-01 21:32:32 +09:00
Kaede Hoshikawa
7f5eb3890c
Streamed SSR Response (#2697)
* yew::platform?

* Stream Response.

* Migrate example

* Remove old implementation.

* Remove extra implementation.

* Prefer String instead of Cow.

* Fix MSRV.

* Fix trybuild.

* Optimise Memory Allocation.

* More optimisation.

* BufWriter.

* Fix tests.

* Optimise BufWriter.

* Remove more allocations.

* Allow setting of buffer capacity.

* Fix capacity size.

* Fix capacity size.

* Remove unneeded const notation.

* Fix macro tests.

* Slightly optimises BufWriter committing logic.

* Optimise Implementation.

* Move BufWriter to a separate file.

* Additional Implementation Note.

* Adjust API so it matches `std::channel::mpsc::channel`.

* Fix feature soundness.

* Make a compatibility layer on channels.

* Fix clippy.

* Fix feature soundness.

* Fix CI.

* Inlining.

* Add documentation.

* Punctuation.

* Switch to tokio channel.

* Remvoe pin-project.

* Fix feature soundness.

* Typo.

* Move io to platform.

* Tokio does not compile.

* Fix workflow.

* Restore wrongly removed docs.

* Does tokio work?

* Switch back to tokio.

* Remove pin-project.

* Use cargo resolver 2.

* Add panic notice.

* Update documentation.

* Properties does not have to be send.

* Fix capacity checking as pointed in the review.

* Implementation order.

* Update note.
2022-07-01 14:26:12 +05:00
Kaede Hoshikawa
6b89e21034
Migrate to once_cell (#2750)
* Replace lazy_static with once_cell.

* Migrate to clap v3, so 1 less lazy_static.

* Convert with `.into()`.
2022-06-24 19:32:00 +05:00
WorldSEnder
d7b43bbc26
Change access to VList children to a wrapper (#2673)
this should avoid having to manually call recheck_fully_keyed

* add mutable accessor to children
* fix workflow
* fix markdown example
* remove recheck_fully_keyed
2022-05-11 12:37:39 +02:00
Muhammad Hamza
8d9ecf2d20
Wasm doc tests (#2651)
* don't use wasm-pack for wasm tests

* use proper version of wasm-bindgen-cli

* also run with chrome driver

* use cargo pkgid

* wasm doc tests

* setup web drivers

* temp workaround

* fix failures

* remove debug info

* don't be dumb

* specific ref for benchmark workflow so it doesn't fail

* Revert "specific ref for benchmark workflow so it doesn't fail"

This reverts commit c32ad8264fbb4a182892f52f789dbd9822015849.

This should be no longer needed: https://github.com/krausest/js-framework-benchmark/issues/1032#issuecomment-1114303988
2022-05-02 16:10:36 +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
dependabot[bot]
d2c3685521
Update gloo requirement from 0.6 to 0.7 (#2613)
Updates the requirements on [gloo](https://github.com/rustwasm/gloo) to permit the latest version.
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Commits](https://github.com/rustwasm/gloo/compare/0.6.0...0.7.0)

---
updated-dependencies:
- dependency-name: gloo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-15 12:16:04 +02:00
WorldSEnder
e2405298c6
update zxcvbn to 2.2.1 (#2568)
* update zxcvbn to 2.2.1

* fix clippy issues

* Upgrade to wasm_bindgen 0.2.80

* resolve TODO, linked pr now merged
2022-04-08 13:03:45 +05:00
dependabot[bot]
2db42841a1
Bump minimist from 1.2.5 to 1.2.6 in /tools/benchmark-struct (#2548)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-03 00:47:06 +05:00
dependabot[bot]
20cc54096d
Bump minimist from 1.2.5 to 1.2.6 in /tools/benchmark-hooks (#2547)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-03 00:46:36 +05:00
Kaede Hoshikawa
8bc2212716
#[cfg(feature = "render")] and yew::Renderer (#2498)
* Bring changes to this branch.

* Bring changes to this branch.

* Add feature render and renderer.

* Bring changes to this branch.

* Migrate examples to Renderer.

* Satisfy no any render.

* Satisfy ssr.

* Satisfy feature render.

* Lint feature soundness.

* Suppress tests.

* Fix pr-flow, update docs.

* Add a notice.

* Adjust visibility.

* Correctly feature gate tests.

* make test scope available under feature render.

* Fix CI.

* Fix CI.

* Restore tests module to its original place as well.

* Make bundles crate private.

* Make most bundle APIs private.

* Adjust docs.

* Adjust debug implementation.

* Replace start_app with Renderer.

* Adjust documentation.

* Remove unused lint.

* Remove start_app from docs.

* DomBundle -> ReconcileTarget.

* Adjust documentation.

* Once render, now csr.

* Fix docs as well.
2022-03-20 00:48:47 +09:00
dependabot[bot]
3ad454011d
Update gloo requirement from 0.4 to 0.6 (#2522)
Updates the requirements on [gloo](https://github.com/rustwasm/gloo) to permit the latest version.
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Commits](https://github.com/rustwasm/gloo/commits/0.6.1)

---
updated-dependencies:
- dependency-name: gloo
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-19 16:46:15 +02:00
Kaede Hoshikawa
605f891a20
Size Comparison on Pull Requests (#2513)
* Fix optimisation flags.

* Add size comparison.

* Set opt-level to z.

* Fix Workflow.

* Fix Workflow.

* Ignore failures.

* Fix comment script.

* Fix github script.

* Separate Post Comments and Size Information Collection.
2022-03-18 21:17:07 +09:00
Kaede Hoshikawa
51238fb0e3
Better Function Component in docs + Macro-based Hooks (#2478)
* Fix const function component.

* Show Properties on the function definition.

* Filter certain doc attributes to be applied to type alias. More precise warnings.

* Implement macro-based hook.

* Add fail case.

* Function Component no longer a type alias.

* Clippy!

* Force 'static on generics.

* Fix clippy!

* Fix clippy and trybuild.

* Fix clippy and trybuild.

* Fix clippy.

* BaseComponent was not sealed properly.

* Adjust prelude.

* Public API should use IntoComponent for better ergonomics.

* Fix race condition.

* Fix trybuild.
2022-03-08 18:03:40 +05:00
Julius Lungys
427ac22e09
bump rust dependecies (#2501) 2022-03-06 14:23:36 +01:00
dependabot[bot]
92c4ce434f
Update strum requirement from 0.23 to 0.24 (#2471)
Updates the requirements on [strum](https://github.com/Peternator7/strum) to permit the latest version.
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

---
updated-dependencies:
- dependency-name: strum
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-06 15:02:16 +02: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
Julius Lungys
221b4dfa51
fix clippy (#2492) 2022-03-05 20:53:19 +01:00
Julius Lungys
ef60f0943e
fix CI (#2395) 2022-01-22 18:07:28 +01: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
Muhammad Hamza
44e3880c83
Setup hosting for API docs (#2371)
* setup hosting for API docs

* maybe this is the name of the component??

* dependencies make the final bundle too big

* please clippy
2022-01-15 13:21:24 +01:00
Muhammad Hamza
f05ba4152c
Update to edition 2021 (#2354)
* cargo fix --edition

* change edition="2018" to edition="2021" in Cargo.toml
2022-01-12 16:22:00 +02: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
4be9308b84
Benchmarks completely redone (#2352) 2022-01-10 22:24:53 +05:00
Kaede Hoshikawa
7d52858d01
Remove context & job agent (#2295)
* Remove context and job agent.

* Revert "Remove context and job agent."

This reverts commit 408f6fcdf062800c9e9852e6662a55ff3eef4533.

* Revert "Revert "Remove context and job agent.""

This reverts commit 44a42dfb313c111ceaa654163c8aa610a88e6a95.

* Update example.

* Fix docs.

* Fix test.

* Rename examples.

* Fix examples & docs.

* Update website/docs/concepts/function-components/custom-hooks.mdx

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>

* Examples in alphabetical order.

Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
2021-12-29 17:15:26 +05:00
Julius Lungys
0268c7df7d
Add auth to changelog generation (#2307)
* Add auth to changelog generation

* fix tests
2021-12-29 00:37:34 +05:00
Julius Lungys
50510c5858
Automate changelog gen and gh release in actions (#2286)
* Automate changelog gen and gh release

* fix tests

* fix test 2

* make pull request pull full depth git information

* fix fetch-depth

* fix inspect action
2021-12-20 13:53:07 +01:00
Matt
90b4e55ebc
Docusaurus Overhaul (#2275)
* change suffixes from md to mdx
fix broken links for English locale
tree shake and update docusaurus
add docusaurus ideal image plugin
use svg and themed image
delete unused static asset

* move localized landing page

* change GitLocalize project page

* nit pick

* remove ignore to have the block checked
2021-12-20 12:10:45 +02: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