{"id":"tpc9000/rosyn","name":"rosyn","scope":"tpc9000","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.4.5","latest":"0.4.5","versions":["0.1.0","0.2.0","0.2.1","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.3.6","0.3.7","0.3.8","0.3.9","0.3.10","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"tpc9000/async":{"version":"^0.4.1","alias":"Async"},"tpc9000/tableutil":{"version":"^0.8.1","alias":"TableUtil"},"tpc9000/typeguard":{"version":"^6.0.0-alpha.2","alias":"TypeGuard"},"tpc9000/xsignal":{"version":"^3.0.1","alias":"XSignal"}},"integrity":"c80fb137027fa049c9c49ec1971f4182235f4f9382fbaae67458c24404a473e7","likes":0,"downloads":0,"install":"forest install tpc9000/rosyn","url":"https://forest.dev/p/roblox/tpc9000/rosyn","files":"https://api.forest.dev/ai/package/roblox/tpc9000/rosyn/files","readme":"# Rosyn\r\n\r\nWraps Lua objects over Instances, automates lifecycle with correct execution order, and handles yielding component dependencies in a memory-safe manner.\r\n\r\n## Example Usage\r\n\r\n### 1. Lifecycle\r\n\r\n```lua\r\nlocal Test = {}\r\nTest.__index = Test\r\n\r\nfunction Test.new(Root: Instance)\r\n    return setmetatable({\r\n        _Root = Root;\r\n    }, Test)\r\nend\r\n\r\nfunction Test:Initial()\r\n    print(\"Initial call on\", self._Root:GetFullName())\r\nend\r\n\r\nfunction Test:Destroy()\r\n    print(\"Destroy call\")\r\nend\r\n\r\nRosyn.Register({\r\n    Components = Rosyn.Setup.Tags({\r\n        TestTag = Test;\r\n    });\r\n})\r\n\r\nlocal TestInstance = Instance.new(\"Model\")\r\nTestInstance:AddTag(\"TestTag\")\r\nTestInstance.Name = \"TestInstance\"\r\nTestInstance.Parent = workspace\r\n-- Output \"Initial call on Workspace.TestInstance\"\r\nTestInstance:Destroy()\r\n-- Output \"Destroy call\"\r\n```\r\n\r\n### 2. Initial Chaining / Dependencies\r\n\r\n```lua\r\nlocal Test1 = [class]\r\nlocal Test2 = [class]\r\n\r\nfunction Test1:Initial()\r\n    print(\"Test1 Begin\")\r\n    task.wait(1)\r\n    print(\"Test1 Initial\")\r\nend\r\n\r\nfunction Test1:Print()\r\n    print(\"HHH\")\r\nend\r\n\r\nfunction Test2:Initial()\r\n    local Test1Component = Rosyn.AwaitComponentInit(self._Root, Test1)\r\n    Test1Component:Print()\r\n    print(\"Test2 Initial\")\r\nend\r\n\r\nRosyn.Register({\r\n    Components = Rosyn.Setup.Tags({\r\n        TestTag1 = Test1;\r\n        TestTag2 = Test2;\r\n    });\r\n})\r\n\r\nlocal TestInstance = Instance.new(\"Model\")\r\nTestInstance:AddTag(\"TestTag1\")\r\nTestInstance:AddTag(\"TestTag2\")\r\nTestInstance.Parent = workspace\r\n-- Output \"Test1 Begin\"\r\n-- 1s passes\r\n-- Output \"Test1 Initial\"\r\n-- Output \"HHH\"\r\n-- Output \"Test2 Initial\"\r\n```\r\n\r\n## Warning\r\n\r\nWith Roblox deferred events now enabled by default, `Rosyn.GetComponent` will return nil if called before defer points when an Instance is cloned / created / tagged. `Rosyn.AwaitComponentInit(Instance, Component, 0)` is advised to avoid this mistake and will yield until the next frame.\r\n","readmeTruncated":false}