Closed Ketasaja closed 1 month ago
I'm not sure if we want to encourage some of those behaviors tbh. Things like holey arrays are bad practice.
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.
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."
Why is this worth mentioning? Tables are everything to Luau,
RemoteEvent
serialization doesn't respect them, and Zap does.