diff --git a/plugin/src/Reconciler/reify.lua b/plugin/src/Reconciler/reify.lua index b0c8aa0be..3c3965734 100644 --- a/plugin/src/Reconciler/reify.lua +++ b/plugin/src/Reconciler/reify.lua @@ -70,7 +70,7 @@ function reifyInner(instanceMap, virtualInstances, id, parentInstance, unapplied for propertyName, virtualValue in pairs(virtualInstance.Properties) do -- Because refs may refer to instances that we haven't constructed yet, -- we defer applying any ref properties until all instances are created. - if virtualValue.Type == "Ref" then + if next(virtualValue) == "Ref" then table.insert(deferredRefs, { id = id, instance = instance, @@ -136,23 +136,23 @@ function applyDeferredRefs(instanceMap, deferredRefs, unappliedPatch) end for _, entry in ipairs(deferredRefs) do - local virtualValue = entry.virtualValue + local _, refId = next(entry.virtualValue) - if virtualValue.Value == nil then + if refId == nil then continue end - local targetInstance = instanceMap.fromIds[virtualValue.Value] + local targetInstance = instanceMap.fromIds[refId] if targetInstance == nil then - markFailed(entry.id, entry.propertyName, virtualValue) + markFailed(entry.id, entry.propertyName, entry.virtualValue) continue end local ok = setProperty(entry.instance, entry.propertyName, targetInstance) if not ok then - markFailed(entry.id, entry.propertyName, virtualValue) + markFailed(entry.id, entry.propertyName, entry.virtualValue) end end end -return reify \ No newline at end of file +return reify diff --git a/plugin/src/Types.lua b/plugin/src/Types.lua index dac5f06c4..ebd8efe1a 100644 --- a/plugin/src/Types.lua +++ b/plugin/src/Types.lua @@ -5,10 +5,7 @@ local strict = require(script.Parent.strict) local RbxId = t.string -local ApiValue = t.interface({ - Type = t.string, - Value = t.optional(t.any), -}) +local ApiValue = t.keys(t.string) local ApiInstanceMetadata = t.interface({ ignoreUnknownInstances = t.optional(t.boolean), @@ -96,4 +93,4 @@ return strict("Types", { VirtualInstance = ApiInstance, VirtualMetadata = ApiInstanceMetadata, VirtualValue = ApiValue, -}) \ No newline at end of file +})