mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Support changing ClassName in Reconciler.diff
This commit is contained in:
parent
5989ab3b85
commit
cc4f4df4f9
1 changed files with 4 additions and 3 deletions
|
|
@ -52,8 +52,9 @@ local function diff(instanceMap, virtualInstances, rootId)
|
|||
invariant("Cannot diff an instance not present in InstanceMap\nID: {}", id)
|
||||
end
|
||||
|
||||
local changedClassName = nil
|
||||
if virtualInstance.ClassName ~= instance.ClassName then
|
||||
error("unimplemented: support changing ClassName")
|
||||
changedClassName = virtualInstance.ClassName
|
||||
end
|
||||
|
||||
local changedName = nil
|
||||
|
|
@ -89,11 +90,11 @@ local function diff(instanceMap, virtualInstances, rootId)
|
|||
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, {
|
||||
id = id,
|
||||
changedName = changedName,
|
||||
changedClassName = nil,
|
||||
changedClassName = changedClassName,
|
||||
changedProperties = changedProperties,
|
||||
changedMetadata = nil,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue