Releases: TenebrisNoctua/ClassPP
Releases · TenebrisNoctua/ClassPP
Version 2.0.0
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
@selfalias 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
objectwill now have auto-completion for certain default methods. - Updated Inheritance
- Deprecated the
class.extendsmethod and instead merged the functionality with theclassfunction 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.
- super is a new default method of an
- Deprecated the
- Major Type Overhaul
- The old Type API has been replaced with a better and a more consistent one.
- The old
Type.typeof()andType.typeofClass()methods have been replaced withType.type()andType.typeof()methods that are more compatible and consistent with Luau's built-intype()andtypeof()functions. You can even replace these built-in methods with Class++'s Type API, and your code will still work!
- The old
- 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
classDatatable. class.newnow reflects the parameter types of the definedconstructorfunction in theclassDatatable. 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
falsein theclassDatatable, Class++ will now show it asany, instead ofboolean. This is to reduce type errors when first defining members in theclassDatatable. (You can go around this by casting or annotating it tobooleanlater.) - The type system is now more consistent and faster.
- The old Type API has been replaced with a better and a more consistent one.
- 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 internalobjectDatawill properly be disposed of. (Recommended) - If the object hasn't already been destroyed,
destructor(if it exists) will be called with a copy of theobjectData. This is to ensure backwards compatibility, and to make this system properly work. The copyobjectDatashould never be held onto, as afterdestructorruns it will immediately be disposed of. - This can be configured through the new
autoObjectDestructionproperty of the main API. destructorfunctions will now emit a non-fatal error from Class++ when an error occurs in the function.
- If the object has already been destroyed with the
- 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
autoObjectDestructionis disabled) - Object indexing is now faster.
Destroy()can no longer be called within constructors.- Class++ will now properly clean threads and
RBXScriptConnectionsinside objects, alongsideInstances. - 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
classDatarestrictions. - 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.
Version 0.5.0 (New Type Solver Beta)
- Improvements to Inheritance and Constructors:
super()can now be called within constructors to access parent constructors.super()can now be called both within normal class functions and constructors in a chain system. This now makes it possible for systems such as constructor chaining to exist with Class++.- With these changes to
super(), automatic parent class constructor calling has now been removed. super()can no longer be called without its object argument.- Constructors and destructors are no longer inherited.
- Improvements to Types:
- In inherited classes,
class.new()will now have the correct argument types for the parameter types in the constructor function. - In inherited class objects, private members will now properly show up in the auto-complete.
- The type system is now more consistent and faster internally, and many bugs have been fixed. This means you will get auto-complete faster with less issues.
class.new()will also be more forgiving in the strict type-checking mode for arguments.
- In inherited classes,
- Others:
- Object creation is now faster.
- Class creation is now faster.
- The version number in the main module is now consistent with the actual version.
- Fixed a bug where indexing the class object would allow you to bypass the
classDatarestrictions.
Version 0.4.0 (New Type Solver Beta)
Release Version 0.4.0 (New Type Solver Beta)
- A major bug with object creation has been fixed. If you've been having problems with multiple objects sharing the same value, please use this version. (#13)
destructorfunctions will now emit a non-fatal error from Class++ when an error occurs in the function.- Some internal bug fixes and changes.
- Updated the documentation.
Version 0.3.0 (New Type Solver Beta)
Release Version 0.3.0 (New Type Solver Beta)
- Class++ will now properly clean
threads andRBXScriptConnections inside objects, alongsideInstances. - Garbage collection system is now faster, though it may slow down object creation. (By ~3us)
- Garbage collection system can now be configured through
autoGarbageCollectionproperty of the main API. - Class creation should be faster.
- Object creation is now faster. (If
autoGarbageCollectionis false) super()is now faster.- An internal bug with operator overloading has been fixed.
- Certain internal functions should now work faster.
- Updated the Documentation.
Version 0.2.0 (New Type Solver Beta)
Release Version 0.2.0 (New Type Solver Beta)
- Fixed #10.
- Now using the new
@selfalias with require-by-string in the modules. - Added Automatic Destructor System.
- Every object that hasn't been properly destroyed will now automatically be destroyed by Class++. This greatly reduces memory leaks.
- When an
objectno longer has any references:- If the
objecthas already been destroyed with:Destroy(), internalobjectDatawill properly be disposed of. (Recommended) - If the
objecthasn't already been destroyed,destructor(if it exists) will be called with a copy of theobjectData. This is to ensure backwards compatibility, and to make this system properly work. The copyobjectDatashould never be held onto, as afterdestructorruns it will immediately be destroyed. After thedestructorruns, internalobjectDatawill properly be disposed of.
- If the
- Performance Updates
- Class++ now uses methods such as binary search to make internal retrieval methods faster.
- Indexing objects are now much faster.
- Reserved functions super and Destroy can no longer be called within certain functions.
super()can no longer be called withindestructors andconstructors.Destroy()can no longer be called withinconstructors.
Version 0.1.0 (New Type Solver Beta)
Release Version 0.1.0 (New Type Solver Beta)
- Updated Inheritance (Part 2)
- Added
super(). - Changed the Protected Access Specifier behavior to allow for a better overwriting system. (Similar to C++)
- Added
Type.typeandType.typeoffunctions have been updated to better supportobjects.class.newnow reflects the parameter types of the definedconstructorfunction in theclassDatatable.- The
objectwill now have auto-completion for certain default methods. - Removed unnecessary message templates.
- Fixed bugs allowing you to re-define members in different access specifiers.
- Improved performance.
Version 0.0.1 (New Type Solver Beta)
Release Version 0.0.1 (New Type Solver Beta)
Hello everyone! This update is about the new re-write of Class++ for the new type solver. This is one of the many updates that will come, so stay tuned.
- The module has been re-written from the ground up.
- Main module has been re-written to support the new type solver, and allow for a better experience using Class++.
- The main API Surface is the same, however certain method behaviors have changed.
- Replaced the Error API with a much better and expandable Log API.
- Updated the Type API to make it more compatible and stable (it can even be used as a replacement for built-in type methods), however, method names are changed.
- Updated Inheritance (Part 1)
- Removed
class.extendsmethod and instead merged the functionality with theclassmethod of the main API. - Class++ now supports multi-inheritance.
- Constructor calling mechanism has been revamped to fix bugs related to parent class constructors not being called properly.
- Inherited classes now have proper type-checking with the new type solver, this also includes objects.
- Removed
- Replacing the Error API with Log API
- 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) to find more information about the error.
- Certain error messages now provide more information to make debugging easier.
- Type API is now more stable and compatible
- The old
Type.typeof()andType.typeofClass()methods have been replaced withType.type()andType.typeof()methods that are more compatible with Luau's built intype()andtypeof()functions. You can even replace the built-in methods with the new Type API methods, and they will still work! (Type API provides type support for class and objectuserdatas.)
- The old
- Major bug fixes
- Fixed Friend access specifier not using the
classreferences properly to allow otherclasses 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 related to inheritance.
- Fixed Friend access specifier not using the
⚠️ Notes:
- Because the new type solver is still in beta, certain type-related features may stop working or cause bugs. And even though the new solver is far more capable than the old one, it's still limited in certain places. That's why if you encounter an issue, please make a bug report.
- This release only contains a certain part of the announced/planned features from the discussions page. Rest of the planned features and more will come soon.
Version 1.2.1
Release Version 1.2.1
- Fixed overloaded functions not being able to access Private or Protected members of their class.
- Fixed #2
- Fixed Class++ allowing a member to be set to nil. This creates problems where when that member is set to nil, it no longer exists within the
objectData, thus it not being able to be set again later. - Class++ now automatically creates certain access specifiers internally, so you don't have to declare empty access specifiers in the
classDatatable in order to create functions with the outside class definition. - Class++ now warns you if you're using methods that will be changed/removed in a future update. This can be silenced by setting the
silenceUpdateWarningattribute in the module instance totrue. - Changed the default module name when imported from the
.rbxmfile from "Class++" to "ClassPP" to increase compatibility.
Version 1.2.0
Release Version 1.2.0
class.Inheritsandclass.Friendsproperties no longer store classes in a Dictionary. They're now stored in an Array.- Constructors in inherited classes will now call the base
class's constructor first. Then the derivedclass's constructor will be called next.
This is to match how C++ handles constructors. - The
classMemberNotFounderror will no longer stop the running thread. (NonFatal) - In the Error API,
logErrorNonFatalmethod will now correctly display the stack trace. - Bug fixes and performance improvements.
Version 1.1.0
Release Version 1.1.0
- Class++ objects now support type checking! This was an update that I was planning to do for a very long time, and it would not have been possible without @ZyroCrimson.
- All of the created objects should now have type completion for the members stored in the Public access specifier.
- Creating custom types is no longer needed, however, if you still want to use the full features of type checking in Luau, it's still recommended that you use custom types for your classes.
- For more info and examples, check out this documentation page.
- Util and Type modules now fully support the
classtype. - Updated the documentation.