As a Roblox developer, it is currently too hard to reason about what context a code’s scope is running under. Not literally too hard, but it’s currently a combination of cumbersome & tedious writing across an entire code base.
If I wanted to use RunContext for my scripts, what I’m effectively doing is rejoining the split client/server model behavior back into “one pipeline”, aka doing everything I can to make my code run almost the same thing on both client & server (think pre-FilteringEnabled
, but without the heinous hardware security issues).
If I want all of my code running effectively the same sanity checking functions but with minor changes relative to RunContext (e.g. changing UI on only the client, only giving players items on the server), I have to get RunService & retrieve the RunContext of the scope or inject it contextually every single time under every single ModuleScript. This is not ideal, and is open to upvalue modification anywhere along the chain, whether it’s from an outside actor or bad code deciding to change the variable itself.
This workflow would be much better served if the module code knew inherently what scope it was running under (or what scope it was require
’d by). Now that we have an Enum
to describe this, it could remove a ton of bloaty code and save a ton of local IS_SERVER
/ local IS_CLIENT
pseudo-constants everywhere.