Skip to content

Releases: utility-library/leap

Latest (fixes)

01 Aug 17:20

Choose a tag to compare

v3.0.0

07 Jun 21:55
94db599

Choose a tag to compare

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:

v1.0.5

09 Sep 17:13

Choose a tag to compare

New Contributors

Full Changelog: v1.0.4...v1.0.5

v1.0.4

31 May 21:42

Choose a tag to compare

Hey everyone, we've made some recent updates and fixes. Here are the details of the latest commits:

We value your opinion, so please feel free to share your thoughts and suggestions in the discussion section. Let us know what you think about these updates and any additional features you'd like to see added.

v1.0.3

20 Apr 23:53

Choose a tag to compare

Hey everyone, we fixed some bugs and added a new feature, exclusion of all .lua files from the file watcher of vscode during the shadow writing.
let us know in the discussion section what you think and what you would like to see added.


v1.0.2

01 Apr 13:43
0ae16d2

Choose a tag to compare

Hey everyone, we fixed some bugs and added a new feature, type checking in functions and added type to classes, i.e. every object instantiated by a class will have the type of the class name, read more here or look at the examples within the type checking section

  • fix(buildTask): infinite loop of preprocessing + empty files exclusion
  • fix(postProcess): fixed missing file encoding
  • fix(defaultValue): changed anythingBut to word (this should fix some issue with type checking of functions captured as functions)
  • fix(defaultValue): changed slice(0, -2) to a regex for linebreaks
  • fix(linesManipulation): Added test cases also for check with match index
  • fix(command): added dev checks for performances
  • fix(buildLoop): infinite build loop

  • feat(disableRenaming): Added the feature to disable to possibility to rename the resource.
  • feat(classes): now each class has its own type
  • feat(typeChecking): Added the ability to check the type of parameters in functions

v1.0.1

28 Mar 10:53

Choose a tag to compare

Hey everyone, we fixed some bugs and added with task builds the ability to have resources auto preprocess whenever you restart or start resources that use leap (look at the Usage section in the readme for more information)

  • fix(defaultValue): the defaultValue module would search for the match index in the modified files, which had less characters. Leading to a misplacement of the default value processed code.
  • fix(arrow functions): fixed a bug where arrow function detection would shift by some characters
  • fix(self parameter injection): block openings recognition
  • fix(classes): fixed bug that did not allow creating classes in files without other code besides the class
  • feat(buildTask): now you can directly restart/start resources using leap.

v1.0.0

08 Mar 15:38
8d8f350

Choose a tag to compare

Update package-lock.json