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>
This commit is contained in:
Nico Burns authored and GitHub committed 2025-07-22 13:08:36 -07:00
1 parent 18fe6de9a0
commit 6524f55462
12 files changed
+163 -88

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@ tracing = ["dep:tracing-subscriber", "dioxus-native-dom/tracing"]
[dependencies]
dioxus = { workspace = true, default-features = false, features = ["html", "hooks", "signals"] }
dioxus-native-dom = { path = "../../packages/native-dom" }
anyrender_vello = "0.4.1"
dioxus-native-dom = { workspace = true }
anyrender_vello = { workspace = true }
vello = "0.5"
rustc-hash = "1"
futures-util = { workspace = true }
+10 -5
View File
@@ -4,7 +4,7 @@
//! (this example is not really intended to be run as-is, and requires you to fill
//! in the missing pieces)
use anyrender_vello::{wgpu_context::WGPUContext, CustomPaintSource, VelloScenePainter};
use blitz_dom::Document as _;
use blitz_dom::{Document as _, DocumentConfig};
use blitz_paint::paint_scene;
use blitz_traits::{
events::{BlitzMouseButtonEvent, MouseEventButton, MouseEventButtons, UiEvent},
@@ -49,8 +49,13 @@ fn main() {
// Create the dioxus virtual dom and the dioxus-native document
// It is important to set the width, height, and scale factor on the document as these are used for layout.
let vdom = VirtualDom::new(app);
let mut dioxus_doc = DioxusDocument::new(vdom, None);
dioxus_doc.set_viewport(Viewport::new(WIDTH, HEIGHT, SCALE_FACTOR, COLOR_SCHEME));
let mut dioxus_doc = DioxusDocument::new(
vdom,
DocumentConfig {
viewport: Some(Viewport::new(WIDTH, HEIGHT, SCALE_FACTOR, COLOR_SCHEME)),
..Default::default()
},
);
// Setup a WGPU Device and Queue
//
@@ -95,7 +100,7 @@ fn main() {
// =============
// Poll the vdom
dioxus_doc.poll(Context::from_waker(&waker));
dioxus_doc.poll(Some(Context::from_waker(&waker)));
// Create a `VelloScenePainter` to paint into
let mut custom_paint_sources =
@@ -151,7 +156,7 @@ fn main() {
buttons: MouseEventButtons::Primary, // keep track of all pressed buttons
mods: Modifiers::empty(), // ctrl, alt, shift, etc
});
dioxus_doc.handle_event(event);
dioxus_doc.handle_ui_event(event);
// Trigger a poll via your event loop (or wait for next frame)
}