Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

v0.0.9

Compare
Choose a tag to compare
@bluefeet bluefeet released this 05 Feb 08:00
· 96 commits to master since this release

This release completely reorganizes the o.js code to remove the web-specific hacks and fully embrace the CommonJS/Node.js module format. Several internal tools have been built as well to produce the web-ready versions of o.js. This cleans up things quite a bit and even provides the possibility to build custom versions of o.js that only include those features that you need.

In addition to the above a lot of other small tweaks, clarifications, and enhancements have been made. The most major change being that o.Constructor has been renamed to o.Class. Do note that o.js is still being designed and that there is no guarantee of API stability until we decide to release v1.0.0. Despite that, o.js is beginning to leave adolescence and is entering maturity, so v1.0.0 shouldn't be too far off.

Global

  • Migrated everything to CommonJS format modules (no more hacks for the web, those will be handled independently).
  • Better error messaging across the board (no more "..." errors).
  • Lots of adjustments to reduce the minified size by several kilobytes.
  • Created several utilities in the bin directory for creating combined and minified versions of o.js.
  • Combined o.js and minified o-min.js are now shipped within the o-js repository.

Classes

  • Renamed o.Constructor to o.Class, because that is what it is and it is less to type.

Traits

  • Added requires attribute to o.Trait so that traits can declare a base-line interface that they require to be installed onto an object.

Types

  • Added o.simpleObjectType for checking if an object's constructor is Object.
  • Added o.typeType, o.attributeType, o.traitType, and o.classType for validating and coercing o.js's built-in object types.
  • ArrayOfType and ObjectOfType now apply their inner type's coercions.
  • Greatly simplify the trait type.
  • InstanceOfType declares a coercion that will create a new instance using the value as arguments to the constructor.
  • Added o.positiveIntType due to this type being a common case.

Plumbing

  • Exposed o.ucFirst to the public.

Visit o-js.com for downloads, documentation, and other resources.