Update rbx-dom (#1023)

This commit is contained in:
Micah
2025-04-02 11:32:27 -07:00
committed by GitHub
parent 0d6ff8ef8a
commit 833320de64
30 changed files with 8815 additions and 2249 deletions

View File

@@ -1,9 +1,10 @@
//! Utiilty that helps redact nondeterministic information from trees so that
//! they can be part of snapshot tests.
use std::collections::HashMap;
use rbx_dom_weak::types::{Ref, Variant};
use rbx_dom_weak::{
types::{Ref, Variant},
Ustr, UstrMap,
};
use rojo_insta_ext::RedactionMap;
use serde::Serialize;
@@ -34,8 +35,8 @@ pub fn intern_tree(tree: &RojoTree, redactions: &mut RedactionMap) {
struct InstanceView {
id: Ref,
name: String,
class_name: String,
properties: HashMap<String, Variant>,
class_name: Ustr,
properties: UstrMap<Variant>,
metadata: InstanceMetadata,
children: Vec<InstanceView>,
}
@@ -46,7 +47,7 @@ fn extract_instance_view(tree: &RojoTree, id: Ref) -> InstanceView {
InstanceView {
id: instance.id(),
name: instance.name().to_owned(),
class_name: instance.class_name().to_owned(),
class_name: instance.class_name(),
properties: instance.properties().clone(),
metadata: instance.metadata().clone(),
children: instance