mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-22 21:55:15 +00:00
Support setting referent properties via attributes (#843)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
id-10:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-10
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: ProjectPointer
|
||||
Parent: id-9
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: project target
|
||||
Value:
|
||||
Ref: id-9
|
||||
id-11:
|
||||
Children: []
|
||||
ClassName: Model
|
||||
Id: id-11
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ProjectPointer
|
||||
Parent: id-7
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_PrimaryPart:
|
||||
String: project target
|
||||
PrimaryPart:
|
||||
Ref: id-9
|
||||
id-2:
|
||||
Children:
|
||||
- id-3
|
||||
ClassName: DataModel
|
||||
Id: id-2
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: ref_properties
|
||||
Parent: "00000000000000000000000000000000"
|
||||
Properties: {}
|
||||
id-3:
|
||||
Children:
|
||||
- id-4
|
||||
- id-5
|
||||
- id-7
|
||||
- id-9
|
||||
ClassName: Workspace
|
||||
Id: id-3
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: Workspace
|
||||
Parent: id-2
|
||||
Properties: {}
|
||||
id-4:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-4
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: CrossFormatPointer
|
||||
Parent: id-3
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: folder target
|
||||
Value:
|
||||
Ref: id-5
|
||||
id-5:
|
||||
Children:
|
||||
- id-6
|
||||
ClassName: Folder
|
||||
Id: id-5
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: FolderTarget
|
||||
Parent: id-3
|
||||
Properties: {}
|
||||
id-6:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-6
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: FolderPointer
|
||||
Parent: id-5
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: folder target
|
||||
Value:
|
||||
Ref: id-5
|
||||
id-7:
|
||||
Children:
|
||||
- id-8
|
||||
- id-11
|
||||
ClassName: Folder
|
||||
Id: id-7
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ModelTarget
|
||||
Parent: id-3
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Id:
|
||||
String: model target 2
|
||||
id-8:
|
||||
Children: []
|
||||
ClassName: Model
|
||||
Id: id-8
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ModelPointer
|
||||
Parent: id-7
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_PrimaryPart:
|
||||
String: model target 2
|
||||
PrimaryPart:
|
||||
Ref: id-7
|
||||
id-9:
|
||||
Children:
|
||||
- id-10
|
||||
ClassName: Folder
|
||||
Id: id-9
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: ProjectTarget
|
||||
Parent: id-3
|
||||
Properties: {}
|
||||
messageCursor: 1
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
id-10:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-10
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: ProjectPointer
|
||||
Parent: id-9
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: project target
|
||||
Value:
|
||||
Ref: id-9
|
||||
id-2:
|
||||
Children:
|
||||
- id-3
|
||||
ClassName: DataModel
|
||||
Id: id-2
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: ref_properties
|
||||
Parent: "00000000000000000000000000000000"
|
||||
Properties: {}
|
||||
id-3:
|
||||
Children:
|
||||
- id-4
|
||||
- id-5
|
||||
- id-7
|
||||
- id-9
|
||||
ClassName: Workspace
|
||||
Id: id-3
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: Workspace
|
||||
Parent: id-2
|
||||
Properties: {}
|
||||
id-4:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-4
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: CrossFormatPointer
|
||||
Parent: id-3
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: folder target
|
||||
Value:
|
||||
Ref: id-5
|
||||
id-5:
|
||||
Children:
|
||||
- id-6
|
||||
ClassName: Folder
|
||||
Id: id-5
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: FolderTarget
|
||||
Parent: id-3
|
||||
Properties: {}
|
||||
id-6:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-6
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: FolderPointer
|
||||
Parent: id-5
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: folder target
|
||||
Value:
|
||||
Ref: id-5
|
||||
id-7:
|
||||
Children:
|
||||
- id-8
|
||||
ClassName: Folder
|
||||
Id: id-7
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ModelTarget
|
||||
Parent: id-3
|
||||
Properties: {}
|
||||
id-8:
|
||||
Children: []
|
||||
ClassName: Model
|
||||
Id: id-8
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ModelPointer
|
||||
Parent: id-7
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_PrimaryPart:
|
||||
String: model target
|
||||
PrimaryPart:
|
||||
Ref: id-7
|
||||
id-9:
|
||||
Children:
|
||||
- id-10
|
||||
ClassName: Folder
|
||||
Id: id-9
|
||||
Metadata:
|
||||
ignoreUnknownInstances: true
|
||||
Name: ProjectTarget
|
||||
Parent: id-3
|
||||
Properties: {}
|
||||
messageCursor: 0
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
gameId: ~
|
||||
placeId: ~
|
||||
projectName: ref_properties
|
||||
protocolVersion: 4
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
id-2:
|
||||
Children:
|
||||
- id-3
|
||||
ClassName: Folder
|
||||
Id: id-2
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ref_properties_remove
|
||||
Parent: "00000000000000000000000000000000"
|
||||
Properties: {}
|
||||
id-3:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-3
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: pointer
|
||||
Parent: id-2
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: test pointer
|
||||
Value:
|
||||
Ref: id-4
|
||||
messageCursor: 1
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
id-2:
|
||||
Children:
|
||||
- id-3
|
||||
- id-4
|
||||
ClassName: Folder
|
||||
Id: id-2
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ref_properties_remove
|
||||
Parent: "00000000000000000000000000000000"
|
||||
Properties: {}
|
||||
id-3:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-3
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: pointer
|
||||
Parent: id-2
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_Value:
|
||||
String: test pointer
|
||||
Value:
|
||||
Ref: id-4
|
||||
id-4:
|
||||
Children: []
|
||||
ClassName: ObjectValue
|
||||
Id: id-4
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: target
|
||||
Parent: id-2
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Id:
|
||||
String: test pointer
|
||||
messageCursor: 0
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
gameId: ~
|
||||
placeId: ~
|
||||
projectName: ref_properties_remove
|
||||
protocolVersion: 4
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
messages:
|
||||
- added: {}
|
||||
removed:
|
||||
- id-4
|
||||
updated: []
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
messages:
|
||||
- added:
|
||||
id-11:
|
||||
Children: []
|
||||
ClassName: Model
|
||||
Id: id-11
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: ProjectPointer
|
||||
Parent: id-7
|
||||
Properties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_PrimaryPart:
|
||||
String: project target
|
||||
PrimaryPart:
|
||||
Ref: id-9
|
||||
removed: []
|
||||
updated:
|
||||
- changedClassName: ~
|
||||
changedMetadata:
|
||||
ignoreUnknownInstances: false
|
||||
changedName: ~
|
||||
changedProperties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Id:
|
||||
String: model target 2
|
||||
id: id-7
|
||||
- changedClassName: ~
|
||||
changedMetadata: ~
|
||||
changedName: ~
|
||||
changedProperties:
|
||||
Attributes:
|
||||
Attributes:
|
||||
Rojo_Target_PrimaryPart:
|
||||
String: model target 2
|
||||
PrimaryPart: ~
|
||||
id: id-8
|
||||
sessionId: id-1
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"className": "ObjectValue",
|
||||
"attributes": {
|
||||
"Rojo_Target_Value": "folder target"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"id": "folder target"
|
||||
}
|
||||
13
rojo-test/serve-tests/ref_properties/ModelTarget.model.json
Normal file
13
rojo-test/serve-tests/ref_properties/ModelTarget.model.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"id": "model target",
|
||||
"className": "Folder",
|
||||
"children": [
|
||||
{
|
||||
"name": "ModelPointer",
|
||||
"className": "Model",
|
||||
"attributes": {
|
||||
"Rojo_Target_PrimaryPart": "model target"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
32
rojo-test/serve-tests/ref_properties/default.project.json
Normal file
32
rojo-test/serve-tests/ref_properties/default.project.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "ref_properties",
|
||||
"tree": {
|
||||
"$className": "DataModel",
|
||||
"Workspace": {
|
||||
"ProjectTarget": {
|
||||
"$className": "Folder",
|
||||
"$id": "project target",
|
||||
"ProjectPointer": {
|
||||
"$className": "ObjectValue",
|
||||
"$attributes": {
|
||||
"Rojo_Target_Value": {
|
||||
"String": "project target"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ModelTarget": {
|
||||
"$path": "ModelTarget.model.json"
|
||||
},
|
||||
"FolderTarget": {
|
||||
"$path": "FolderTarget"
|
||||
},
|
||||
"CrossFormatPointer": {
|
||||
"$className": "ObjectValue",
|
||||
"$attributes": {
|
||||
"Rojo_Target_Value": "folder target"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "ref_properties_remove",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"className": "ObjectValue",
|
||||
"attributes": {
|
||||
"Rojo_Target_Value": "test pointer"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"className": "ObjectValue",
|
||||
"attributes": {
|
||||
"Rojo_Id": "test pointer"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user