red-blox / zap

A lightning fast networking solution for roblox.
https://zap.redblox.dev
MIT License
89 stars 14 forks source link

Mention table keys in documentation #119

Closed Ketasaja closed 1 month ago

Ketasaja commented 2 months ago

Why is this worth mentioning? Tables are everything to Luau, RemoteEvent serialization doesn't respect them, and Zap does.

sasial-dev commented 2 months ago

I'm not sure if we want to encourage some of those behaviors tbh. Things like holey arrays are bad practice.

Ketasaja commented 2 months ago

I wouldn't encourage holey arrays either, but I think using numbers as hashtable keys is idiomatic (like Roblox user identifiers), and if you're ever sending identifier 1 through a RemoteEvent, you accidentally made an "array". As for other cases, I think using string keys for everything can cause type safety issues developers may be looking to avoid.

I'm fine with this PR being rejected though.

jackdotink commented 2 months ago

I'm fine with this general idea being listed in the docs, but I would rephrase it to something like "Extended Type Support" and "Zap supports far more types than Remote serialization does. Maps with numbers and instances as keys is a good example."