* dioxus-fullstack::Streaming: decode multiple client values from Bytes
* small nits
* remove the bidirectional stream since it doesn't work in the browser
* final cleanups
* nits
---------
Co-authored-by: Olivier Kannengieser <okanne@gmail.com>
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
* fix(fullstack): Streaming::into_inner() returning empty stream
The Streaming struct previously maintained separate input_stream and
output_stream fields, but into_inner() always returned input_stream.
This caused it to return an empty stream on both client and server sides
where data was placed in output_stream.
Consolidate to a single stream field that properly returns the actual
stream data when into_inner() is called.
Also add examples demonstrating bidirectional streaming:
- echo_stream: passes client stream through server unchanged
- transform_stream: transforms client stream on server using filter_map
- Use stream::unfold for cleaner client-side stream generation
Reviewed-by: Claude <noreply@anthropic.com>
Commit-message-by: Claude <noreply@anthropic.com>
* fmt
* issue-5045 Trim slashes to prevent base path resolution issues in web
* Revert "issue-5045 Trim slashes to prevent base path resolution issues in web"
This reverts commit 480cd48d8537a56f57538c21e7cc98b75e8dc8ad.
* This is a more comprehensive approach. No matter how "/" gets set into
DIOXUS_ASSET_ROOT (cli arg, dioxus toml, or env var) it will be
normalized when used.
* Move the trim fix to the locations we set the variable DIOXUS_ASSET_ROOT as
this environment variable is not meant for public consumption.
* pull out trimming into a method
---------
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Previously, when a file change event arrived while a build was in progress
(i.e., client stage was not Success/Failed/Aborted), the event was logged
and silently discarded. This caused issues with tools like stylance,
tailwind watch, or sass --watch that generate output files in response
to source file changes.
The typical failure case:
1. User saves a .module.scss file
2. dx starts rebuilding
3. stylance CLI (watching the same file) regenerates stylance.css
4. dx receives the stylance.css change event but discards it
5. Build completes with stale CSS
Now, file changes that arrive during a build are queued in a
pending_file_changes vector and processed after the build completes.
* disable strip setting in profile and manually strip with llvm the build
* remove rustc_llvm
* disable debug if wasm opt will run
* fix clippy
* don't strip if we are splitting with wasm-split
* keep names when running wasm-split
* Fix stores deadlock
* fix clippy
* more clippy fixes
* move panic for reading invalid keys into userland instead of in the
hashmap iter method
* apply the same fixes to btreemap
* return a dropped error instead of panicing if the item has been removed
* Make dioxus-native work on iOS simulator
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Bump dioxus-native to v0.7.1
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Update package version to use workspace versioning
---------
Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
Getting full panics here in prod:
thread '<unnamed>' (23) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-fullstack-0.7.0/src/magic.rs:554:22:
called `Result::unwrap()` on an `Err` value: Response { status: 500, version: HTTP/1.1, headers: {"content-type": "application/json"}, body: Body(UnsyncBoxBody) }
Could be triggered by something as simple as a client choosing to send formdata-style body instead of JSON. (I discovered this because exactly that was happening; not maliciously, but because of the upgrade from 0.6.3 to 0.7).
As far as I can tell, this was just meant to be an early return with a failure case of the Response, mapped from the ServerFnError. The .unwrap() left there was probably just an erroneous artifact from the various waves of the development process.
If this is incorrect or I've missed something, please let me know! But I believe this is a very simple fix for an otherwise critical problem
This flag allows users to get the raw JSON output from cargo instead
of having it processed by Dioxus. This is useful for integration with
other tools that expect cargo's native JSON diagnostic format.
When enabled, cargo's JSON messages are relayed directly to stdout
while still allowing DX to track essential build information internally.
Usage: dx build --raw-json-diagnostics
* fix(fullstack-macro): allow server functions to be called without HTTP context
Server functions can now be invoked directly from server-side code without
requiring an HTTP request context. When called outside an HTTP handler,
extractors will use default values instead of failing, matching the behavior
of the old server_fn implementation.
Closes#4907
* fix(fullstack-macro): allow server functions without extractors to be called from backend
Functions with no server extractors use Default::default() and work from backend code.
Functions with extractors still require HTTP context.
Closes#4907