Auto-updated API Dump / Reflection Metadata module

#1

By default, Roblox doesn’t provide API Dump / Reflection Metadata information to us within Roblox. This can be problematic for plugins that need it, as they either have to be manually updated every time one of these changes, or download the information through HttpService, which requires developers to toggle it on in every place they want to use the plugin in.

I decided to write a bot to automatically upload ReflectionMetadata, the API Dump, and class icons to Roblox whenever it updates, as there are a number of cool existing and potential plugins that need this information E.g.:

You can now access this information by requiring a public module from the site (InsertService was not an option as it disallows inserting scripts). As per woot3’s suggestion, the API dump and ReflectionMetadata are provided in the exact same format as the official API dump and ReflectionMetadata xml file. You can write your own wrapper to change the format of the data so it’s easier to use, and I may provide a separate module in the future that does this for you out of the box.

Example Code:

local info = require(2247441113)

local classIcon20AssetId = info.ClassIcons[20]
print(classIcon20AssetId)
=> 2254548328

local instanceApiInfo = info.ApiDump.Classes[1]
print(instanceApiInfo.Superclass)
=> <<<ROOT>>>

local reflectionInfo = info.ReflectionMetadata
for _,classInfo in pairs(reflectionInfo.Classes) do
    print(classInfo.Name)
end
=> BindableFunction, etc
23 Likes

Best way to copy a long string from a variable?
Reclass - smarter class conversion plugin
#2

What can you even use reflection metadata for?

0 Likes

#3

Some use cases are given in the bullet list, in case you missed it.

0 Likes

#4

Does your bot auto upload new instance icons? The current system I use for my plugin uses @Anaminus’ sprite sheet from his API websites GitHub, paired with his GitHub repository’s json list of updated instance info. If yours uploads new icons when new instances come out I might switch over

0 Likes

#5

Yes, it uploads new icons whenever Roblox adds them, as well if any existing icons are updated (e.g. shirts/pants)

2 Likes

#6

Oh that’s cool!! I might port over when I get the chancr

0 Likes

#7

Can it have icons as a sprite sheet including coordinates too?

0 Likes

#8

What do you recommend is the best way to pass this data to the client?

0 Likes

#9

I think you can require public module ids on the client. If not then you can insert it with InsertService on game start up or you should be able to pass the data from the server without any modifications.

0 Likes

#10

Even if it is possible, inserting models through the client is bad practice – you should insert on the server and then only pass the data you care about to the client.

0 Likes

#11

What’s wrong with inserting this module on server start up and requiring it on the client? It’s not anything with sensitive data. It’s just an API dump. Doing extra work to get the data to the client via Remotes sounds like a waste of time when the data is already in an easy-to-consume format.

I think inserting models should generally be avoided anyway, and usually what you’re suggesting is the best way to do it, but I don’t think that should apply as an absolute rule to all situations.

0 Likes

#12

How can you insert on the server in a group game? I added the model into my inventory and I still got errors for “Asset is not trusted for this place” even though I am the group owner

0 Likes

#13

I’m not sure if there’s a way to do that. :man_shrugging: If you really need the whole API dump on the client then you might have to use remotes. The API dump is in a fairly straightforward format though so you should be able to just pass the module data from require into a remote and receive it on the client, assuming the data isn’t too much to send.

1 Like

#14

Here’s a small example place: ApiDumpOnClient.rbxl (25.4 KB)

As long as you require ApiDump on the server (ideally near startup) then you can call ApiDump on the client at any time and it’ll get a copy of the API Dump.

1 Like

#15

Why do you have the double check?
if game:GetService('RunService'):IsClient() and not game:GetService('RunService'):IsServer() then

0 Likes

#16

I’m still running with Accurate Play Solo off, and with Accurate Play Solo off both IsClient and IsServer return true.

1 Like

#17

How can you tell the difference between a property v.s. a function and etc… As I’m trying to get the properties of a part

1 Like