Commit Graph
174 Commits
Author SHA1 Message Date
Jonathan Kelley 4f1d039bad clean up prelude (#4416)
* clear away prelude on dioxus

* clippy

* wip - drop prelude from dioxus-html

* docs clippy

* wip

* more fixe

* delete all preludes

* doc...

* better export

* merge some imports

* fewer global imports

* global incremental renderer

* fix cargo doc
2025-07-16 16:04:13 -07:00
Evan Almloff ee3b45af49 Restore docs CI checks and fix all doc lints (#4204) 2025-05-26 19:50:51 +01:00
Evan AlmloffandJonathan Kelley d649b0c54d Fix mount use after removal/Simplify mounts a bit (#2834)
* remove clone mounted; mounted nodes should never leak into components?

* Remove the mount from vnodes after unmounting them

* Fix use after removal in iterator diffing

* remove logs

* Re-fix keyed list diffing

* Use new.len for diffing keyed lens and remove redundant check

* simplify core list diffing logic a bit

* remove println

* add proper asserts for new tests

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-08-13 22:47:12 -07:00
Matt HunzingerandEvan Almloff d07e81005f Better expect error messages (#2629)
* Replace expect error messages

* Change message

* Create RuntimeError struct

* Pass error through core methods

* Fix use of Runtime::current in signals package

* Fix tests

* Add #[track_caller] for better error output and fix maybe_with_rt

* provide a help message along with RuntimeError

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-07-24 13:31:56 -05:00
Tristan F.andJonathan Kelley 9167cd9dec fix most typos, add crate-ci/typos to CI (#2653)
* fix most typos, add crate-ci/typos to CI

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-23 17:49:33 -07:00
Evan AlmloffandJonathan Kelley 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 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 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
Jonathan Kelley 2dc6cecf2e Fix #2043: use formvalue instead of String for forms (#2103)
Fix #2043: use formvalue instead of String for forms
2024-03-18 18:21:08 -07:00
Evan Almloff 277e4677e9 fix clippy 2024-02-26 11:49:05 -06:00
Evan Almloff f539698963 add debug information for signal subscriptions 2024-02-26 11:46:01 -06:00
Jonathan Kelley 7b0dcb3206 Add flush_sync and pre_render methods to core 2024-01-28 01:30:33 -08:00
Jonathan Kelley c3d810bcd0 Little bit more cleanup in core 2024-01-16 18:07:29 -08:00
Jonathan Kelley 8b9bf57c03 Cleanup core more 2024-01-16 17:23:34 -08:00
Evan Almloff 55f76fede6 work on fixing some core tests 2024-01-10 19:21:15 -06:00
Evan Almloff 4a1a00b0f0 fix dioxus ssr 2024-01-10 17:57:15 -06:00
Evan Almloff 3865f44081 make desktop compile 2024-01-05 14:39:45 -06:00
Evan Almloff d90c71c508 move creation functions into the structs they are creating and unify user and system events 2024-01-05 13:18:48 -06:00
Evan Almloff 32b15fc851 make core compile 2024-01-05 12:25:18 -06:00
Evan Almloff 113b2c1529 port over more diffing + creation logic 2024-01-05 12:07:29 -06:00
Evan Almloff 0c76770da0 remove a lot of unsafe 2024-01-05 10:57:05 -06:00
Evan Almloff c70e2bfcb6 move diffing into the global runtime 2024-01-05 09:32:50 -06:00
Evan Almloff f42ef3ef9d remove more lifetimes 2024-01-05 08:39:22 -06:00
Evan Almloff 3ad16ddd37 rip out more lifetimes 2024-01-04 18:33:01 -06:00
Evan Almloff c9ff449e45 remove the bump allocator 2024-01-04 17:33:22 -06:00
Jonathan Kelley ea1325f6e8 Merge branch 'master' into polish-throw 2024-01-04 10:27:51 -08:00
Jonathan Kelley c1d9553e49 Merge pull request #1624 from Erithax/rename_into_node_traits
rename IntoDynNode and IntoTemplate traits
2024-01-04 10:25:49 -08:00
ealmloff 56478d1856 Merge branch 'DioxusLabs:master' into fix-event-bubbling 2023-12-16 06:34:00 -06:00
Evan Almloff a120af33ad Merge branch 'master' into fix-event-bubbling 2023-11-11 17:53:47 -06:00
Erithax c2749b3371 rename IntoDynNode and IntoTemplate traits 2023-11-09 02:00:36 +01:00
Evan Almloff 6141aeb037 polish the throw trait 2023-11-07 18:24:07 -06:00
Evan Almloff fca9d95519 fix props memory leak 2023-10-26 13:06:42 -05:00
Evan Almloff b99f081c08 drop any attribute after rendering 2023-10-25 16:37:04 -05:00
Evan Almloff 35b643e23f switch to bubble ids on vnodes to fix nodes under fragments pointing to an invalid parent 2023-09-11 15:55:58 -05:00
Evan Almloff 9552ab6c1c pass event propagation test 2023-09-04 19:10:11 -05:00
Evan Almloff cf04256395 try to keep template indexes valid 2023-08-31 16:14:14 -05:00
Jani MustonenandJani Mustonen 31f8bab20d Add ScopeId::ROOT (#1398)
* add ScopeId::ROOT

* replace ScopeId(0) with ScopeId::ROOT

---------

Co-authored-by: Jani Mustonen <jani.mustonen@taitounited.fi>
2023-08-25 08:31:23 -05:00
Evan Almloff d559fdaeab fix borrowed props with temp values 2023-08-12 19:19:46 -05:00
ealmloff 39ab39ac56 Merge branch 'DioxusLabs:master' into signals 2023-08-10 16:31:00 -05:00
Evan Almloff b4983706ac fix variance on components 2023-08-09 10:26:59 -07:00
Evan Almloff 4ee4cf23d3 restore a few unneeded breaking changes 2023-08-08 13:37:29 -07:00
Evan Almloff ddbe913e79 make signals non-breaking 2023-08-07 14:50:36 -07:00
Evan Almloff a6f611eccf fix subscriptions in events 2023-08-04 17:23:57 -07:00
Evan Almloff 998f9e0d00 remove static bound from props 2023-08-04 14:24:49 -07:00
Evan Almloff cb4c46154d fix scope context 2023-08-04 14:12:59 -07:00
Evan Almloff 04cdb14e5b improve signal copy runtime 2023-08-04 13:53:05 -07:00
Jonathan Kelley 4240f8428c Fix: dont use bumpslab anymore, just box scopestates 2023-07-19 18:40:43 -07:00
Jonathan Kelley 1d371bf971 Merge pull request #1213 from Demonthos/prep-sledgehammer-liveview
Prepare for Sledgehammer Bindgen in Liveview
2023-07-18 18:10:48 -07:00
Evan Almloff a96ccdc6f3 fix clippy 2023-07-18 13:16:17 -07:00
Jonathan Kelley f0128a3150 implement suspense using simpler approach 2023-07-14 17:12:07 -07:00