Skip to content

Migrate dioxus-native and dioxus-native-dom to latest Dioxus main - #758

Open
nicoburns wants to merge 2 commits into
mainfrom
devin/1787230751-dioxus-main-migration
Open

Migrate dioxus-native and dioxus-native-dom to latest Dioxus main#758
nicoburns wants to merge 2 commits into
mainfrom
devin/1787230751-dioxus-main-migration

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

Points all dioxus-* workspace dependencies at Dioxus main (rev = "24f6a829d", version 0.8.0-alpha.1) and migrates the Blitz copies of dioxus-native / dioxus-native-dom to the new APIs.

mutation_writer.rs — ported to the new stack-machine WriteMutations protocol (the old template/ID-based API — TemplateNode, assign_node_id, create_placeholder, per-mutation ElementId args — no longer exists). The port mirrors upstream's packages/native-dom implementation:

trait RealDom { type NodeId; fn create_element(..) -> NodeId; fn nth_child(..); ... }
struct StackState<N> { stack: Vec<StackEntry<N>>, element_to_node: Vec<Option<N>> }
impl<R: RealDom> WriteMutations for StackWriter<'_, R> { push_id / set_id / child / pop / ... }

but keeps Blitz-specific behavior that upstream's copy has dropped or simplified:

  • WriteOnceAttr<Box<dyn Document>> (any Document impl, e.g. ScriptDocument) for __webview_document subdocuments, vs upstream's Box<PlainDocument>
  • NodeId from blitz-dom rather than usize
  • event-handler counting by DomEventKind::discriminant(), mounted event queueing, data-dioxus-id, checked-falsy clearing, style-namespace and dangerous_inner_html handling

Blitz's dioxus_document.rs (subdocument polling, chain: &[NodeId]) and events.rs (scroll support) are retained; only the API deltas were applied: DioxusState::writer() instead of MutationWriter::new, ElementId::from_raw (fields are now private), and a new required convert_before_input_data method (unimplemented, like the other unsupported events).

Fallout from other Dioxus main changes:

  • rsx! now expands elements as html::div etc., so dioxus_native::prelude re-exports dioxus_html::{self, html} and elements::prelude::* (mirroring the new dioxus::prelude); dioxus_elements alias removed
  • dioxus-stores now enforces method visibility in #[store(pub)] blocks, so the browser app's store extension methods are marked pub
  • examples/transforms.rs: dioxus_elements:: paths → dioxus_html::
  • stale_node_mapping.rs test: ElementId(raw)ElementId::from_raw(raw)

Verified with cargo check --workspace --all-targets, cargo clippy --workspace -- -D warnings, cargo fmt, and cargo test --workspace (all passing).

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/344ad63f48e74aa6b30c4a2d0a1556e1
Requested by: @nicoburns

WPT results

No changes in test results compared to main.

Generated by the WPT workflow.

- Pin all dioxus workspace dependencies to dioxus main rev 24f6a829d (0.8.0-alpha.1)
- Port mutation_writer to the new stack-machine WriteMutations API,
  keeping Blitz-specific behavior (event handler counts, mounted event
  queueing, data-dioxus-id, subdocument/custom-widget attachment)
- Use DioxusState::writer() and ElementId::from_raw in dioxus_document
- Add convert_before_input_data to the HtmlEventConverter impl
- Update dioxus-native prelude for the new html element vocabulary
  (dioxus_html::html + elements::prelude::*)
- Mark #[store(pub)] extension methods pub per new visibility rules
- Replace removed dioxus_elements paths in examples
@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant