Commit Graph
4949 Commits
Author SHA1 Message Date
Nico Burns 6524f55462 Upgrade Blitz to 0.1.0-rc.1 (#4452)
* Update to newer version of blitz_dom::Document trait

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Native: use DocumentConfig parameter

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Native: set event converter less often

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Native: count event handlers and skip events if none

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Upgrade to Blitz 0.1.0-rc.1

* Fix typo

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix native-headless example

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Use workspace deps for native-headless-in-bevy example

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix native-headless-in-bevy example (for blitz 0.1.0-rc.1)

* Fix native-dom-document doc tests

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-07-22 13:08:36 -07:00
Evan Almloff 18fe6de9a0 Fix server function warning with default features (#4453)
* fix server function warning with default features

* document and hide mock client

* fix clippy

* more clippy fixes

* fix formatting
2025-07-22 11:48:47 -07:00
Evan Almloff 98f7667fb4 Remove dioxus-lib, fix doc imports (#4438)
* remove dioxus lib

* inline some doc items

* fix tests

* test docs

* Fix doc tests

* Pull out dioxus/lib feature

* disable logger and devtools in library feature

* fix cargo doc

* fix cargo doc
2025-07-18 14:51:07 -07:00
Himmelschmidt 4cb32d372b Fix Tailwind race condition in fullstack serve mode (#4433)
Skip Tailwind watcher in fullstack mode to prevent race conditions between
the watcher and prebuild() both trying to install/run Tailwind simultaneously.

In fullstack mode, the client build's prebuild() properly handles Tailwind
generation, making the watcher redundant and problematic.

Fixes "Text file busy" error when running:
dx serve --fullstack true --platform web

Fixes #4431
2025-07-18 11:09:08 -07:00
Evan Almloff 71b00ab171 Fix assets with odd extensions and fix race condition with duplicate assets with different sources (#4436) 2025-07-18 11:08:18 -07:00
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
Juan VásquezandJonathan Kelley 54d465a7b5 Avoid the accidental removal of comments inside expressions by dx fmt (#4410)
* Avoid the accidental removal of comments inside expressions by dx fmt

* Rewrite the logic to pass failed tests

* Removed unnecessary call to write_inline_comments

* add failing test case

* alter parsing a bit to handle more test cases

* almost there...

* fix

* use threadlocal

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-07-16 13:51:43 -07:00
Jonathan Kelley 88c693b2e4 fix: don't eat comments in more situations (#4423)
* fix: don't eat comments in more situations

* clippy...
2025-07-15 14:39:35 -07:00
Jonathan Kelley 57dba1949c Capture the rustc environment and project it into run (#4421) 2025-07-15 14:27:04 -07:00
Evan Almloff 0d2e1f4051 Prevent desktop reloads at the wry level (#4422)
* Prevent desktop reloads at the wry level

* add a test

* only allow one navigation
2025-07-15 14:26:52 -07:00
Jonathan Kelley 393246b923 fix unicode characters in line printing (#4420)
* fix unicode characters in line printing

* remove outdated comment
2025-07-15 11:52:49 -07:00
Jonathan Kelley 01a50cdcaa Fix: drop pollster in lieu of std::sync::mpsc 2025-07-14 17:53:30 -07:00
Nico BurnsandJonathan Kelley 9db593e303 Example of rendering a dioxus-native app to a texture (#4365)
* Create example of rendering a dioxus-native app to a texture

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Use dioxus-native-dom crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

* bump lock

* cleanup cargo tomls

* rustc hash

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-07-14 17:48:51 -07:00
Evan AlmloffandJonathan Kelley b9b847c3f8 Warn about assets being stripped if strip is true and the current package depends on manganis (#4400)
* warn if we both find manganis in the dependencies and strip is enabled in the current profile

* bump node

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-07-14 17:35:29 -07:00
Jonathan Kelley 9bfde632f9 fix link opening on mobile (#4415)
* fix link opening on mobile

* fix compil;e

* ughh just use webbrowser

* remove open
2025-07-14 16:51:53 -07:00
Jonathan Kelley 2dec6205c8 fix: only link c++_shared, don't link c++ always 2025-07-14 15:47:46 -07:00
Evan AlmloffandJonathan Kelley 3f62cd8fc0 Reconnect the edits websocket if it disconnects (#4391)
* Reconnect the edits websocket if it disconnects

* restart the server if the OS kills it

* fix clippy

* clean up code and add more comments

* cleanups

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-07-14 13:39:21 -07:00
c5b33924ae updated the dependencies - maintaining compatibility and tests (#4363)
* Update dependencies in Cargo.lock

* added in the missing bevy example which was included in recent merge

* undo unneccessary library installation in gh actions

* cleaned up further

* Update dependencies in Cargo.toml and Cargo.lock askana_escape to 0.13

* updated code to make tests work

* updated the wgpu texture example

* replaced all direct reference with use

* fixed wgpu and jsframework errors in benches and examples

* Fix: Import black_box from std::hint

* grand finale upgrade

* updated cargo.lock

* Bump hyper-util to 0.1.15 and plist to 1.7.4

* remove some unused swc dependencies and add a command to update them in the future

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-07-14 13:03:40 -07:00
bananabit-dev 93147587b8 Fixed touch input it will now serialize the touchlist (#4406)
* fixed branch

* serializeTouchEvent fix
2025-07-14 13:00:06 -07:00
Jonathan Kelley 727752a965 final 0.7 fixes: xcode 15/16 hybrid, auto openssldir for android, include_*! tracking hotpatch, fix /assets/ brick at high opt levels, windows linker file, etc (#4376)
* wip: openssl autodetection

* add voltaile read inside of asset fn

* support xcode 15 for --device

* vendor openssl on android

* Smaller width TUI

* switch to anyhow for the entire CLI

* add backtrace and print double printing of cargo_metadata errors

* add some padding to multi-line anyhow error

* check semvers

* don't open if not interactive

* set the tailwind current_dir so it doesn't twitch

* get the oboe demo working

* copy the c++ library on android

* cleanup env vars

* add depinfo watcher

* fix stale hotpatches and crate count

* add musl support

* remove outdated autofmt test

* update scanner app

* add hotdog app and bundle to ci

* upload dx on every branch

* collapse mobile into desktop

* `dx doctor` command

* windows command files

* no pipe on doctor

* fix ci?

* fix links

* fix ci

* use main instead of nightly

* bump node

* build cli for host

* cargo doc

* prep dog_app for bundle

* package hotdog

* no bundle or nightly cli

* comment out nightly cli

* add quotes to linker files
2025-07-14 12:54:15 -07:00
rennanpo 1a494d1f5e fix(bundle): add serde defaults to prevent deserialization errors (#4398) 2025-07-08 17:52:48 -04:00
Himmelschmidt b82ba85653 Add PartialEq and Eq derives to ServerFnError (#4393)
This fixes the missing `PartialEq` implementation for `ServerFnError` in v0.7.0-alpha.2 which was breaking `use_memo` functionality.

Closes #4387
2025-07-08 13:24:34 -04:00
Nico Burns a4ebdcb69e Native: Split dioxus-native-dom crate out of dioxus-native (#4366)
Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-07-07 22:14:59 +01:00
Evan Almloff b252528722 Fix router state after client side navigation (#4383)
* Fix router state after client side navigation

* add client side navigation to the fullstack routing spec

* fix playwright test
2025-07-07 13:43:32 -05:00
Nico Burns ddc94cf44c Native: Accept winit::WindowAttributes as a config value (#4364) 2025-07-06 12:44:00 -04:00
5495bcedb4 Add a bevy-texture example based on wgpu-texture (#4360)
* Add a bevy-texture example based on wgpu-texture

* Use git branch of Blitz

* Update existing code to new blitz

* Use Device from Dioxus for bevy

* Use ManualTextureView

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix texture size on window resize

* Clean code

* Rename example to 'bevy-example' in 'bevy' directory

* Upgrade to blitz 0.1.0-alpha.5 and anyrender 0.4

* Install alsa in CI

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add libudev to CI

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Jerome Caucat <jerome.caucat@smartshape.com>
Co-authored-by: Nico Burns <nico@nicoburns.com>
2025-07-04 22:01:00 +01:00
David Bernard a66bffb487 fix: allow to name module std in project (#4353)
add missing prefix '::' for use of 'core' or 'std' module

RELATED #4331
2025-07-02 08:03:13 -05:00
Josh Rose a0f83f2679 Reclaim element id for all removed nodes (#3782)
* reclaim el id for nested dyn nodes

* reclaim root element ids as well
2025-07-02 00:34:21 -07:00
Jonathan Kelley 1db4b2a13d fix multiwindow due to mounts not dropping in virtualdom (#4351)
* fix handlers not dropping thanks to mounts

* use `desktop`

* Add tasks and effects

* only destroy on virtualdom destroy

* fix clippy
2025-07-01 20:49:45 -07:00
Jonathan Kelley ff762cec84 tweaks to the LastWindowClose to make it more imperative 2025-07-01 19:58:41 -07:00
KlemenandJonathan Kelley 9573af115a Added close behaviour option for specific window (#3754)
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-07-01 18:59:44 -07:00
zhiyanzhaijie c3c7e5f705 fix router macro mixed core crate by clearify core:: -> ::core:: (#4350) 2025-07-01 18:44:13 -07:00
d5daf14c15 chore(deps): upgrade wry from 0.45.0 to v0.52.0 (#4255)
* chore(deps): upgrade wry from 0.45.0 to v0.51.2

* Unwrap webview

* update tauri

* fix more versions

* switch to a single websocket per app to communicate edits in desktop

* use websockets on the ts side

* queue pending edits before the websocket connects

* fix decoding the websocket blobs in ts

* rebuild js

* fix clippy

* more sensible struct names

* allow http on android and require a key to match between the webview and native sides

* remove out.txt

* clippy

* small style changes

* More light cleanups

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2025-07-01 18:08:24 -07:00
Clouds 65dd1f1762 Save logical position when restoring on macos (#4061)
* save logical position on restore

* only use logical position on macos

* fix adjustment

* fix windows window restoration

* fix inner_size for windows
2025-06-30 23:03:38 -07:00
Moritz Hedtke e947f5ec08 Fix form submission on native if there is an onclick handler somewhere (#4329) 2025-06-30 22:46:42 -07:00
Evan AlmloffandJonathan Kelley e74c838441 Hashless assets (#4312)
* add support for external assets

* fix playwright tests

* add more documentation to with_hash_suffix

* restore external asset hashing tests

* Update gtk workflow dependencies

* fix doc test

* multiple versions of libgtk

* clear dx in playwright tests

* fix fullstack caching test

* try without apt cache

* cache everything except libxdo-dev

* revert ci changes

* fix wasm asset options

* fix merge conflict

* recommend the used attribute instead

* Move options to AssetOptionsBuilder

* Don't deprecate non-canonical new asset options functions

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-30 19:21:49 -07:00
Jonathan Kelley 0bd376b873 Fix: switch to --device instead of --device true 2025-06-30 19:18:48 -07:00
Jonathan Kelley 7d24a47c22 fix ios codesign on device (#4339)
* fix ios codesign on device

* switch to tmpfile
2025-06-30 19:14:17 -07:00
Moritz Hedtke ac9b1fc519 Intentionally shadow module to prevent accidential use (#4327) 2025-06-30 17:42:22 -07:00
Moritz Hedtke cd920d2b6b Pass android linker to cargo (#4332) 2025-06-30 17:41:19 -07:00
Moritz HedtkeandJonathan Kelley 60706a6c08 Handle panics in main on android (#4328)
* Handle panics in main on android

* Clippy fix

* Run in context of main

* small cleanups

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-30 17:38:15 -07:00
Jonathan Kelley 192fbffc51 change asset resolver docs and name 2025-06-30 16:31:25 -07:00
Nico Burns 6eba7e8641 Upgrade to Blitz 0.1.0-alpha.4 (#4335)
* Use new replace_node_with name for replace_placeholder_with_nodes

* Setup tracing for wgpu-texture support

* Use asset macro in wgpu-texture example

* Use src attribute rather than data for canvas source

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Upgrade to blitz 0.1.0-alpha.4

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-06-30 16:26:01 -07:00
Evan AlmloffandJonathan Kelley 2071be2b67 Fix hotpatched assets (#4326)
* wip: fixes to get docsite working again

* Fix asset location with PIC in hot patched builds

* Add an hidden cli flag to exit early in hot patch tests on failure

* add a test for hot patching with assets

* fix clippy

* fix looks_like_manganis_symbol

* longer timeout for hot patching in CI

* log page content

* log assets

* Log asset after write

* record a playwright trace

* Explicitly enable cargo incremental for hot patching

* fix retry for patch test

* reset asset

* disable hot patching test for new exports

* add nightly playwright

* use different toolchain names

* use beta instead of nightly for less thrashing

* add failing test

* workaround hot reloading bug

* restore swapping asset tests

* add toolchain

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-30 16:23:04 -07:00
6cc379718b Don't use inline scripts and function constructor (#4310)
* Don't use inline scripts and function constructor.

This allows a stricter Content-Security-Policy which is required for web extensions.

* Load module scripts asynchronously

* Extract common code into method

* Fix injecting loading script

* Append to the file instead of reading and appending to the file string

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2025-06-26 12:08:02 -05:00
Jonathan Kelley dcf46ce81a fix "multiple" attribute (#4323)
* fix "multiple" attribute

* change timeout in spin future
2025-06-25 13:13:08 -07:00
Nico Burns f54e771247 Fix docs.rs build of dioxus-lib (#4321) 2025-06-25 06:39:59 -07:00
Jonathan Kelley dd53ce72a7 add --offline, --locked, remove dioxus branding if dioxus is not being used explicitly (#4155)
* wip: add some spin logging

* wipe dioxus branding if not being used by dioxus

* add --locked, --offline, --frozen

* properly git init with `dx new` and `dx init`

* dont panic in verbosity

* Move build-assets to "tools"

* change ui for dx new offline

* pin tauri-bundle

* pin tauri

* run tailwind once
2025-06-24 18:21:25 -07:00
FontlosandJonathan Kelley bfb0642a1d fix(cli, breaking): Align Android applicationId with user's bundle.identifier (#4103)
* fix(cli, breaking): Align Android applicationId with user's `bundle.identifier`

This commit fixes the Android `applicationId` generation to accurately reflect the user-configured `bundle.identifier` when provided. It also refactors the logic by removing the `full_mobile_app_name` function, with `bundle_identifier` now being the direct source for the Android `applicationId`.

The `bundle_identifier` function now operates as follows:
1. If `bundle.identifier` is explicitly set by the user:
    - It validates that the identifier has at least three segments (e.g., `com.example.app`).
    - The user's `identifier` is then returned and used directly as the Android `applicationId`.
2. If `config.bundle.identifier` is not set by the user:
    - It defaults to `com.example.{PascalCaseExecutableName}`. The `executable_name` (e.g., "my-app" derived from a project name like "MyApp") is converted to `PascalCase` (e.g., "MyApp") for this default.

**BREAKING CHANGE**:

This change primarily affects Android builds and may alter the final `applicationId` for users who had a custom `bundle.identifier` set, particularly if its casing or final segment differed from the PascalCased `executable_name`.

- **Previous Behavior**:

    The Android `applicationId` was derived from `full_mobile_app_name`. This function effectively used the first two segments of the `bundle_identifier` (user-configured or default) but then **always** appended a PascalCased version of the `executable_name` as the final segment.

    Example Scenario:
    - User project name: "MyApp" (CLI set `executable_name` to "my-app")
    - User configured `bundle.identifier` in Dioxus config: `"com.custom.myapp"`
    - `bundled_app_name()` (from "my-app"): "MyApp"
    - Old `applicationId` (via `full_mobile_app_name`): `"com.custom.MyApp"`

- **New Behavior**:

    With the same user configuration (`"com.custom.myapp"`), the `applicationId` will now be: `"com.custom.myapp"`

This change ensures the `applicationId` respects the user's explicit `bundle.identifier` string. However, if users were unknowingly relying on the previous behavior where the last segment was always a PascalCased version of the `executable_name` (potentially mismatching their intended lowercase final segment in `bundle.identifier`), their `applicationId` will change upon updating the CLI.

According to Google's Android documentation, the `applicationId` must not be changed after an app is published, as this causes Google Play to treat it as a new application. Users who have published Android apps and utilized custom `bundle.identifier` configurations should meticulously verify their `applicationId` after this update to ensure it remains consistent with their published versions or to take appropriate action if a change is detected.

* fix: relax validation for bundle.identifier

1. Contains at least one dot ('.').
2. Does not start with a dot.
3. Does not end with a dot.
4. Does not contain consecutive dots ('..').

e.g., `com.example` or `com.example.app`

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-24 12:52:10 -07:00
Moritz HedtkeandJonathan Kelley 2be2333ef4 Add initial version of hash history (#4311)
* Add initial version of hash history

* wip...

* more cleanups

* cleanup the web history impl and then add a playwright test

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-24 11:50:03 -07:00