Very common pattern:
- ModuleScript MyThingModule provides common code and types
- Scripts MyThingServer and MyThingClient require MyThingModule
- MyThingServer and MyThingClient use common types throughout, but they need to either explicitly import them or add “MyThingModule.” to the beginning of every type reference.
It makes sense to me that a script such as MyThingServer or MyThingClient, which primarily uses the module MyThingModule would want to have all the relevant types readily accessible without going through a namespace. But this is very annoying to do right now. I want something simple that does this for me.
Current:
type A = MyThingModule.A
type B = MyThingModule.B
type C = MyThingModule.C
-- etc
Proposed:
type import MyThingModule
Additional common pattern: Many projects have a single module called Types or something similar that’s required by most scripts in the game, which provides common types used throughout the project. Type import makes this much less annoying to do.