Repository navigation
v3.0.0
Changelog
Leap V3 - Major Update
This update introduces significant new features, improvements, and changes to existing functionalities.
New Features:
- Caching System: Leap now features a caching system that processes only modified files. Resources will only be preprocessed when necessary; if no changes are detected, the resource will simply restart. Cache files are stored in the
cachefolder in the server's root directory. - Automatic
fxmanifest.luaModification: After preprocessing, Leap automatically adds thebuildsubfolder to all file declarations in thefxmanifest.luaunderclient,server,shared, andescrow_ignoresections. This requiresadd_ace resource.leap command.refresh allowin yourserver.cfg. - Leap Library: A new library
leaphas been introduced with the following functions:leap.deserialize(myObject): Converts serialized class instances back into objects, restoring their structure and data. Supports customdeserializemethods within classes.leap.serialize(myObject): Converts objects or arrays of objects (typically class instances) into a serializable table format. Supports customserializemethods within classes and the@skipSerializedecorator to prevent fields from being serialized.leap.fsignature(func): Retrieves function signature metadata, including argument names and return status.
- Compact Function: A new compact alternative to traditional function expressions, similar to arrow functions, using
dokeyword.- Syntaxes:
(param1, paramN) do -- code,param do -- code,(param1, paramN) do -- code.
- Syntaxes:
- Continue Keyword: Allows skipping the current iteration in a loop.
- Cosmetic Underscores for Integers: Improves readability of large numeric literals (e.g.,
1_000_000). - Filter: A mechanism for validating specific conditions before a function executes, using the
usingoperator. Filters can access local variables and return error messages. - In Operator: Checks for the existence of a substring in a string or an element/key in a table.
- Is Operator: Checks if an object is an instance of a specific class or one of its subclasses, supporting inheritance-aware comparisons.
- Keyword Arguments: Allows calling functions with named parameters for improved readability and flexible parameter order.
- Not In Operator: The inverse of the
inoperator. - String Interpolation: Embed expressions directly into strings using
${expression}. - Table Comprehension: Concise syntax for creating and transforming tables with filtering and mapping.
- Ternary Operator: A shorthand for inline
if-elsestatements (condition ? value1 : value2). - Throw: Used to create custom exceptions. Custom errors can extend the
Errorclass and provide atoStringmethod for custom messages. - Try-Catch: Blocks for error handling, allowing graceful recovery from errors.
- Using Operator: Executes a defined
filter, throwing an error if any conditions fail.
Changes & Improvements:
leap buildCommand: Now ignores the cache when preprocessing a resource and creating thebuildsubfolder.- Classes:
- Constructors are now called with
self:super()instead ofself.super(). - Classes can now be edited after definition using the
__prototypeattribute.
- Constructors are now called with
- Decorators: Can now be used on class fields (passing
selfinstance) and directly on classes (allowing modification of the class prototype). - Type Checking: The syntax has changed from
(<type> param1)to(param1: type1). - Convars:
- The
leap:devconvar has been removed. - A new convar
leap_verbose(boolean, defaultfalse) has been added.
- The
Removed Features:
- Shadow Writing: The shadow writing system has been removed.
leap rebuildCommand: This command is no longer available as a direct command fromfxserver.- Unpack (
...) Operator: The explicit unpack operator for arrays has been removed. - Development Status: The convar
leap:devand its associated features (resource startup times logging,leap rebuildcommand) have been removed.
Other: