mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
Update plugin references from Rojo to Atlas
- Changed all instances of "Rojo" to "Atlas" in error messages, UI titles, and connection actions for consistent branding. - Updated the sound player widget and patch history recording to reflect the new name. - Enhanced logging in the hydration process to provide better diagnostics for missing virtual instances.
This commit is contained in:
parent
9ab1369444
commit
edc09741bf
9 changed files with 71 additions and 27 deletions
|
|
@ -3,6 +3,9 @@
|
|||
concrete instances and assigning them IDs.
|
||||
]]
|
||||
|
||||
local Packages = script.Parent.Parent.Parent.Packages
|
||||
local Log = require(Packages.Log)
|
||||
|
||||
local invariant = require(script.Parent.Parent.invariant)
|
||||
|
||||
local function hydrate(instanceMap, virtualInstances, rootId, rootInstance)
|
||||
|
|
@ -26,6 +29,17 @@ local function hydrate(instanceMap, virtualInstances, rootId, rootInstance)
|
|||
for _, childId in ipairs(virtualInstance.Children) do
|
||||
local virtualChild = virtualInstances[childId]
|
||||
|
||||
if virtualChild == nil then
|
||||
Log.warn(
|
||||
"Hydration: virtualInstances missing child ID {} (parent: {} '{}')",
|
||||
childId,
|
||||
rootId,
|
||||
virtualInstance.Name
|
||||
)
|
||||
continue
|
||||
end
|
||||
|
||||
local matched = false
|
||||
for childIndex, childInstance in existingChildren do
|
||||
if not isExistingChildVisited[childIndex] then
|
||||
-- We guard accessing Name and ClassName in order to avoid
|
||||
|
|
@ -40,10 +54,33 @@ local function hydrate(instanceMap, virtualInstances, rootId, rootInstance)
|
|||
if accessSuccess and name == virtualChild.Name and className == virtualChild.ClassName then
|
||||
isExistingChildVisited[childIndex] = true
|
||||
hydrate(instanceMap, virtualInstances, childId, childInstance)
|
||||
matched = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not matched then
|
||||
-- Log why the match failed to help diagnose hydration issues
|
||||
Log.debug(
|
||||
"Hydration: No match for virtual child '{}' ({}) under '{}' ({})",
|
||||
virtualChild.Name,
|
||||
virtualChild.ClassName,
|
||||
virtualInstance.Name,
|
||||
rootInstance:GetFullName()
|
||||
)
|
||||
-- List real children for comparison
|
||||
local realChildNames = {}
|
||||
for _, child in existingChildren do
|
||||
local success, childName, childClass = pcall(function()
|
||||
return child.Name, child.ClassName
|
||||
end)
|
||||
if success then
|
||||
table.insert(realChildNames, string.format("%s (%s)", childName, childClass))
|
||||
end
|
||||
end
|
||||
Log.trace(" Real children: {}", table.concat(realChildNames, ", "))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
"Reifies" a virtual DOM, constructing a real DOM with the same shape.
|
||||
]]
|
||||
|
||||
local invariant = require(script.Parent.Parent.invariant)
|
||||
local PatchSet = require(script.Parent.Parent.PatchSet)
|
||||
local setProperty = require(script.Parent.setProperty)
|
||||
local decodeValue = require(script.Parent.decodeValue)
|
||||
|
|
@ -31,6 +32,12 @@ function reifyInstance(deferredRefs, instanceMap, virtualInstances, rootId, pare
|
|||
-- properties that could not be assigned.
|
||||
local unappliedPatch = PatchSet.newEmpty()
|
||||
|
||||
-- The root ID must exist - if not, it's a programming error
|
||||
local rootInstance = virtualInstances[rootId]
|
||||
if rootInstance == nil then
|
||||
invariant("Cannot reify an instance not present in virtualInstances\nID: {}", rootId)
|
||||
end
|
||||
|
||||
reifyInstanceInner(unappliedPatch, deferredRefs, instanceMap, virtualInstances, rootId, parentInstance)
|
||||
|
||||
return unappliedPatch
|
||||
|
|
@ -43,10 +50,10 @@ function reifyInstanceInner(unappliedPatch, deferredRefs, instanceMap, virtualIn
|
|||
local virtualInstance = virtualInstances[id]
|
||||
|
||||
if virtualInstance == nil then
|
||||
-- This instance was intentionally excluded from the patch (e.g., due to
|
||||
-- ambiguous paths with duplicate-named siblings). Skip it gracefully
|
||||
-- rather than throwing an error. The parent's Children array may still
|
||||
-- reference this ID even though it wasn't included in the additions.
|
||||
-- This child was intentionally excluded from the patch (e.g., due to
|
||||
-- ambiguous paths with duplicate-named siblings). Skip it gracefully.
|
||||
-- The parent's Children array may still reference this ID even though
|
||||
-- it wasn't included in the additions.
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue