Commit Graph
6708 Commits
Author SHA1 Message Date
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
Mahmoud 🦀andJonathan Kelley e23debf096 chore: update readme (#4075)
* chore: update readme

* chore: mv `sledgehammer` `sledgehammer_bindgen`

* tweak language

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-30 22:09:12 -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 0dd0f05db0 small typo 2025-06-25 13:30:08 -07:00
Jonathan Kelley b94ce1cd1c update header splash 2025-06-25 13:26:53 -07:00
Jonathan Kelley bc593ba4ef update readme with some new features for 0.7 2025-06-25 13:26:53 -07: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
Mahmoud 🦀 2d0ca77ff9 Create SECURITY.md (#4136) 2025-06-24 18:37:43 -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
LEandJonathan Kelley a899f9f08e Remove broken links in examples/README.md (#4318)
* fix(examples): remove broken links from `examples/README.md`

* Document the new examples

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-24 17:28:48 -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
Jonathan Kelley fd1b04eba1 use dx run for playwright tests, properly abort if error occurs, don't ddos github releases, split apt-cache by os/target in matrix (#4315)
* properly emit errors

* fix error propagate

* install glib

* fix playwright for dx run ssg

* add execute install scripts (for arm linux)

* use verbose playwright

* wip: unwrap playwright download error

* use alternative wasm-opt install

* log wasm-opt download

* use hardcoded endpoint for wasm-opt download

* disambiguate cache

* clean up impl
2025-06-23 21:30:41 -07:00
HéctorandJonathan Kelley e477e0b485 Avoid fingerprint busting during builds (#4244)
* Avoid fingerprint busting during builds

* delete `.fingerprint/package-hash` instead of modifying source code

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-23 20:05:56 -07:00
Moritz HedtkeandJonathan Kelley f40f7a5aeb Add better error handling for wasm-opt and prevent file truncation on error (#4313)
* Add better error handling for wasm-opt and prevent file truncation on error

* clippy

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-23 17:20:25 -07:00
Jonathan Kelley d262aba8bb properly wipe the dx cache in ci 2025-06-23 14:41:30 -07:00
Jonathan Kelley 8df53df887 Fix cargo test --workspace, associated feature flags, and a number of doctests 2025-06-23 14:33:25 -07:00
Evan Almloff fdd77d79c1 Restore SSG serve logic (#4111)
* Build ssg routes when both the client and server builds are finished

* Fix default server fn encoding

* fix tokio console

* fix ssg

* add prerendering message

* render under the same environment variables as normal

* fix check

* use should_bundle_to_asset

* enable ssg playwright test

* fix clippy
2025-06-23 13:35:46 -07:00
Evan Almloff f610c6b8c1 Implement Into<CaptureError> for the default server function error type (#4205)
* implement Into<CaptureError> for the server function error type

* document the server function error type

* fix tests
2025-06-20 18:37:51 -07:00
Jan 67f717647f Allow a borrowed key to move into children (#4277) 2025-06-20 18:34:24 -07:00
Jonathan Kelley f2fdd60eb9 fix "data" attribute on meta test 2025-06-20 18:30:29 -07:00
Nathaniel BajoandJonathan Kelley 2abe9eda2b Fix/server macro defaults (#3403)
* Clarify and improve #[server] macro docs

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-20 11:42:18 -07:00
navyansh007andJonathan Kelley 097bc1d1c8 Remove invalid global data attribute (#4270)
* Remove invalid global data attribute

Removes the non-existent global 'data' attribute from HTML global
attributes that was referencing broken MDN documentation. HTML
specification only supports data-* custom attributes and the
<data> element, not a global 'data' attribute.

Fixes #4241

* fix other attributes using datas

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-20 11:24:41 -07:00
Evan Almloff 76ffcabd0b Cache hashed assets forever in fullstack (#3928)
* Cache hashed assets forever in fullstack

* fix clippy

* fix fullstack test port

* fix fullstack clippy

* fix double insertion of meta in fullstack test

* pull out head element changes

* Fix cli-optimization test when interrupted

* remove tests for raw assets

* fix playwright tests

* look for hash in asset name instead of building a manifest

* undo changes to cli

* fix clippy

* fix test_file_name_looks_immutable
2025-06-19 22:18:55 -07:00
Jonathan Kelley 09d8e3aef2 tell user about basepath (#4298) 2025-06-19 21:32:15 -07:00
Evan Almloff 10a63d07e2 Fix base path (#4276)
* fix base path

* remove log

* fix clippy
2025-06-19 21:24:26 -07:00
Juan Vásquez e086d6765b Fixes issue with the file dialog showing only folders and not files (#4177)
* Fixes issue with the file dialog showing only folders and not files when the <input> element has no "accept" attribute.

* Handle spaces between file extensions in the accept attribute of file type input elements
2025-06-19 21:16:31 -07:00
Jonathan Kelley ec80e6bd37 switch to ignore::walk for fmt/check 2025-06-19 21:07:07 -07:00
Jonathan Kelley 245ca9bce2 Fix: add layer to font import 2025-06-19 20:34:57 -07:00
Jonathan Kelley 8d5a3a09da properly respect rustflags, fix x86-sim issue (#4295)
* properly respect rustflags

* typo

* drop `-sim`
2025-06-19 14:42:33 -07:00
Evan Almloff e6ca0baa46 Make new_window asynchronous (#4297)
* Make new_window asynchronous

* fix clippy
2025-06-19 14:32:00 -07:00
Jonathan Kelley 99a6b23df8 add missing parantheses to doc comment 2025-06-18 19:05:44 -07:00
Evan AlmloffandJonathan Kelley 7d2a3aa751 Use different release profiles for desktop and server builds, adhoc profiles (#3693)
* Use different release profiles for desktop and server builds

* fix clippy

* change the global cargo config instead of the local one

* fix merge

* fix release profile logic

* use adhoc profile generation

* fix compilation of dioxus-lib in fullstack

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-18 17:58:39 -07:00
Evan Almloff 315854b449 fix can go back hydration (#4209) 2025-06-18 16:48:59 -07:00