Commit Graph
4908 Commits
Author SHA1 Message Date
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
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 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
Marc EspinandJonathan Kelley db3ce07030 feat: Opt-out html in dioxus-router (#4217)
* feat: Opt-out `html` in `dioxus-router`

* typo: Enable html by default

* Fix cargo doc on html

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-18 16:40:07 -07:00
Dustin BensingandJonathan Kelley 7f44a09b38 Translate position to account for the display scaling factor. (#4275)
* Translate position to account for the display scaling factor.

* re-generate JS bindings

* dont change cargo lock

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-18 16:28:06 -07:00
Juan VásquezandJonathan Kelley 1d3168dc4a Allows desktop apps to open mailto links (#4282)
* Allows desktop apps to open mailto links

* Drop webbrowser, use `open` only

* switch to that_detached

* use workspace `open`

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-18 16:14:54 -07:00
Evan AlmloffandJonathan Kelley af6fc3a542 Switch to owned listener type (#4289)
* Switch to owned listener type

* remove html event workaround

* fix event conversion

* keep track of the origin scope

* fix clippy

* fix docs

* Use "ListenerCallback" instead of "ListenerCb"

* Add a small example

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-06-18 16:06:52 -07:00
Evan Almloff 3bf8f09c65 Fix --args and handle merging in @server and @client (#4212)
* Pass args after -- to the executable during run and serve

* fix clippy

* switch to accepting a string argument for subcommand compatibility

* Handle merging with `@server` and `@client`

* fix clippy

* fix formatting

* always build into the client package

* fix clippy

* more clippy fixes
2025-06-17 18:17:06 -07:00
Nico Burns 6fcb496fd5 Upgrade Blitz to 0.1.0-alpha.3 and add wgpu-texture example (#4286)
* Use Blitz 0.1.0-alpha.3

* Add wgpu-texture example

* Native: Support configuring wgpu Features and Limits
2025-06-17 18:06:32 -07:00
Florian Bartels 544d8cc4da Use full qualified path to Arc. (#4261)
It is currently only used when `debug_assertions` are enabled.
2025-06-09 19:08:28 +01:00
Evan Almloff 693f5c61b9 Always download wasm opt from the binary (#4247)
* always download wasm opt from the binary

* clean up and pass clippy

* fix playwright commands

* don't cache dx target folder
2025-06-04 08:43:58 -05:00
dependabot[bot] c2a6c14305 chore(deps): bump tar-fs from 2.1.2 to 2.1.3 in /packages/extension (#4243)
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.2 to 2.1.3.
- [Commits](https://github.com/mafintosh/tar-fs/commits)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-03 23:34:32 +02:00
Jonathan Kelley 39ed3b7122 pass thru ld-path 2025-06-03 16:51:36 +02:00
Jonathan Kelley dc8e98e8c4 remove unneeded dx_link env var 2025-06-03 16:44:20 +02:00
Jonathan Kelley 2ee54e507b white-list .rcgu.o files in the linking phase, otherwise dump them into the normal linking pile (#4246)
* white-list .rcgu.o files in the linking phase, otherwise dump them into the normal linking pile

* simplify a bit

* remove noisy trace

* remove wrong comment
2025-06-03 16:40:28 +02:00
Evan Almloff ae64d9534c Allow changing the base path from a cli arg (#4242)
* add a base-path argument to the CLI

* use the merged base path everywhere
2025-06-02 16:07:33 -05:00
Evan Almloff 9b16cbf254 Fix url encoding query and implement FromQueryArgument for Option<T> (#4213)
* Fix url encoding queries

* handle percent encoding hash fragments

* implement fromqueryargument for Option<T>

* fix tests

* fix typo
2025-06-02 13:14:53 -05:00
Evan AlmloffandJonathan Kelley 58669f892d Move asset hashing into the CLI (#3988)
* Fix deduping assets

* hash assets in the linker

* fix extracting assets

* Fix the hashed asset name

* deserialize the asset back from the link section

* prevent the read from being inlined

* remove some extra logs

* Fix liveview routing

* Only look for direct dependencies on dioxus features

* fix wasm split test

* On wasm, create a new object file with the asset information

* Fix multiple assets

* add a regression test for 3467

* fix image link

* fix linker out file

* fix linux linker args

* add windows linker command

* fix linux link args

* fix windows target triple

* Expose an option to build assets in the linker intercept

* Fix the standalone optimizer and document it in the dx help command

* include the cli opt version in the hash

* fix clippy

* fix ssg port

* add a safety note to the read_volatile call

* move found assets log

* fix some merge conflicts

* fix build

* make most env var for the linker optional

* guess the target triple when dx acts as the linker intercept

* automatically find the linker for normal builds

* use the right linker in wasm mode

* fix mac linker

* look inside archive files (rlibs)

* remove out.txt

* fix clippy

* fix typo

* fix clippy

* fix build

* fix dx link name in docs

* ignore libcompiler_builtins warnings

* fix playwright

* pass typocheck

* fix printing sysroot

* Modify final binary

* fix wasm assets

* remove old link section logic

* fix tests

* forward manganis export args

* fail to evaluate relocatable address

* retain all exports in the same pattern as other platforms

* Fix adding assets during a wasm hot patch

* less nesting and remove logs

* fix clippy

* log pdb files

* read from pdb

* print data section contents

* print with object

* normal windows builds working

* fix hot patch windows

* clean up logs

* fix clippy

* clean up assets

* use the most recent pdb

* fix doc test

* fix typo

* tiny nits

* make bundled a reference instead of a pointer

* add helpful comment to impl

* match on file format

* Fix asset hashing comment

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2025-05-31 21:45:12 +02:00
Leon Wimbes 39e783c19f update Playwright to 1.52.0 (#4125) 2025-05-31 14:12:04 +02:00
Craig 49e44f583e Remove schedule_update and schedule_update_any from prelude (#4128) 2025-05-31 14:06:13 +02:00
Nico Burns 51d7affc54 Upgrade to Blitz 0.1.0-alpha.2 (#4227)
* Update to use latest Blitz net traits

* Pass url to flush_style_attribute

* Add system-fonts feature to dioxus-native

* Native: cleanup log output

* Make dioxus-native work with Blitz simplified Document and Renderer traits

* Native: upgrade to event refactor

* Upgrade to blitz 0.1.0-alpha.2

* Add typo exception

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

* Ensure root_id is set to <main> element

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-05-31 13:52:19 +02:00
Jonathan Kelley e1bd06bda5 unset CARGO_MANIFEST_DIR, don't set it to empty string (#4225)
* tie rust backtrace to verbosity to tracing

* dont panic
2025-05-30 22:22:43 +02:00
liga 90adffd236 fix: escape backslashes in debug locations for HTMLData serialization (#4116) 2025-05-30 22:20:41 +02:00