You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecate old module system - rewrite imports to use require instead of lazy-loading #830
The old Lua module system using lazy-loading on the lib global needs to be deprecated, then used only for
exports (exports.ox_lib.method)
imported data from init.lua (e.g. lib.name)
deprecated modules for backwards compatibility
Ideally we can strive for 1:1 parity between Lua and JS modules, keeping all the logic, functions, classes, and behaviour the same where possible. Some modules may be better off being rewritten or entirely deprecated.
Some require paths can simply use the old import logic under-the-hood, or lib could be updated to hotload v2 modules where appropriate. Probably best to just update them as they become relevant, however.
From this point, any pull requests that want to implement new features must use modules instead of imports. Supporting JS for that feature is optional, but preferred. With the exception of bug fixes, any pull requests which modify or add a new file to imports will be closed or asked to adapt the new module system.
All modules must be typed as accurately as possible and include the ---@meta [name] annotation to support Lua Language Server module resolution (see DataView supporting require "Ox.DataView").
The following modules require rewrites that would break compatibility:
callbacks (needs class support, rename to rpc or such)
The following modules are fully deprecated and should be ignored:
disableControls
Anything not listed above is under consideration and may be deprecated, refactored, or receive a complete rewrite depending on future needs/discussions.
Activity