Kampfkarren / protoc-gen-luau

Mozilla Public License 2.0
9 stars 3 forks source link

Add metatable support to generated messages. #9

Closed rofrankel closed 6 months ago

rofrankel commented 6 months ago

Add metatable support to generated messages.

This includes letting .new take initialization data in order to preserve workflows in which a message is created from a pure data table.

Also, WKTs' jsonDecode methods now take and use a constructor, so that they can return the metatable object rather than just a data table.

This makes it possible to write e.g. my_duration:encode rather than having to write duration.Duration.encode(my_duration). This is always convenient, but it's necessary for generic code like Any.pack.


Stack created with Sapling. Best reviewed with ReviewStack.