mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 14:15:24 +00:00
Support changing ClassName in Reconciler.diff
This commit is contained in:
@@ -52,8 +52,9 @@ local function diff(instanceMap, virtualInstances, rootId)
|
|||||||
invariant("Cannot diff an instance not present in InstanceMap\nID: {}", id)
|
invariant("Cannot diff an instance not present in InstanceMap\nID: {}", id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local changedClassName = nil
|
||||||
if virtualInstance.ClassName ~= instance.ClassName then
|
if virtualInstance.ClassName ~= instance.ClassName then
|
||||||
error("unimplemented: support changing ClassName")
|
changedClassName = virtualInstance.ClassName
|
||||||
end
|
end
|
||||||
|
|
||||||
local changedName = nil
|
local changedName = nil
|
||||||
@@ -89,11 +90,11 @@ local function diff(instanceMap, virtualInstances, rootId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if changedName ~= nil or not isEmpty(changedProperties) then
|
if changedName ~= nil or changedClassName ~= nil or not isEmpty(changedProperties) then
|
||||||
table.insert(patch.updated, {
|
table.insert(patch.updated, {
|
||||||
id = id,
|
id = id,
|
||||||
changedName = changedName,
|
changedName = changedName,
|
||||||
changedClassName = nil,
|
changedClassName = changedClassName,
|
||||||
changedProperties = changedProperties,
|
changedProperties = changedProperties,
|
||||||
changedMetadata = nil,
|
changedMetadata = nil,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user