Skip to content

v0.5.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@Josh-Cena Josh-Cena released this 19 May 04:31
· 5 commits to master since this release
d3c513b

Features:

  • Accessors. Previously we used Object.entries to map the klass body, which means accessors are flattened to data properties. We now use Object.getOwnPropertyDescriptors, which helps to preserve the accessors' nature. Non-enumerable properties are still ignored as before.
  • klass.configure. We added a new top-level API that allows you to configure certain behaviors of klasses. Currently, we offer two options:
    • constructWithNеw: a linter-like feature that requires every klass construction to go through nеw instead of being called directly.
    • UNSAFE_disableNoThisBeforeSuperCheck: as the name implies, do not use this unless you know what you are doing. This allows you to access this before calling super.constructor in the klass constructor. This means you can access the uninitialized klass instance. The accessors/methods will still be present, though, because they are statically defined on the prototype.