Skip to content

v3.0.0

Choose a tag to compare

@XenoS-ITA XenoS-ITA released this 07 Jun 21:55
· 43 commits to main since this release
94db599

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 cache folder in the server's root directory.
  • Automatic fxmanifest.lua Modification: After preprocessing, Leap automatically adds the build subfolder to all file declarations in the fxmanifest.lua under client, server, shared, and escrow_ignore sections. This requires add_ace resource.leap command.refresh allow in your server.cfg.
  • Leap Library: A new library leap has been introduced with the following functions:
    • leap.deserialize(myObject): Converts serialized class instances back into objects, restoring their structure and data. Supports custom deserialize methods within classes.
    • leap.serialize(myObject): Converts objects or arrays of objects (typically class instances) into a serializable table format. Supports custom serialize methods within classes and the @skipSerialize decorator 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 do keyword.
    • Syntaxes: (param1, paramN) do -- code, param do -- code, (param1, paramN) do -- code.
  • 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 using operator. 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 in operator.
  • 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-else statements (condition ? value1 : value2).
  • Throw: Used to create custom exceptions. Custom errors can extend the Error class and provide a toString method 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 build Command: Now ignores the cache when preprocessing a resource and creating the build subfolder.
  • Classes:
    • Constructors are now called with self:super() instead of self.super().
    • Classes can now be edited after definition using the __prototype attribute.
  • Decorators: Can now be used on class fields (passing self instance) 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:dev convar has been removed.
    • A new convar leap_verbose (boolean, default false) has been added.

Removed Features:

  • Shadow Writing: The shadow writing system has been removed.
  • leap rebuild Command: This command is no longer available as a direct command from fxserver.
  • Unpack (...) Operator: The explicit unpack operator for arrays has been removed.
  • Development Status: The convar leap:dev and its associated features (resource startup times logging, leap rebuild command) have been removed.

Other: