Releases: utility-library/leap
Latest (fixes)
Full Changelog: v3.0.0...v3.0.1
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:
v1.0.5
v1.0.4
Hey everyone, we've made some recent updates and fixes. Here are the details of the latest commits:
-
fix: Now the command "leap restart " should work properly. Previously, when executed, it would preprocess the resource twice, resulting in only having the build version and losing the unbuilt code. This issue has been resolved.
-
feat: We've introduced a new feature called hooking.js. This feature includes the assignment of an ID to each feature, which will enable future implementation of function hooking. This will facilitate sharing instantiated server-to-client and client-to-server objects. The hooking.js feature simply adds text before the file if certain features match.
-
feat: We've also implemented instantiated object sharing between the client and server, enabling object sharing in both directions.
-
fix: We've resolved an issue related to an infinite stack call during the hooking process. This fix will prevent any potential disruptions caused by this problem.
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
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
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
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.