This version contains a number of breaking changes to achieve dramatically improved performance by interning property and class names with ustr.
Because Ustr
implements conversions to and from Rust's string types, no action is required in many cases. However, for improved performance, we recommend passing instances of Ustr
to InstanceBuilder
's methods, rather than instances of String
or &str
. Refer to ustr's documentation for details.
- Changed the type of
Instance.class
fromString
toUstr
. - Changed the type of
Instance.properties
fromHashMap<String, Variant>
toUstrMap<Variant>
. - Changed the signature of
InstanceBuilder::new
from
pub fn new<S: Into<String>>(class: S) -> Self
to
pub fn new<S: Into<Ustr>>(class: S) -> Self
- Changed the signature of
InstanceBuilder::with_class
from
pub fn with_class<S: Into<String>>(self, class: S) -> Self
to
pub fn with_class<S: Into<Ustr>>(self, class: S) -> Self
- Changed the signature of
InstanceBuilder::set_class
from
pub fn set_class<S: Into<String>>(&mut self, class: S)
to
pub fn set_class<S: Into<Ustr>>(&mut self, class: S)
- Changed the signature of
InstanceBuilder::with_property
from
pub fn with_property<K: Into<String>, V: Into<Variant>>(mut self, key: K, value: V) -> Self
to
pub fn with_property<K: Into<Ustr>, V: Into<Variant>>(mut self, key: K, value: V) -> Self
- Changed the signature of
InstanceBuilder::add_property
from
pub fn add_property<K: Into<String>, V: Into<Variant>>(&mut self, key: K, value: V) -> Self
to
pub fn add_property<K: Into<Ustr>, V: Into<Variant>>(&mut self, key: K, value: V) -> Self
- Changed the signature of
InstanceBuilder::has_property
from
pub fn has_property<K: Into<String>>(&self, key: K) -> bool
to
pub fn has_property<K: Into<Ustr>>(&self, key: K) -> bool
- Changed the signature of
InstanceBuilder::with_properties
from
pub fn with_properties<K, V, I>(mut self, props: I) -> Self
where
K: Into<String>,
V: Into<Variant>,
I: IntoIterator<Item = (K, V)>,
to
pub fn with_properties<K, V, I>(mut self, props: I) -> Self
where
K: Into<Ustr>,
V: Into<Variant>,
I: IntoIterator<Item = (K, V)>,
- Changed the signature of
InstanceBuilder::add_properties
from
pub fn add_properties<K, V, I>(&mut self, props: I) -> Self
where
K: Into<String>,
V: Into<Variant>,
I: IntoIterator<Item = (K, V)>,
to
pub fn add_properties<K, V, I>(&mut self, props: I) -> Self
where
K: Into<Ustr>,
V: Into<Variant>,
I: IntoIterator<Item = (K, V)>,
- Started using ahash for hash maps, consequently changing the signature of
WeakDom::into_raw
from
pub fn into_raw(self) -> (Ref, HashMap<Ref, Instance, RandomState>) {
to
pub fn into_raw(self) -> (Ref, AHashMap<Ref, Instance>) {
- Added
HashMapExt
, a helper trait providing convenience methodsUstrMap::new
,UstrMap::with_capacity
,AHashMap::new
, andAHashMap::with_capacity
. - Added re-exports for
AHashMap
. - Added re-exports for
ustr
(a convenience function for creatingUstr
s),Ustr
,UstrMap
, andUstrSet
. - Added
InstanceBuilder::with_property_capacity
, which can preallocate anInstanceBuilder
's property table. (#464) - Added
WeakDom::reserve
, which can preallocate additional space for instances in theWeakDom
. (#465) - Added
WeakDom::from_raw
to provide the inverse forWeakDom::into_raw
. (#482)
- Added
WeakDom::descendants
andWeakDom::descendants_of
to support iterating through the descendants of a DOM. (#431)
- Added
InstanceBuilder::with_referent
that allows building instance with predefinedRef
(#400) - Added
WeakDom::get_unique_id
to get the UniqueId for a provided referent. (#405)
- Implemented
Default
forWeakDom
, useful when using Serde or creating an emptyWeakDom
(#379)
- Added
WeakDom::clone_multiple_into_external
that allows cloning multiple subtrees all at once into a givenWeakDom
, useful for preservingRef
properties that point across cloned subtrees (#364)
- Fix potential stack overflow when creating or inserting into a
WeakDom
. (#279) - Added
InstanceBuilder::has_property
for checking if anInstanceBuilder
defines a given property. (#283) - Added
WeakDom::clone_within
andWeakDom::clone_into_external
for cloning instances into the same or a differentWeakDom
, respectively. (#312)
- Added
WeakDom::into_raw
for enabling fast, non-tree-preserving transformations. - Added
empty
,with_class
, andset_class
methods toInstanceBuilder
.
- Updated to rbx_types 1.3.
- Updated to rbx_types 1.2.
- Updated to rbx_types 1.1.
- Updated to rbx_types 1.0.
This release is a major, breaking change that introduces many fixes and features.
RbxTree
was replaced withWeakDom
- Changed
new
to accept anInstanceBuilder
, which can contain children. - Renamed
get_root_id
toroot_ref
. - Renamed
get_instance
toget_by_ref
. - Renamed
get_instance_mut
toget_by_ref_mut
. - Renamed
move_instance
totransfer
. - Renamed
set_parent
totransfer_within
. - Renamed
insert_instance
toinsert
. This method now accepts anInstanceBuilder
. - Removed
remove_instance
, replaced bydestroy
andtransfer
. - Removed
iter_all_ids
. - Removed
descendants
. - Added
root
androot_mut
for accessing the root instance directly.
- Changed
RbxInstanceProperties
was replaced withInstanceBuilder
- This API is completely different, as it's now a builder. It is now much easier to construct instances.
RbxInstance
was replaced withInstance
- This type now directly exposes its values instead of implementing
Deref
for another type.
- This type now directly exposes its values instead of implementing
- Moved types into the
rbx_types
crate, re-exported asrbx_dom_weak::types
.RbxId
was replaced withtypes::Ref
, which can now represent null referents.
- Added
DomViewer
API from rbx_dom_test to make testing instance trees easier.
- Updated
base64
,md5
, anduuid
dependencies
- Added
RbxTree::set_parent
, for moving instances within a single tree.
- Changed
BrickColor
to be much more correct- All BrickColor values are now correctly available instead of just palette colors
- Enum values now align with the
BrickColor.Number
property andBrickColor.new
constructor BrickColor
no longer serializes to strings in human-readable Serde formats to avoid information loss. These colors have colliding names:- Rust
- Lilac
- Gold
- Deep orange
- Added conversion from
Int32
toBrickColor
. This should fix serialization ofSpawnLocation
instances, which useint
instead ofBrickColor
in at least the XML model format.
- Fixed Serde being able to deserialize
RbxValue
andRbxValueType
's internal__Nonexhaustive
value. This should also fix Serde recommending this value to users in error messages. - Fixed
BrickColor
serialization to use Roblox color names
- Added the
SharedString
type, which is used by Roblox to reduce redundant copies of binary buffers. (#63)
- Added conversions from
BrickColor
toColor3
andColor3uint8
. (#46) - Added conversions from
Color3
toColor3uint8
and vice-versa. - Changed the human readable serialization of
BinaryString
values to be base64-encoded. This makes JSON-encoded values much smaller. This changes the details of the unspecified serialization of rbx_dom_weak. RbxValueConversion
now derivesPartialEq
.
- Added
RbxTree::move_instance
API to move instances from one tree to another. - Fixed
RbxTree::descendants
to no longer return the instance of the ID you give it. This may break code relying on this (broken) assumption, but was definitely a bug. RbxValueConversion
now derivesDebug
andClone
(#52)
- Added support for
BrickColor
(#29) - Added
RbxValue::try_convert_ref
, which can be used to try to coerce values. (#42) Content
values can now be inferred from string literals.RbxValueType
now derives Serde'sSerialize
andDeserialize
traits
- Added support for new types:
- Added
sort_children_by_key
andsort_children_unstable_by_key
methods toRbxInstance
to reorder children safely
RbxTree
andRbxInstance
are now clonable without anunimplemented
panic- Cloned trees preserve their IDs as-is and there's no public API yet to transplant instances between trees. This is mostly useful for comparing trees before/after a mutation, which we're using in Rojo.
- Marked
PhysicalProperties
aspub
- Fixed
Serialize
impl forUnresolvedRbxValue
- This removes
Serialize
fromAmbiguousRbxValue
, which should not break any real code.
- This removes
RbxValue
andRbxValueType
can no longer be matched exhaustively, which enables adding new types without breaking code in the future- Added support for
UDim
,UDim2
, andContent
value types PhysicalProperties
is no longer a stub type
- Added support for bare bool values when deserializing
UnresolvedRbxValue
- Implemented
Serialize
forUnresolvedRbxValue
andAmbiguousRbxValue
- Implemented
From<RbxValue>
forUnresolvedRbxValue
- Renamed crate from
rbx_tree
torbx_dom_weak
- Added support for
Ref
values (#8) - Added
UnresolvedRbxValue
andAmbiguousRbxValue
, intended to be used alongsiderbx_reflection
to make specifying values less verbose.
- Added new variants for
RbxValue
:- Int32
- Float32
- Enum
- Vector2
- Color3
- Color3uint8
- Vector3int16
- Vector2int16
- CFrame
- PhysicalProperties (Stub)
- Initial release
- Supports
String
,Bool
, andVector3
property values