Skip to content

Releases: maurits150/simploo

v3.0.1

25 Jan 23:19

Choose a tag to compare

What's Changed

Bug Fixes

  • Fix __finalize scope check failure during GC (730dad9)
  • Fix hotswap not updating metatable after full simploo reload (e368e4b)

Tests

  • Add test for __finalize accessing private members with hotswap (0ebeb1e)

Full Changelog: v3.0.0...v3.0.1

v3.0.0

17 Jan 15:29

Choose a tag to compare

Changelog

This is a full rewrite of simploo. The list below covers major changes but is not exhaustive.

Documentation

Full documentation available at https://maurits150.github.io/simploo/

Interfaces

Define contracts with the interface keyword and implement them with implements. Interfaces can extend other interfaces and provide default method implementations. Enable strictInterfaces config for argument validation (Lua 5.2+).

Serialization

Instances can be serialized with instance:serialize() and reconstructed with Class:deserialize(data). Use the transient modifier to exclude members. Convenience wrappers simploo.serialize() and simploo.deserialize() are also available.

New Modifiers

  • default - for interface default method implementations
  • transient - exclude members from serialization

Other

  • instance:get_member(name) and instance:get_members() for introspection
  • hook:remove(hookName [, callbackFn]) to unregister hooks
  • baseInstanceTable, baseSyntaxTable, customModifiers config options
  • Classes in the same namespace can reference each other without using
  • protected access control now enforced (v2 had the modifier but ignored it)
  • Custom __index/__newindex metamethods via meta modifier
  • instance_of() works with interfaces: player:instance_of(ISerializable)

Performance

  • Faster instantiation (only instance variables are copied, functions/statics are shared)
  • Faster member access (optimized __index/__newindex)
  • Faster instance_of() checks (O(1) ancestor lookup)

Breaking Changes

  • __declare renamed to __register
  • __tostring requires meta modifier
  • __construct cleared after call (prevents double-calling)
  • Assignment to undefined members now errors
  • abstract modifier removed (use interfaces)
  • Hooks renamed:
    • onSyntaxNamespaceonNamespace
    • onSyntaxUsingonUsing
    • beforeInstancerInitClassbeforeRegister
    • afterInstancerInitClassafterRegister
    • afterInstancerInstanceNewafterNew

v2.1.4

21 Oct 10:30

Choose a tag to compare

Increase version number