From edc09741bf56cdbdb6516c1c5406e5c2f512b32d Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 1 Feb 2026 11:57:00 -0600 Subject: [PATCH] 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. --- plugin/http/Error.lua | 4 +- .../Components/PatchVisualizer/DomLabel.lua | 4 +- plugin/src/App/init.lua | 24 ++++++------ plugin/src/Reconciler/hydrate.lua | 37 +++++++++++++++++++ plugin/src/Reconciler/reify.lua | 15 ++++++-- plugin/src/ServeSession.lua | 2 +- plugin/src/init.server.lua | 2 +- plugin/src/invariant.lua | 4 +- plugin/src/soundPlayer.lua | 6 +-- 9 files changed, 71 insertions(+), 27 deletions(-) diff --git a/plugin/http/Error.lua b/plugin/http/Error.lua index f9e46b38..af059493 100644 --- a/plugin/http/Error.lua +++ b/plugin/http/Error.lua @@ -3,11 +3,11 @@ Error.__index = Error Error.Kind = { HttpNotEnabled = { - message = "Rojo requires HTTP access, which is not enabled.\n" + message = "Atlas requires HTTP access, which is not enabled.\n" .. "Check your game settings, located in the 'Home' tab of Studio.", }, ConnectFailed = { - message = "Couldn't connect to the Rojo server.\n" + message = "Couldn't connect to the Atlas server.\n" .. "Make sure the server is running — use 'rojo serve' to run it!", }, Timeout = { diff --git a/plugin/src/App/Components/PatchVisualizer/DomLabel.lua b/plugin/src/App/Components/PatchVisualizer/DomLabel.lua index f774ba16..b81fa74d 100644 --- a/plugin/src/App/Components/PatchVisualizer/DomLabel.lua +++ b/plugin/src/App/Components/PatchVisualizer/DomLabel.lua @@ -203,8 +203,8 @@ local function SelectionRadio(props) end end, }), - Rojo = e(SelectionOption, { - text = "Rojo", + Atlas = e(SelectionOption, { + text = "Atlas", optionType = "push", isSelected = props.selection == "push", transparency = props.transparency, diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index e368ad03..1f653d91 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -871,7 +871,7 @@ function App:endSession() end function App:render() - local pluginName = "Rojo " .. Version.display(Config.version) + local pluginName = "Atlas " .. Version.display(Config.version) local function createPageElement(appStatus, additionalProps) additionalProps = additionalProps or {} @@ -1010,9 +1010,9 @@ function App:render() }), toggleAction = e(StudioPluginAction, { - name = "RojoConnection", - title = "Rojo: Connect/Disconnect", - description = "Toggles the server for a Rojo sync session", + name = "AtlasConnection", + title = "Atlas: Connect/Disconnect", + description = "Toggles the server for an Atlas sync session", icon = Assets.Images.PluginButton, bindable = true, onTriggered = function() @@ -1027,9 +1027,9 @@ function App:render() }), connectAction = e(StudioPluginAction, { - name = "RojoConnect", - title = "Rojo: Connect", - description = "Connects the server for a Rojo sync session", + name = "AtlasConnect", + title = "Atlas: Connect", + description = "Connects the server for an Atlas sync session", icon = Assets.Images.PluginButton, bindable = true, onTriggered = function() @@ -1040,9 +1040,9 @@ function App:render() }), disconnectAction = e(StudioPluginAction, { - name = "RojoDisconnect", - title = "Rojo: Disconnect", - description = "Disconnects the server for a Rojo sync session", + name = "AtlasDisconnect", + title = "Atlas: Disconnect", + description = "Disconnects the server for an Atlas sync session", icon = Assets.Images.PluginButton, bindable = true, onTriggered = function() @@ -1056,8 +1056,8 @@ function App:render() name = pluginName, }, { button = e(StudioToggleButton, { - name = "Rojo", - tooltip = "Show or hide the Rojo panel", + name = "Atlas", + tooltip = "Show or hide the Atlas panel", icon = self.state.toolbarIcon, active = self.state.guiEnabled, enabled = true, diff --git a/plugin/src/Reconciler/hydrate.lua b/plugin/src/Reconciler/hydrate.lua index d7798160..afaf49c6 100644 --- a/plugin/src/Reconciler/hydrate.lua +++ b/plugin/src/Reconciler/hydrate.lua @@ -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 diff --git a/plugin/src/Reconciler/reify.lua b/plugin/src/Reconciler/reify.lua index 11840b54..4e59ca5c 100644 --- a/plugin/src/Reconciler/reify.lua +++ b/plugin/src/Reconciler/reify.lua @@ -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 diff --git a/plugin/src/ServeSession.lua b/plugin/src/ServeSession.lua index 1645dc15..56c27f3a 100644 --- a/plugin/src/ServeSession.lua +++ b/plugin/src/ServeSession.lua @@ -517,7 +517,7 @@ function ServeSession:__applyPatch(patch) end local patchTimestamp = DateTime.now():FormatLocalTime("LTS", "en-us") - local historyRecording = ChangeHistoryService:TryBeginRecording("Rojo: Patch " .. patchTimestamp) + local historyRecording = ChangeHistoryService:TryBeginRecording("Atlas: Patch " .. patchTimestamp) if not historyRecording then -- There can only be one recording at a time Log.debug("Failed to begin history recording for " .. patchTimestamp .. ". Another recording is in progress.") diff --git a/plugin/src/init.server.lua b/plugin/src/init.server.lua index c14487ff..01f7fe72 100644 --- a/plugin/src/init.server.lua +++ b/plugin/src/init.server.lua @@ -19,7 +19,7 @@ end) local app = Roact.createElement(App, { plugin = plugin, }) -local tree = Roact.mount(app, game:GetService("CoreGui"), "Rojo UI") +local tree = Roact.mount(app, game:GetService("CoreGui"), "Atlas UI") plugin.Unloading:Connect(function() Roact.unmount(tree) diff --git a/plugin/src/invariant.lua b/plugin/src/invariant.lua index d1b7ccc8..78f9b490 100644 --- a/plugin/src/invariant.lua +++ b/plugin/src/invariant.lua @@ -16,9 +16,9 @@ else message = Fmt.fmt(message, ...) local fullMessage = string.format( - "Rojo detected an invariant violation within itself:\n" + "Atlas detected an invariant violation within itself:\n" .. "%s\n\n" - .. "This is a bug in Rojo. Please file an issue:\n" + .. "This is a bug in Atlas. Please file an issue:\n" .. "https://github.com/rojo-rbx/rojo/issues", message ) diff --git a/plugin/src/soundPlayer.lua b/plugin/src/soundPlayer.lua index 32592720..8aec34c4 100644 --- a/plugin/src/soundPlayer.lua +++ b/plugin/src/soundPlayer.lua @@ -3,11 +3,11 @@ local plugin = plugin or script:FindFirstAncestorWhichIsA("Plugin") local widget = nil if plugin then widget = plugin:CreateDockWidgetPluginGui( - "Rojo_soundPlayer", + "Atlas_soundPlayer", DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, false, true, 10, 10, 10, 10) ) - widget.Name = "Rojo_soundPlayer" - widget.Title = "Rojo Sound Player" + widget.Name = "Atlas_soundPlayer" + widget.Title = "Atlas Sound Player" end local SoundPlayer = {}