Skip to content

Version 2.0.0

Choose a tag to compare

@TenebrisNoctua TenebrisNoctua released this 21 Nov 21:10

Release Version 2.0.0

Here we are! After more than 7 months, 2.0.0 is finally here. With the general release of the new type solver, Class++ 2.0 feels finally ready to be released.

I would like to thank everyone who used Class++, reported bugs, and sent feedback. Without them, I wouldn't be able to make Class++ as good as it is now. Feel free to make more bug reports if you encounter them!

Below is a general change-log of everything from the new type solver beta releases to this release. There are lots of things that you need to know about.

Changes from 1.2.1

  • Class++ has been re-written from the ground up.
    • The source code of Class++ has been re-written from scratch for the new type solver. This is to support the new advanced type features that allows Class++ to be more intelligent than ever before.
    • Now using the new @self alias with require-by-string in the modules.
    • The main API surface is generally the same, however, the inheritance syntax and certain methods have been changed.
  • An object will now have auto-completion for certain default methods.
  • Updated Inheritance
    • Deprecated the class.extends method and instead merged the functionality with the class function of the main API.
    • Added multi-inheritance.
    • Changed the Protected Access Specifier behavior to allow for a better overwriting system. (Similar to C++)
    • Automatic parent class constructor calling has been removed.
    • Constructors and destructors are no longer inherited.
    • Added super().
      • super is a new default method of an object, which allows you to access parent class methods from child classes.
      • super, when called in a class method, calls the method with the same name in the parent class of the class it's been called from.
      • super can be used both in normal class methods and constructors, allowing you to create chain systems like in other OO languages.
  • Major Type Overhaul
    • The old Type API has been replaced with a better and a more consistent one.
      • The old Type.typeof() and Type.typeofClass() methods have been replaced with Type.type() and Type.typeof() methods that are more compatible and consistent with Luau's built-in type() and typeof() functions. You can even replace these built-in methods with Class++'s Type API, and your code will still work!
    • Class and Object types are now far more advanced than they were ever before, the object type now supports auto-complete for all of the members (including private and protected) in the classData table.
    • class.new now reflects the parameter types of the defined constructor function in the classData table. This also includes inherited classes.
    • In inherited class objects, private members will now properly show up in the auto-complete.
    • When a class member is set to false in the classData table, Class++ will now show it as any, instead of boolean. This is to reduce type errors when first defining members in the classData table. (You can go around this by casting or annotating it to boolean later.)
    • The type system is now more consistent and faster.
  • Automatic Object Destruction
    • Class++ now mostly, if not entirely, removes the need to manually track your objects. It will now automatically track and detect when your objects are no longer referenced in runtime, and if so, will then destroy the object.
    • When an object no longer has any references:
      • If the object has already been destroyed with the :Destroy() method, the internal objectData will properly be disposed of. (Recommended)
      • If the object hasn't already been destroyed, destructor (if it exists) will be called with a copy of the objectData. This is to ensure backwards compatibility, and to make this system properly work. The copy objectData should never be held onto, as after destructor runs it will immediately be disposed of.
      • This can be configured through the new autoObjectDestruction property of the main API.
      • destructor functions will now emit a non-fatal error from Class++ when an error occurs in the function.
  • Replaced the Error API with Log API
    • Class++ now has an advanced Log API, unlike the simple and old Error API, it allows for different kinds of output messages.
    • To make debugging easier, Class++ error messages are now more consistent in style and easier to read, and they will now provide links (in Studio), allowing you to find more information about the error.
    • Certain error messages now provide more information.
  • General Improvements and Bug Fixes
    • Class creation is now faster.
    • Object creation is faster in certain cases. (e.g when autoObjectDestruction is disabled)
    • Object indexing is now faster.
    • Destroy() can no longer be called within constructors.
    • Class++ will now properly clean threads and RBXScriptConnections inside objects, alongside Instances.
    • Fixed Friend access specifier not using the class references properly to allow other classes access to Private and Protected members.
    • Fixed overloaded functions not being able to access Private and Protected members of their class.
    • Fixed bugs related to being able to set a class member to nil.
    • Fixed bugs allowing you to re-define members in different access specifiers.
    • Fixed an internal bug with operator overloading.
    • Fixed a bug where indexing the class object would allow you to bypass the classData restrictions.
    • Fixed major bugs related to object and class creation.
  • Updated the Documentation
    • Documentation now has a brand new interface, with better colors and style.
    • All of the sections have been completely re-written with better wording and examples.
    • Documentation now has new sections and a better API reference.
    • Documentation will still show 1.2 as an older version.