Update to stable rbx-dom libraries

This commit is contained in:
Lucien Greathouse
2021-06-29 01:20:09 -04:00
parent a3d8e50f26
commit 672d207961
36 changed files with 129 additions and 122 deletions

View File

@@ -112,13 +112,13 @@ fn write_model(
match output_kind {
OutputKind::Rbxm => {
rbx_binary::to_writer_default(&mut file, tree.inner(), &[root_id])?;
rbx_binary::to_writer(&mut file, tree.inner(), &[root_id])?;
}
OutputKind::Rbxl => {
let root_instance = tree.get_instance(root_id).unwrap();
let top_level_ids = root_instance.children();
rbx_binary::to_writer_default(&mut file, tree.inner(), top_level_ids)?;
rbx_binary::to_writer(&mut file, tree.inner(), top_level_ids)?;
}
OutputKind::Rbxmx => {
// Model files include the root instance of the tree and all its

View File

@@ -73,7 +73,7 @@ fn install_plugin() -> anyhow::Result<()> {
let tree = session.tree();
let root_id = tree.get_root_id();
rbx_binary::to_writer_default(&mut file, tree.inner(), &[root_id])?;
rbx_binary::to_writer(&mut file, tree.inner(), &[root_id])?;
Ok(())
}

View File

@@ -53,7 +53,7 @@ impl UploadCommand {
let mut buffer = Vec::new();
log::trace!("Encoding binary model");
rbx_binary::to_writer_default(&mut buffer, tree.inner(), &encode_ids)?;
rbx_binary::to_writer(&mut buffer, tree.inner(), &encode_ids)?;
do_upload(buffer, self.asset_id, &cookie)
}
}

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot/tests/apply.rs
expression: applied_patch_value
---
removed: []
added: []
@@ -10,6 +11,6 @@ updated:
changed_class_name: ~
changed_properties:
Foo:
Type: String
Value: Value of Foo
String: Value of Foo
changed_metadata: ~

View File

@@ -1,16 +1,17 @@
---
source: src/snapshot/tests/apply.rs
expression: tree_view
---
id: id-1
name: ROOT
class_name: ROOT
properties:
Foo:
Type: String
Value: Value of Foo
String: Value of Foo
metadata:
ignore_unknown_instances: false
relevant_paths: []
context: {}
children: []

View File

@@ -1,16 +1,17 @@
---
source: src/snapshot/tests/apply.rs
expression: tree_view
---
id: id-1
name: ROOT
class_name: ROOT
properties:
Foo:
Type: String
Value: Should be removed
String: Should be removed
metadata:
ignore_unknown_instances: false
relevant_paths: []
context: {}
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot/tests/compute.rs
expression: patch_value
---
removed_instances: []
added_instances: []
@@ -10,6 +11,6 @@ updated_instances:
changed_class_name: ~
changed_properties:
PropertyName:
Type: String
Value: "Hello, world!"
String: "Hello, world!"
changed_metadata: ~

View File

@@ -360,8 +360,7 @@ mod test {
"$className": "StringValue",
"$properties": {
"Value": {
"Type": "String",
"Value": "Hello, world!"
"String": "Hello, world!"
}
}
}

View File

@@ -13,7 +13,7 @@ pub fn snapshot_rbxm(
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
let temp_tree = rbx_binary::from_reader_default(vfs.read(path)?.as_slice())
let temp_tree = rbx_binary::from_reader(vfs.read(path)?.as_slice())
.with_context(|| format!("Malformed rbxm file: {}", path.display()))?;
let root_instance = temp_tree.root();

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/csv.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: LocalizationTable
properties:
Contents:
Type: String
Value: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
String: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/csv.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: LocalizationTable
properties:
Contents:
Type: String
Value: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
String: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/json.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: ModuleScript
properties:
Source:
Type: String
Value: "return {\n\t[\"1invalidident\"] = \"nice\",\n\tarray = {1, 2, 3},\n\t[\"false\"] = false,\n\tfloat = 1234.5452,\n\tint = 1234,\n\tnull = nil,\n\tobject = {\n\t\thello = \"world\",\n\t},\n\t[\"true\"] = true,\n}"
String: "return {\n\t[\"1invalidident\"] = \"nice\",\n\tarray = {1, 2, 3},\n\t[\"false\"] = false,\n\tfloat = 1234.5452,\n\tint = 1234,\n\tnull = nil,\n\tobject = {\n\t\thello = \"world\",\n\t},\n\t[\"true\"] = true,\n}"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/json_model.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -14,8 +15,7 @@ name: foo
class_name: IntValue
properties:
Value:
Type: Int64
Value: 5
Int64: 5
children:
- snapshot_id: ~
metadata:
@@ -26,3 +26,4 @@ children:
class_name: StringValue
properties: {}
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: LocalScript
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: ModuleScript
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: ModuleScript
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,9 +16,8 @@ name: bar
class_name: Script
properties:
Disabled:
Type: Bool
Value: true
Bool: true
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: Script
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: Script
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: path-property-override
class_name: StringValue
properties:
Value:
Type: String
Value: Changed
String: Changed
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -16,6 +17,6 @@ name: path-project
class_name: StringValue
properties:
Value:
Type: String
Value: "Hello, world!"
String: "Hello, world!"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -14,6 +15,6 @@ name: resolved-properties
class_name: StringValue
properties:
Value:
Type: String
Value: "Hello, world!"
String: "Hello, world!"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -14,6 +15,6 @@ name: unresolved-properties
class_name: StringValue
properties:
Value:
Type: String
Value: Hi!
String: Hi!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/txt.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: StringValue
properties:
Value:
Type: String
Value: Hello there!
String: Hello there!
children: []