Commit Graph
100 Commits
Author SHA1 Message Date
Evan Almloff 53ef78823d Fix web redirect routes (#4109) 2025-05-14 08:42:23 +02:00
Evan Almloff 6b70ba7cd2 Fix websocket server functions and add an example (#4107)
* Fix websocket server function

* Add websocket test

* add a websocket example

* fix clippy
2025-05-14 08:28:43 +02:00
Evan AlmloffandJonathan Kelley ad63d529fd Merge static and dynamic styles (#3950)
* Merge static and dynamic styles

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-05-07 14:15:15 -07:00
Evan AlmloffandJonathan Kelley be01cf1485 Fix the base path in desktop builds (#3949)
* Fix the base path in desktop builds

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-05-07 13:52:56 -07:00
Evan Almloff 04b14c5abc Fix clearing error boundaries (#4041) 2025-05-07 13:31:47 -07:00
Evan Almloff d857629115 remove signal write warnings (#4024) 2025-04-22 00:32:57 -07:00
Evan Almloff bcc1dc020c Fix javascript asset bundling errors and fallback (#3935) 2025-04-15 14:38:11 -07:00
Evan Almloff 84221f55a0 Wait for the suspense boundary above the router to resolve before sending the first streaming chunk (#3891)
* Change the suspense streaming context after suspense is resolved in the router

* Wait for the suspense context before streaming the first chunk in ssr

* forward more response parts

* warn

* extract the hydration format into a crate

* Fix hydration when no data is sent

* forward web and server features

* Fix suspense that starts on the client

* fix use_server_future on the client

* Add documentation for fullstack hooks and protocol

* downgrade rust edition

* fix clippy

* fix tests

* fix clippy

* Fix pure web compile

* undo changes to the fullstack router example

* fix formatting
2025-04-08 16:01:21 -05:00
Evan Almloff 4f74ef81d1 Fix escaped text in ssr stylesheets and scripts (#3933) 2025-04-07 18:38:46 -07:00
Evan Almloff 16cae8abaf fix key validation logic (#3936) 2025-04-07 17:29:53 -07:00
Evan Almloff 5e9a505465 Fix select multiple default value (#3953)
* Fix select multiple default value

* Add a playwright test for select multiple
2025-04-07 17:28:26 -07:00
Evan Almloff cbb91d694f Fix component macro with where clause (#3951) 2025-04-07 16:36:16 -07:00
Evan Almloff 589440b9cb Allow spread attributes to be set directly (#3881)
* allow spread attributes to be set directly

* Remove ordering requirement
2025-04-07 16:35:16 -07:00
Evan Almloff 8c866b783d Remove default features when fullstack is enabled and one platform is enabled in the default features (#3925)
* Don't enable default features when only either the server or client is enabled
2025-04-07 16:19:48 -07:00
Evan Almloff 44025340c7 Fix windows CI by removing virtual file system cache (#3912)
* try to fix windows CI

* just remove the vfs logic
2025-04-04 10:40:54 -07:00
Evan Almloff 09a4b5eb4e Return a 404 when paring the route fails (#3860)
* return a 404 when paring the route fails

* add a playwright test for fullstack routing status codes

* Fix new playwright test

* document SSRError

* Make SSRError public and fix clippy

* Move the error display bound to the routable trait

* fix clippy

* return a more generic 404 message

* fix router tests
2025-03-14 00:51:44 -07:00
Evan Almloff 8dbb652628 update the server function crate to 0.7 (#3560) 2025-03-04 14:29:56 -06:00
Evan Almloff eccd75a1fe Switch the default server function codec to json (#3602)
* Switch the default server function codec to json

* test both input and output encoding
2025-03-04 14:20:56 -06:00
Evan Almloff f4c59e1188 Fix span locations in ifmt and components (#3823)
* Fix span locations in ifmt

* Fix component spans

* Blame extra children on the first child element

* fix clippy
2025-03-04 12:25:07 -06:00
Evan Almloff 0251221c69 Fix the typo checking CI (#3824) 2025-03-03 21:32:59 -06:00
Evan Almloff 1fa172486b Add helper methods to provide a single clone server only context (#3483)
* Add helper methods to provide a single clone server only context

* fix clippy
2025-02-27 10:19:16 -08:00
Evan Almloff ceb1a0e796 Prevent default if an onclick event is triggered on a button under a form (#3804) 2025-02-27 10:08:26 -08:00
Evan Almloff 797e7492a1 Fix hot reloading component removal with formatted attribute values (#3559)
* Fix hot reloading component removal with formatted attribute values

* fix semvar
2025-02-24 13:18:21 -08:00
Evan Almloff b443309f6e Hash and compare templates by value in debug mode (#3630)
* Hash and compare templates by value in debug mode

* add a regression test for layout state persisting after navigation

* More reliable static item merged detection
2025-02-07 16:35:32 -08:00
Evan Almloff 1c902ab729 Fix serving desktop+fullstack apps that have not set a server url (#3701)
* Fix serving desktop+fullstack apps that have not set a server url

* revert fullstack desktop example changes
2025-02-07 16:07:06 -08:00
Evan AlmloffandJonathan Kelley 5bb7f51cba Remove the stylesheet component (#3176)
* Remove the stylesheet component

* add props to style component

* don't remove stylesheet

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-01-31 15:06:14 -08:00
Evan Almloff 2d188452ae Fix additional attributes for js renderers (#3625) 2025-01-31 14:31:31 -08:00
Evan Almloff 4c8e8567cf Fix the pwa example (#3664) 2025-01-28 09:40:44 -08:00
Evan Almloff c85018300b Ignore write while rendering warning in memo lazy recompute (#3647) 2025-01-27 14:33:15 -08:00
Evan Almloff bd30516490 Fix web eval return (#3656)
* Fix web eval return

* add regression test to playwright
2025-01-27 12:57:20 -08:00
Evan Almloff fb7b1a30bf Use the launch builder instead of web launch in the fullstack auth example (#3640) 2025-01-24 16:24:08 -08:00
Evan Almloff 13dcd80fbf Optimize wasm bindgen asset with manganis (#3531) 2025-01-21 15:14:45 -08:00
Evan Almloff 640a3e00af Remove the todo list from the examples readme (#3613) 2025-01-21 09:17:23 -08:00
Evan Almloff f99e50b0aa Fix hot reload diffing to empty rsx (#3567)
* Fix hot reloading to empty rsx

* Only normalize the template when hot reloading and rendering

* add a test for emptying out an rsx block in hot reloading
2025-01-21 00:33:29 -08:00
Evan Almloff e199e86dad Fix fullstack hackernews example instructions (#3597) 2025-01-20 16:35:32 -08:00
Evan Almloff aba2e73025 Simplify fullstack auth example (#3598) 2025-01-20 16:35:19 -08:00
Evan AlmloffandJonathan Kelley e22ea0c2ff Fix repeated subscription to dropped scope leak (#3569)
* Fix repeated subscription to dropped scope leak

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-01-16 17:35:14 -08:00
Evan Almloff 857c3e232e Fix rsx expression autocomplete (#3568)
* Fix autocomplete in node and attribute expressions

* Fix release expansion

* revert changes to expr_node

* fix rsx expansion in release mode
2025-01-14 10:51:39 -08:00
Evan Almloff 2924ec4678 Fix pointer provenance in const rust with zero sized type enum variants (#3532) 2025-01-10 13:01:15 -08:00
Evan Almloff c4b5e7dbf1 Remove doctor command which doesn't do anything (#3536) 2025-01-10 12:55:11 -08:00
Evan Almloff 76cf2f0bfe Fix server crash logging and opening fullstack apps (#3488) 2025-01-08 19:54:11 -08:00
Evan Almloff 5b5e3d3960 Fix ssg race condition (#3521)
* Fix server crash logging and opening fullstack apps

* Fix the event handler memory leak

* Add a regression test for memory leaks

* add a component to the memory leak test

* Fix race condition during SSG

* move route prerendering into a separate stage

* Fix static site generation with dx serve

* only proxy the fullstack server if ssg is disabled

* test nested-suspense with ssg in playwright
2025-01-08 19:53:51 -08:00
Evan Almloff ecc419df0a Fix ssg race condition (#3521)
* Fix server crash logging and opening fullstack apps

* Fix race condition during SSG

* move route prerendering into a separate stage

* Fix static site generation with dx serve

* only proxy the fullstack server if ssg is disabled

* test nested-suspense with ssg in playwright
2025-01-08 19:52:10 -08:00
Evan Almloff 5ea0867a34 Fix the test_stream function running after the stream is closed (#3396) 2025-01-08 15:00:05 -08:00
Evan Almloff c8d6444e88 Improve error message when dx is called on a virtual or library package (#3505)
* Improve error message when dx is called on a virtual or library package
2025-01-07 23:30:52 -08:00
Evan Almloff d890cc72ac Fix mounted event after initial hydration (#3480)
* trigger queued mounted events immediately after hydrating

* add a playwright test to prevent regressions
2025-01-07 19:52:27 -08:00
Evan AlmloffandJonathan Kelley d41ab3a756 Fix hydration of suspense fragments that contain text nodes (#3287)
* Fix hydration of suspense fragments that contain text nodes

* fix release builds

* disable link deduplication

* restore meta tag deduplication

* Add a test for the failed hydration case

* make changes to the document trait non-breaking

* remove info log from server future hook

* restore default implementation - this was also a breaking change

* fix semver breakage

* clean up server_future

* Cleanup unused code

* fix clippy

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-01-07 19:47:23 -08:00
Evan Almloff 57d637184f Fix Routable::parent with hash segments and query params (#3484)
* Fix Routable::parent with hash segments and query params
2025-01-07 15:42:13 -08:00
Evan Almloff 19ca7075d6 Fix the event handler memory leak (#3508)
* Fix the event handler memory leak

* Add a regression test for memory leaks

* add a component to the memory leak test
2025-01-07 11:44:54 -08:00
Evan Almloff 807cfd29b7 Use a better default browser list and fail gracefully when css parsing fails (#3509) 2025-01-07 10:38:05 -08:00
Evan Almloff 01ebccc269 Assume the virtual dom is not rendering while not diffing components (#3406)
* Invert when the rendering flag is set

* Add a playwright test to make sure effects, and web-sys integration is working

* fix playwright test
2024-12-20 12:08:57 -08:00
Evan Almloff 21fdecd219 Don't panic if the duration is negative in try_get_or_insert (#3413) 2024-12-20 12:02:07 -08:00
Evan Almloff ecf8d16f3e Fix event closure invoked recursively (#3405) 2024-12-20 12:01:31 -08:00
Evan Almloff aab1258f0e remove the file engine feature in the html crate (#3392) 2024-12-20 12:00:03 -08:00
Evan Almloff df719241fa Improve the second example in the read write same scope warning (#3374) 2024-12-17 15:32:01 -08:00
Evan Almloff c0e01f99af Fix onmounted event triggering many times (#3346)
* Fix event handler diffing

* Add headless tests for the onmounted event

* fix typo triggerd -> triggered
2024-12-17 15:21:15 -08:00
Evan Almloff 3e1e7f05e7 Fix client side liveview links (#3341)
* Fix liveview links

* Serve all routes under with_virtual_dom
2024-12-11 11:12:20 -08:00
Evan Almloff d89ab3cfad Always run toast eval inside the runtime (#3313) 2024-12-10 16:47:51 -08:00
Evan Almloff 38cb2759e8 Fix enable_out_of_order_streaming doc example and manganis macro remote example (#3317) 2024-12-09 11:58:10 -08:00
Evan Almloff b643461129 Fix hot reloading stylesheets with an existing query parameter and deduplicate random query param (#3315) 2024-12-09 09:09:57 -08:00
Evan Almloff 29a7325bb7 Expose streaming options to choose between full prerendering and out of order streaming (#3288)
* expose streaming options to choose between full prerendering and out of order streaming

* add examples to streaming_mode
2024-12-04 13:25:08 -08:00
Evan Almloff 5fc099b30a document Write, GenerationalRef, and GenerationalRefMut (#3253) 2024-12-02 11:35:33 -08:00
Evan Almloff 9dc567255a Fix fullstack axum integration docs (#3263)
* Fix broken fullstack doc tests

* include all features in doc test

* fix clippy
2024-12-02 11:35:13 -08:00
Evan Almloff 354c4ce9cc Fix diffing cloned rsx nodes by deep cloning nodes before mounting them (#3271)
* Fix diffing cloned rsx nodes by deep cloning nodes before mounting them

* fix clippy
2024-12-02 11:35:01 -08:00
Evan Almloff a7806583b2 Fix hot reloading identical event handler closures (#3270) 2024-12-02 11:34:15 -08:00
Evan Almloff 3d62fbf021 Fix base path on web and fullstack (#3247)
* Create a crate for constant serialization of config structs for manganis

* use SerializeConst for the image asset builder

* switch to a declarative macro for assets

* clean up asset macro a bit

* add serializable options for each asset type

* serialize const vec

* Add unique path formatting

* implement the new manganis macro

* optimize assets in the CLI

* Fix clippy

* Fix assets with dioxus formattable

* reduce fuzzing test limits

* use the new syntax in examples

* fix formatting

* Final doc and test pass on const-serialize

* fix avif support

* Fix manganis doc tests

* cache asset optimization

* Split out asset and bundled asset

* make hash pointer width independent

* remove const serialize cargo lock

* Fix manganis macro docs

* all tests passing

* add constvec::is_empty method to fix clippy lint

* remove nasm feature

* simplify test_rsplit_once test so typos passes

* fix range syntax for stable

* revert example change from clippy fix

* remove dioxus-static-site-generation workspace dependency

* always accept unix paths

* fix windows path seperator

* fix folder asset hash

* Optimize assets in a blocking task

* Fix asset options docs

* Document Asset and BundledAsset

* move manganis back into it's own folder

* simplify the linker macro a bit

* add more docs to AssetParser expansion

* fix manganis core doc test

* add image format helpers

* Fill in new cargo.tomls

* fix folders with explicit options

* Split by  both unix and windows path separators and take the smallest one

* fix string length

* Fix base path on web and fullstack

* Fix assets with base path

* fix fullstack base route with trailing slash

* fix clippy
2024-11-27 10:40:55 +03:00
Evan Almloff f9617c8d33 Restore manganis optimizations (#3195)
* Create a crate for constant serialization of config structs for manganis
* use SerializeConst for the image asset builder
* switch to a declarative macro for assets
* add serializable options for each asset type
* implement the new manganis macro
* optimize assets in the CLI
* Fix assets with dioxus formattable
* reduce fuzzing test limits
* use the new syntax in examples
* fix avif support
* Fix manganis doc tests
* cache asset optimization
* Split out asset and bundled asset
* make hash pointer width independent
* Fix manganis macro docs
* add constvec::is_empty method to fix clippy lint
* remove nasm feature
* simplify test_rsplit_once test so typos passes
* revert example change from clippy fix
* always accept unix paths
* fix windows path seperator
* fix folder asset hash
* Optimize assets in a blocking task
* Fix asset options docs
* Document Asset and BundledAsset
* simplify the linker macro a bit
* add more docs to AssetParser expansion
* add image format helpers
* Split by  both unix and windows path separators and take the smallest one
2024-11-26 18:12:24 +01:00
Evan Almloff 21465390f8 Fix write on render warning with read only signal props (#3194) 2024-11-13 11:48:43 -05:00
Evan Almloff 128608f3b2 Don't run effects from dead recycled scopes (#3201)
* Don't run effects from dead recycled scopes

* Fix scheduler
2024-11-13 11:48:30 -05:00
Evan AlmloffandJonathan Kelley 45a1147ffd Fix subscriptions for read only signals passed as props (#3173)
* add a fuzzing test for reference counted generational boxes

* Fix subscriptions for readonlysignal passed as props

* Don't subscribe to dropped contexts

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-11-10 21:35:33 -05:00
Evan Almloff 5186d8dded Fix as web event (#3178) 2024-11-06 23:53:56 -05:00
Evan Almloff 416811ba3a Fix providing context to server functions (#3174)
* Fix providing context to server functions

* Fix fullstack context test
2024-11-06 13:30:41 -05:00
Evan Almloff bb0de9a55a Fix isg streaming (#3156) 2024-11-01 13:01:04 -07:00
Evan Almloff 412f0b5c44 Fix the current route in ssr fullstack rendering (#3153) 2024-11-01 11:30:52 -07:00
Evan Almloff caa9759e44 add a warning about using use_hook(RefCell) in the docs (#3151) 2024-10-31 12:49:49 -07:00
Evan Almloff 37a6e9200f Fix if chain attributes with mixed expressions and strings (#3149)
* Fix if chain attributes with mixed expressions and strings
2024-10-31 12:48:25 -07:00
Evan AlmloffandJonathan Kelley 281087469a Move the history provider into the context (#3048)
* move history providers into a separate crate

* start moving route providers into the renderers

* clean up intoroutable

* remove into routable

* fix router tests

* Provide history providers in each renderer

* implement nested routers

* move the lens out of the history crate

* re-export dioxus history trait in the prelude

* also re-export the history function

* fix history doctests

* some light cleanups

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-31 12:44:04 -07:00
Evan Almloff 5d99889728 Fix liveview launch (#3145) 2024-10-30 09:32:18 -07:00
Evan Almloff ef436e4ed0 Fix inserting attributes after expanding dynamic nodes (#3094) 2024-10-24 13:43:39 -07:00
Evan AlmloffandJonathan Kelley 519ec9d294 Move the document trait into a separate crate (#3035)
* add a default head method through eval
* remove the old document trait
* implement document for each platform
* pull out document into a dedicated crate to cut down on shared dependencies
---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-14 10:33:37 -07:00
Evan AlmloffandJonathan Kelley baf5a95cae Fix cloned rsx double drop (#2839)
* Implement Rc generational pointers

* Clean up error handling a bit

* start adding tests

* Simplify a few types

* Separate Rc and normal generational boxes

* Add tests for rc drop and read

* Move over the pointer instead of the data in ReadOnlySignal props

* Fix panic on ref drop and release mode builds

* final rc signal cleanup

* use rc generational boxes for event handlers as well

* add a regression test for read only signal cloning

* merge main

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-14 09:23:09 -07:00
Evan AlmloffandJonathan Kelley 20d146d9bd Simplify the launch builder (#2967)
* improve documentation for the fullstack server context

* Add a section about axum integration to the crate root docs

* make serve_dioxus_application accept the cfg builder directly

* remove unused server_fn module

* improve fullstack config docs

* improve documentation for the server function macro

* fix axum router extension link

* Fix doc tests

* Fix launch builder

* Simplify the launch builder

* don't re-export launch in the prelude

* refactor fullstack launch

* Fix fullstack launch builder

* Update static generation with the new builder api

* fix some formatting/overly broad launch replacements

* fix custom menu example

* fix fullstack/static generation examples

* Fix static generation launch

* A few small formatting fixes

* Fix a few doc tests

* implement LaunchConfig for serve configs

* fix fullstack launch with separate web and server launch methods

* fix check with all features

* dont expose inner core module

* clippy and check

* fix readme

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-10 16:00:58 -07:00
Evan Almloff 6a0c1c392b Improve documentation for the fullstack crate (#2952)
* improve documentation for the fullstack server context

* Add a section about axum integration to the crate root docs

* make serve_dioxus_application accept the cfg builder directly

* remove unused server_fn module

* improve fullstack config docs

* improve documentation for the server function macro

* fix axum router extension link

* Fix doc tests

* Fix launch builder

* Remove redundant server_only inside server function

* Fix isrg config path
2024-10-10 13:40:11 -07:00
Evan Almloff cda8bb24f1 Remove native and web features from dioxus-html (#3006)
* remove native and web features from dioxus-html

* Fix downcasting web events

* Fix desktop with tokio disabled
2024-10-10 13:35:59 -07:00
Evan Almloff 1053943073 Fix special characters in head elements (#3031) 2024-10-09 13:48:58 -05:00
Evan Almloff a693ddffa3 Fix partially formatted if chains in attributes (#2999) 2024-10-09 13:48:33 -05:00
Evan Almloff d64df87aba Escape HTML as we translate to rsx (#3038) 2024-10-08 07:02:02 -05:00
Evan Almloff 9ffd4b816b Fix restarting coroutines (#3005)
* Fix restarting coroutines

* Fix popup example
2024-10-03 18:48:26 -05:00
Evan AlmloffandMatt Hunzinger d1c84d9a25 Fix memo dirty flag after unrelated writes (#2992)
* Fix memo dirty flag after unrelated writes

* improve regression test

* Update packages/signals/tests/memo.rs

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>

* Update packages/signals/tests/memo.rs

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>

* Update packages/signals/tests/memo.rs

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>

---------

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>
2024-10-01 15:47:54 +00:00
Evan Almloff 5925f3c8ee Use the absolute path for result in the macro (#3017) 2024-10-01 10:26:55 -05:00
Evan Almloff f9c2f740c2 Pull out asset handler refactor from https://github.com/DioxusLabs/dioxus/pull/2972 (#3000) 2024-10-01 10:25:31 -05:00
Evan Almloff 95976d9a17 Extend head components with global attributes (#2888)
* Fix hot reloading components with keys

* include component formatted segment keys, but not dynamic component value

* extend each head component with the corresponding element

* Allow spreading custom attributes into components

* Fix component_literal_dyn_idx index

* add a new test for hot reloading components with keys

* FIx script without body warning and rendering styles with a href set

* fix clippy
2024-10-01 10:24:22 -05:00
Evan Almloff 87c2f64f13 Fix dx bundle command and resources panic (#2951) 2024-09-13 01:30:47 -07:00
Evan Almloff 37d5f93c21 Remove mention of suspense/streaming in readme comparison - dioxus now supports streaming suspense (#2950) 2024-09-12 19:49:18 -05:00
Evan Almloff eecefb796e bump wry (#2945) 2024-09-09 14:57:59 -05:00
Evan Almloff 6ff7a54706 Fix custom launch builder with unsized context types (#2920) 2024-09-07 13:35:44 -05:00
Evan Almloff c11f2ed3cd Allow hooks in the expression of a match statement and if statement (#2902)
* Allow hooks in the expression of a match statement and if statement

* Don't allow hooks in spawn and detect hooks in initialization closures

* Point to DX check when hooks are called conditionally
2024-09-07 13:35:15 -05:00
Evan Almloff 7bb53fe835 Parse trailing route slash (#2896)
* Parse trailing route slash

* Fix typo
2024-09-07 13:34:57 -05:00
Evan Almloff aa0ea444cf Fix ordering issues when with_menu(None) is called before setting the window builder (#2903) 2024-08-29 15:51:31 -05:00
Evan Almloff 4676171861 Fix hot reloading components with keys (#2886)
* Fix hot reloading components with keys

* include component formatted segment keys, but not dynamic component value

* Fix component_literal_dyn_idx index

* add a new test for hot reloading components with keys

* Even more tests

* make clippy happy

* fix typo
2024-08-28 18:53:11 -05:00