Commit graph

148 commits

Author SHA1 Message Date
Evan Almloff
022e4ad203
Suspense boundaries/out of order streaming/anyhow like error handling (#2365)
* create static site generation helpers in the router crate

* work on integrating static site generation into fullstack

* move ssg into a separate crate

* integrate ssg with the launch builder

* simplify ssg example

* fix static_routes for child routes

* move CLI hot reloading websocket code into dioxus-hot-reload

* fix some unused imports

* use the same hot reloading websocket code for fullstack

* fix fullstack hot reloading

* move cli hot reloading logic into the hot reload crate

* ssg example working with dx serve

* add more examples

* fix clippy

* switch to a result for Element

* fix formatting

* fix hot reload doctest imports

* fix axum imports

* add show method to error context

* implement retaining nodes during suspense

* fix unterminated if statements

* communicate between tasks and suspense boundaries

* make suspense placeholders easier to use

* implement IntoDynNode and IntoVNode for more wrappers

* fix clippy examples

* fix rsx tests

* add streaming html utilities to the ssr package

* unify hydration and non-hydration ssr cache

* fix router with Result Element

* don't run server doc tests

* Fix hot reload websocket doc examples

* simple apps working with fullstack streaming

* fix preloading wasm

* Report errors encountered while streaming

* remove async from incremental renderer

* document new VirtualDom suspense methods

* make streaming work with incremental rendering

* fix static site generation

* document suspense structs

* create closure type; allow async event handlers in props; allow shorthand event handlers

* test forwarding event handlers with the shorthand syntax

* fix clippy

* fix imports in spawn async doctest

* fix empty rsx

* fix async result event handlers

* fix mounting router in multiple places

* Fix task dead cancel race condition

* simplify diffing before adding suspense

* fix binary size increase

* fix attribute diffing

* more diffing fixes

* create minimal fullstack feature

* smaller fullstack bundles

* allow mounting nodes that are already created and creating nodes without mounting them

* fix hot reload feature

* fix replacing components

* don't reclaim virtual nodes

* client side suspense working!

* fix CLI

* slightly smaller fullstack builds

* fix multiple suspended scopes

* fix merge errors

* yield back to tokio every few polls to fix suspending on many tasks at once

* remove logs

* document suspense boundary and update suspense example

* fix ssg

* make streaming optional

* fix some router and core tests

* fix suspense example

* fix serialization with out of order server futures

* add incremental streaming hackernews demo

* fix hackernews demo

* fix root hackernews redirect

* fix formatting

* add tests for suspense cases

* slightly smaller binaries

* slightly smaller

* improve error handling docs

* fix errors example link

* fix doc tests

* remove log file

* fix ssr cache type inference

* remove index.html

* fix ssg render template

* fix assigning ids on elements with dynamic attributes

* add desktop feature to the workspace examples

* remove router static generation example; ssg lives in the dioxus-static-generation package

* add a test for effects during suspense

* only run effects on mounted nodes

* fix multiple suspense roots

* fix node iterator

* fix closures without arguments

* fix dioxus-core readme doctest

* remove suspense logs

* fix scope stack

* fix clippy

* remove unused suspense boundary from hackernews

* assert that launch never returns for better compiler errors

* fix static generation launch function

* fix web renderer

* pass context providers into server functions

* add an example for FromContext

* clean up DioxusRouterExt

* fix server function context

* fix fullstack desktop example

* forward CLI serve settings to fullstack

* re-export serve config at the root of fullstack

* forward env directly instead of using a guard

* just set the port in the CLI for fullstack playwright tests

* fix fullstack dioxus-cli-config feature

* fix launch server merge conflicts

* fix fullstack launch context

* Merge branch 'main' into suspense-2.0

* fix fullstack html data

* remove drop virtual dom feature

* add a comment about only_write_templates binary size workaround

* remove explicit dependencies from use_server_future

* make ErrorContext and SuspenseContext more similar

* Tweak: small tweaks to tomls to make diff smaller

* only rerun components under suspense after the initial placeholders are sent to the client

* add module docs for suspense

* keep track of when suspense boundaries are resolved

* start implementing JS out of order streaming

* fix core tests

* implement the server side of suspense with js

* fix streaming ssr with nested suspense

* move streaming ssr code into fullstack

* revert minification changes

* serialize server future data as the html streams

* start loading scripts wasm immediately instead of defering the script

* very basic nested suspense example working with minimal html updates

* clean up some suspense/error docs

* fix hydrating nested pending server futures

* sort resolved boundaries by height

* Fix disconnecting clients while streaming

* fix static generation crate

* don't insert extra divs when hydrating streamed chunks

* wait to swap in the elements until they are hydrated

* remove inline streaming script

* hackernews partially working

* fix spa mode

* banish the open shadow dom

* fix removing placeholder

* set up streaming playwright test

* run web playwright tests on 9999 to avoid port conflicts with other local servers

* remove suspense nodes if the suspense boundary is replaced before the suspense resolves on the server

* ignore hydration of removed suspense boundaries

* use path based indexing to fix hydrating suspense after parent suspense with child is removed

* re-export dioxus error

* remove resolved suspense divs if the suspense boundary has been removed

* Fix client side initialized server futures

* ignore comment nodes while traversing nodes in core to avoid lists getting swapped out with suspense

* Pass initial hydration data to the client

* hide pre nodes

* don't panic if reclaiming an element fails

* fix scope stack when polling tasks

* improve deserialization out of length message

* Ok(VNode::placeholder()) -> VNode::empty()

* fix typo in rsx usage

* restore testing changes from suspense example

* clean up some logs and comments

* fix playwright tests

* clean up more changes in core

* clean up core tests

* remove anymap dependency

* clean up changes to hooks

* clean up changes in the router, rsx, and web

* revert changes to axum-hello-world

* fix use_server_future

* fix clippy in dioxus-core

* check that the next or previous node exist before checking if we should ignore them

* fix formatting

* fix suspense playwright test

* remove unused suspense code

* add more suspense playwright tests

* add more docs for error boundaries

* fix suspense core tests

* fix ErrorBoundary example

* remove a bunch of debug logging in js

* fix router failure_external_navigation

* use absolute paths in the interpreter build.rs

* strip '\r' while hashing ts files

* add a wrapper with a default error boundary and suspense boundary

* restore hot reloading

* ignore non-ts files when hashing

* sort ts files before hashing them

* fix rsx tests

* fix fullstack doc tests

* fix core tests

* fix axum auth example

* update suspense hydration diagram

* longer playwright build limit

* tiny fixes - spelling, formatting

* update diagram link

* remove comment and template nodes for suspense placeholders

* remove comment nodes as we hydrate text

* simplify hackernews example

* clean up hydrating text nodes

* switch to a separate environment variable for the base path for smaller binaries

* clean up file system html trait

* fix form data

* move streaming code into fullstack

* implement serialize and deserialize for CapturedError

* remove waits in the nested suspense playwright spec

* force sequential fullstack builds for CI

* longer nested suspense delay for CI

* fix --force-sequential flag

* wait to launch server until client build is done

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-01 20:50:36 -07:00
Evan Almloff
ffa36a67c3
Forward cli serve settings and make it easier to provide platform config to fullstack (#2521)
* assert that launch never returns for better compiler errors

* fix static generation launch function

* fix web renderer

* pass context providers into server functions

* add an example for FromContext

* clean up DioxusRouterExt

* fix server function context

* fix fullstack desktop example

* forward CLI serve settings to fullstack

* re-export serve config at the root of fullstack

* forward env directly instead of using a guard

* just set the port in the CLI for fullstack playwright tests

* fix fullstack dioxus-cli-config feature

* fix launch server merge conflicts

* fix fullstack launch context

* run web playwright tests on 9999 to avoid port conflicts with other local servers

* fix playwright tests
2024-06-28 14:40:41 -07:00
Evan Almloff
b6dc2a2230
Deduplicate reactive scope updates/Reset subscriptions on reruns/fix use memo double update (#2506)
* deduplicate effect updates

* only subscribe to signals read in the current run of reactive scopes

* subscribe to memo reads after recomputing the value
2024-06-18 18:49:25 -07:00
Evan Almloff
b0caf442ab
Make it easier to provide context to fullstack (#2515)
* pass context providers into server functions

* add an example for FromContext

* clean up DioxusRouterExt

* fix server function context

* fix fullstack desktop example

* fix axum auth example

* fix fullstack context type

* fix context providers path
2024-06-18 20:38:06 -05:00
Evan Almloff
9d55bfc1dc
Integrate wasm-opt into the CLI (#2434)
* integrate wasm-opt

* include wasm opt configuration in the default dioxus.toml
2024-06-10 20:48:04 -07:00
Evan Almloff
e4764f2bba
switch from slab to slotmap for tasks to fix that ABA problem (#2488) 2024-06-07 14:36:08 -07:00
Evan Almloff
0127501dbf
Improve inline docs (#2460)
Improve inline docs

* improve incorrect event handler return error message

* Improve event handler docs

* document the eval functions

* document spawn and common spawn errors

* fix event handler docs

* add notes about how you use attributes and elements in rsx

* add doc aliases for attributes and events we rename

* add some more aliases for common search terms

* don't doc ignore any public examples in core

* don't ignore public doc examples in ssr

* don't ignore examples in the dioxus package readme

* add a warning when you launch without a renderer enabled

* fix some outdated element docs

* add a bunch of examples to resource

* add notes about desktop events

* add more docs for use_resource

* add on_unimplemented hint to Dependency

* fix some unresolved links

* add examples to each of the router traits

* add not implemented errors for router traits

* add an example to the routable trait

* expand rsx macro docs

* improve memo docs

* update the dioxus readme

* mention dioxus crate features in the docs

* fix a bunch of doc tests

* fix html doc tests

* fix router doc tests

* fix dioxus signals doc tests

* fix dioxus ssr doc tests

* fix use_future example in the hooks cheat sheet

* add a javascript alias for eval

* fix hook explanation values

* remove unused embed-doc-image dependency
2024-06-06 18:15:17 -07:00
Evan Almloff
e1044a2fa8 fix clippy 2024-06-06 15:34:52 -05:00
airblast
0eb16f27d4
chore: Remove unused dependency (#2466)
Removes the constcat dependeny from core-macro.
2024-05-31 07:06:55 -05:00
Marc Espin
7d529cf39c
fix: Avoid cloning a provided context unnecessarily (#2458)
* fix: Avoid clonning a provided context unnecessarily

* remove another useless clone in use_context_provider

* fix formatting

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-05-29 08:53:21 -05:00
Evan Almloff
b3cd4fac10
set up example scaping for docs.rs (#2450) 2024-05-28 13:05:55 -07:00
Evan Almloff
245003a5d4
Create a Static Site Generation platform; Deduplicate hot reloading code (#2226)
* create static site generation helpers in the router crate

* work on integrating static site generation into fullstack

* move ssg into a separate crate

* integrate ssg with the launch builder

* simplify ssg example

* fix static_routes for child routes

* move CLI hot reloading websocket code into dioxus-hot-reload

* fix some unused imports

* use the same hot reloading websocket code for fullstack

* fix fullstack hot reloading

* move cli hot reloading logic into the hot reload crate

* ssg example working with dx serve

* add more examples

* fix clippy

* fix formatting

* fix hot reload doctest imports

* fix axum imports

* don't run server doc tests

* Fix hot reload websocket doc examples
2024-05-22 07:24:15 -05:00
Andrew Voynov
720899e19e
feat(cli): now user interaction can be skipped (#1872)
when creating a new project
2024-05-14 09:39:56 -05:00
Jonathan Kelley
a0e06271dd
Fix: flaky CI by correcting autofmt to match proper spacing (#2369) 2024-04-26 12:04:56 -04:00
Evan Almloff
cbeda0af76
Refactor and fix eval channels (#2302)
* wip

* pull out eval into the interpreter

* fix web eval

* fix DioxusChannel name

* properly drop dioxus channel

* use typescript dioxus chanel in desktop

* add more comments to native eval

* add desktop headless eval tests

* expand web playwright eval tests

* fix web headless tests

* fix default hasher path

* run eval tests on windows

* restore desktop query drop code

* remove data from drop desktop query message

* catch syntax errors in desktop eval

* catch js runtime errors in desktop

* fix typo interprerter -> interpreter

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-04-26 11:55:48 -04:00
Evan Almloff
a27d4e71ed
Only compress web assets in the CLI (#2329)
* only compress web assets in the CLI

* precompressed -> pre-compressed

* only enable pre-compression in release builds
2024-04-26 00:47:04 -04:00
Evan Almloff
08da9a1253
Implement hash fragments in the router (#2320)
* implement hash fragments in the router

* clean up query and search example

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-04-25 14:30:25 -04:00
Evan Almloff
dd8e69635b
Fix calling server functions on desktop (#2357) 2024-04-25 14:24:46 -04:00
dependabot[bot]
2ce6d67fcd
Bump rustls from 0.21.10 to 0.21.11 (#2348)
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:04:35 -05:00
Evan Almloff
5ce91e1bfc
Fix flakey windows tests (#2332) 2024-04-17 15:08:38 -07:00
dependabot[bot]
7beacdf9c7
Bump h2 from 0.3.25 to 0.3.26 (#2253)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.25 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.25...v0.3.26)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 12:37:53 -07:00
Jonathan Kelley
7eccc7a104
Release 0.5.2
dioxus-cli@0.5.2
dioxus-fullstack@0.5.2

Generated by cargo-workspaces
2024-04-04 18:32:14 -07:00
Jonathan Kelley
9c5e5f969f
Release 0.5.1
dioxus@0.5.1
dioxus-autofmt@0.5.1
dioxus-check@0.5.1
dioxus-cli@0.5.1
dioxus-core@0.5.1
dioxus-core-macro@0.5.1
dioxus-desktop@0.5.1
dioxus-fullstack@0.5.1
dioxus-hooks@0.5.1
dioxus-html@0.5.1
dioxus-interpreter-js@0.5.1
dioxus-lib@0.5.1
dioxus-liveview@0.5.1
dioxus-mobile@0.5.1
dioxus-router-macro@0.5.1
dioxus-rsx@0.5.1
dioxus-signals@0.5.1
dioxus-ssr@0.5.1
dioxus-web@0.5.1
dioxus_server_macro@0.5.1
generational-box@0.5.1
rsx-rosetta@0.5.1

Generated by cargo-workspaces
2024-04-04 17:05:21 -07:00
Jonathan Kelley
44fe2defc2
Fix: memory leak on listeners for elements (#2244)
* Fix: memory leak on listeners for elements
* Recycle in manuallydrop

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-04 14:25:17 -07:00
Evan Almloff
4a622348f2
Fix the mobile feature on the dioxus crate (#2185) 2024-03-29 18:22:41 -07:00
David McNeil
d16ac4e736
Bump rfd to version 0.14 fixing 2149 (#2161) 2024-03-29 18:05:14 -07:00
Jonathan Kelley
f6c3b2745e
Release v0.5.0 2024-03-27 18:25:52 -07:00
Jonathan Kelley
41c3967052
use docfix interprocess 2024-03-27 16:57:24 -07:00
Miles Murgaw
44f3047780
Revision: Change Default Logging In CLI (#2157)
* revision: filter to warn logs

* revision: change to use DIOXUS_LOG
2024-03-27 12:07:44 -07:00
Jonathan Kelley
fd64d1a419
use vendored ssl on mac 2024-03-26 22:26:54 -07:00
Jonathan Kelley
d988ccc369
Cargo.lock 2024-03-26 19:22:57 -07:00
Evan Almloff
dadbab5d72
make some enums non-exhaustive (#2140) 2024-03-26 19:14:48 -07:00
Evan Almloff
1b03bed20a
Provide a better error message for wasm bindgen version mismatches (#2136)
* provide a better error message for wasm bindgen version mismatches

* fix clippy

* only rerun wasm bindgen if the first run fails

* remove old logs
2024-03-26 19:08:12 -07:00
Evan Almloff
2ac4bdb673
Switch to tracing for the cli (#2137)
* switch to tracing in the dioxus-cli

* bump manganis

* fix manganis features

* only print processing assets if skip assets is disabled

* switch all logs to tracing

* switch to published version of manganis

* undo all changes to cargo.toml

* remove reference to log
2024-03-25 15:21:51 -05:00
Evan Almloff
da3b066934 Revert "switch to tracing"
This reverts commit 6608f73a2e.
2024-03-25 10:09:53 -05:00
Evan Almloff
6608f73a2e switch to tracing 2024-03-25 10:07:31 -05:00
Jonathan Kelley
eb79e61642
Add a ton of comments to rsx/hotreload, add snapshot testing, refactor a bit to simplify the crate (#2130)
Merge dynamic context and dynamic mapping, clean up the rsx hotreload logic, and add location data to the Rsx objects
2024-03-24 13:31:26 -07:00
Miles Murgaw
acbf7dfc4f
fix: hot reload blocking (#2127) 2024-03-22 14:36:49 -07:00
Jonathan Kelley
e923c6462c
Resume window position/size, watch cargo/dioxus tomls, fix css reverting during hotreloading, allow menubar events to be captured from within dioxus (#2116)
* Fix: css hotreloading being invalidated, watcher not watching cargo/dioxus tomls, add feature to restore window state

* Make clappy hippier

* remove console log

* use simpler css invalidator

* Less flash, remove log on web hotreload

* Fix floating window managed behavior on mac

* clippy...
2024-03-20 09:16:18 -07:00
Evan Almloff
58f7efafea
Make EventHandler copy (#2112)
* implement Copy for EventHandler
* implement from closure for event handler and remove special on prefix
* fix props implementation of EventHandler
2024-03-19 19:48:53 -07:00
Jonathan Kelley
d8942a255b
Fix #2104: fmt incorrectly using 1-indexing for columns (#2106)
* Fix #2104: fmt incorrectly using 1-indexing for columns

* Clippy...
2024-03-18 18:23:45 -07:00
Jonathan Kelley
9c64fc4769
Fix #1938, allow explicit props 2024-03-18 15:34:46 -07:00
Jonathan Kelley
f266213618
Bump to 0.5.0-alpha.2 2024-03-18 02:02:31 -07:00
Jonathan Kelley
7d11984a0e
Chore: bump wry + tao 2024-03-14 23:11:25 -07:00
Jonathan Kelley
58233c6a3b
Merge branch 'main' into jk/fix-hotreloading-issues 2024-03-14 22:31:22 -07:00
Miles Murgaw
cfe412a3d5 update: fix cargo lock 2024-03-14 23:05:50 -04:00
Miles Murgaw
ab2e2c63d5 feat: fix unknown imports 2024-03-14 23:01:14 -04:00
Jonathan Kelley
7cc3264881
Move TUI renderer into blitz repo 2024-03-14 18:54:46 -07:00
Jonathan Kelley
c532d3ec1a
Merge branch 'main' into jk/fix-hotreloading-issues 2024-03-13 15:11:41 -07:00
Jonathan Kelley
982b96074a
Add basic hotreload test samples 2024-03-13 13:07:15 -07:00