* trim
* works a bit better
* almost...
* it work?
* yay!
* codex tried a thing
* move
* reduce to 1
* remove search
* simplify
* adjust test case
* clippy
* fix: Handle HTTP errors in FromResponseParts
Check for non-success status codes before attempting to decode response
parts. For error responses, parse the JSON error payload and convert it
to a ServerFnError::ServerError.
Also make ErrorPayload fields pub(crate) to allow internal access.
* fixed test name
* fix: replace unwraps with errors in fullstack WebSockets
* refactor: pull the conversions to fullstack `RequestError` up from the core crate
* no breaking changes
---------
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
* docs: fix grammar and typos in comments and documentation
* docs: use British English style for e.g. and i.e. (no trailing comma)
Changed from American English style (e.g.,) to British English style (e.g.)
for consistency with the rest of the codebase."
The `android_runtime_lock` wasn't properly `cfg` guarded in various
places, so it got included on all operating systems, not just Android by
accident. This causes deadlocks when trying to use `muda`.
* Use humantime for build duration formatting in CLI
Replaces manual millisecond formatting with humantime::format_duration for improved readability of build duration logs. Adds humantime as a dependency in Cargo.toml.
* Format build duration with millisecond precision
Changed build duration logging to use millisecond precision instead of default formatting to avoid microsecond/nanosecond noise.
* Refactor duration formatting to use helper function to reduce code duplication.
---------
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
Without this patch, simply instantiating the Jumpstart template in fullstack mode and making _any_ hot-patch change would result in a 404 on fetch and a client WASM panic.
This changes the fullstack server static asset routing so that, in debug builds, directories under the `public` tree (including `/wasm`) are served via `tower_http::services::ServeDir` instead of being eagerly expanded into a fixed set of routes at startup.
Today `dioxus_server::DioxusRouterExt::serve_static_assets` walks the `public` directory once at launch via `serve_dir_cached`, registering a separate route for every file it sees. That works fine for pre-baked assets, but it breaks down when dx/subsecond writes new files into `public` during a dev session. In a fullstack web app, wasm hot patches are emitted as timestamped files like `public/wasm/lib<name>-patch-<ts>.wasm`; the CLI tells the browser to fetch `/wasm/lib<name>-patch-<ts>.wasm` immediately, but the fullstack server never registered a route for that path, so the fetch returns 404 even though the file already exists on disk.
Non-fullstack dev builds do not have this problem because the dx devserver serves `public` directly using `ServeDir`, which consults the filesystem at request time. Fullstack dev, by contrast, proxies asset requests to the inner server, and that server only knows about whatever was in `public` at the moment its router was built.
This change narrows the gap by making `serve_static_assets` dynamic for directories in debug builds while preserving the existing behaviour elsewhere:
- For debug builds (`cfg(debug_assertions)`), `serve_dir_cached` now uses `ServeDir::new(&path)` when it encounters a directory. This means `/wasm`, `/assets`, and any other subdirectories are backed by a live directory listing, so new files like wasm patch modules and freshly emitted hashed CSS become immediately visible without restarting the fullstack server or rebuilding its router.
- For non-debug builds, the previous behaviour is preserved: `serve_dir_cached` continues to recurse and register one route per discovered file, still using `ServeFile::precompressed_br()` and `cache_response_forever` for hashed, cache-busted filenames.
This is a no-op for release builds, but in debug fullstack it's necessary for wasm hot patches and other dynamically-created assets that could 404 until the server happened to be restarted. It also aligns fullstack dev behaviour more closely with the plain web devserver, which already uses `ServeDir` for the `public` tree.
* Update repository URL and add README reference
* Fix repository URL and add readme field
Updated repository URL to point to the correct path and added a readme field.
* Update repository URL in Cargo.toml
* Update repository URL in Cargo.toml
* Update repository URL and add readme path
* Fix repository URL in Cargo.toml
---------
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
* attempt fix for flakey playwright test
* fix link
* disable blitz-shell file dialog
* remove rfd integration in native for now
* undo file-dialog pass-thru in anticipation of blitz-shell update
* upgrade to blacksmith
* blitz-shell bump
* use faster runner
Currently when `serve_subsecond` is used and the user doesn't run the
app with `dx serve --hot-patching`, the function causes the future to be
constantly recreated in a loop. This fixes the behavior so that the
future is awaited once and then `serve_subsecond` returns.
* Enable native for hotdog, file-explorer, and bluetooth-scanner examples
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Fix crash in calculator example
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Add config macro for native
* Add Config struct to dioxus-native
* Re-export dioxus-native as dioxus::native
* Fix calculator example to work with dioxus-native
* Fix calculator_mutable example to work with dioxus-native
---------
Signed-off-by: Nico Burns <nico@nicoburns.com>
* Use native drop handler to push full file paths into element drop handler
* Remove debug code
* fmt
---------
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This fixes a conflict between dx fmt and cargo fmt (rustfmt). Previously,
dx fmt would add indentation whitespace to blank lines inside RSX blocks,
but cargo fmt removes trailing whitespace from all lines. This made it
impossible for code to satisfy both formatters.
The fix skips adding indentation to empty lines in two places:
1. When indenting formatted RSX blocks inside expressions
2. When reassembling the final formatted output
Fixes#5223
Co-authored-by: Dmitry Minkovsky <dminkovsky@gmail.com>
* Don't push default features in `--no-default-features` builds
Signed-off-by: Nico Burns <nico@nicoburns.com>
* add tests for default features and no default features outside of renderers
---------
Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
* wip: failing test
* edit harness a bit
* wip, not fixed entirely
* fix comment accumulation and whitespace
* fix: autofmt syncrhonize edits with vscode waitUntil edit pipeline
* fix optimization collapsing away whitespace
* comment out test case for now
* implement const cbor encoding + decoding for basic types
* implement map encoding and decoding
* fix map test
* all tests passing
* dynamically sized arrays
* smaller str encoding
* swap array and list and add more documentation
* move serialization and deserialization for each struct together
* support both legacy and new assets
* bump const serialize version
* fix asset conversion code
* pull out manganis symbol struct from tuble
* test reading old asset versions
* more list/array cleanup and bump rust version
* fix clippy
* switch cli opt port
* install playwright deps
* split cli-optimization package to avoid two dioxus' in the same crate
* fix clippy
* force the toast.png asset to be included in the linker stage #[used] has platform depedant behavior
* bundle both formats in the link section and only use the asset the cli changed
* remove sudo which doesn't exist on windows
* add binstall to the playwright workflow
* separate bin target for the old cli
* lockfile
* cargo update to get versions shaken out
* notes on binstalls, add back `.read()` for compat
* use 0.8.0-alpha.0 for const-serialize instead of 0.8
this ensures we can still publish breaking changes on 0.8 without taking over the full version
* fix clippy in example
* small debug nits
* update rust-overlay in nix
* fix flake?
* migrate to new structure
* just comment out binstalls
* just remove old test harness
---------
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>