fix(typings): static Lori API declared as methods causes colon-call argument shift in roblox-ts#1
Open
Loner1536 wants to merge 1 commit into
Open
Conversation
The top-level Lori module forwards static calls to the default client through plain functions with no self parameter, but the typings declared them method-style, making roblox-ts emit colon calls that shift every argument (e.g. Lori.mount() passed the module table as parent and failed with 'Instance expected, got table' in ui.render). - LoriStatic no longer extends LoriApi; all members are function properties so roblox-ts emits dot calls matching init.luau - ItemBlacklist: New/FPS/Frame/Memory/Ping are plain closures in the source, only addItem is a real method - add @rbxts/types triple-slash reference Instance methods on LoriApi keep method syntax; client objects wrap their methods via bindDotMethods and accept both conventions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
LoriStatic(andTemplates.ItemBlacklister.New) use method syntax, so roblox-ts emits colon calls likeLori:mount(nil, options). The top-level Luau module forwards statics through plain dot-call functions (forward()ininit.luau), so the Lori table itself gets passed as the first argument and everything shifts by one. Any static call with parameters breaks — e.g.Lori.mount(undefined, options)from TS fails at runtime with:because the module table lands in
parent.Lori.create(options)silently passes the module table asoptions.Fix (types only — no .luau touched)
LoriStaticno longer extendsLoriApi; all its members are declared as function properties so roblox-ts emits dot calls, matching the source.LoriApikeep method syntax — clients fromLori.create()wrap their methods viabindDotMethodsand accept both conventions, and the raw definitions are colon-style anyway.LoriItemBlacklist:New/FPS/Frame/Memory/Pingare plain closures in the source, so they're now properties too; onlyaddItemis a real method.@rbxts/typestriple-slash reference (the typings useColor3,Instance,LuaTuple, etc.).No compiled-Luau consumer is affected (typings aren't loaded), and existing TS call sites compile unchanged — only the emitted call convention changes, which previously crashed or arg-shifted at runtime, so nothing working can regress.
Tested
In a roblox-ts project consuming this repo as a git dependency: inspected the emitted Luau to confirm dot calls on the static surface and colon calls on instances, and verified in Studio — mount with the Performance template, blacklister, traces, and graphs all working; the
render:570crash is gone.🤖 Generated with Claude Code