ComponentJS -- Component System for JavaScript Copyright (c) 2009-2018 Ralf S. Engelschall Changes ======= This is a list of MAJOR changes to ComponentJS. For a more fine-granular commit-based change information, have a look at the version control history under https://github.com/rse/componentjs/commits/master Major changes between ComponentJS 1.6.3 and 1.6.4 ------------------------------------------------- o BUGFIX: Fixed NPM publishing procedure. Major changes between ComponentJS 1.6.2 and 1.6.3 ------------------------------------------------- o IMPROVEMENT: Allow state life-cycle methods to return a Promise (internally causing guards to be applied automatically) o IMPROVEMENT: Add hook "ComponentJS:vue:modelisevent" to allow applications to configure prefix for ComponentJS events. Major changes between ComponentJS 1.6.1 and 1.6.2 ------------------------------------------------- o BUGFIX: Ensure errors are correctly passed-through in the Testdrive plugin's drive() method. Major changes between ComponentJS 1.6.0 and 1.6.1 ------------------------------------------------- o BUGFIX: On destroy() correctly tear down the whole component subtree instead of just the target component. Major changes between ComponentJS 1.5.0 and 1.6.0 ------------------------------------------------- o BUGFIX: The state and guard handling was broken for corner cases: First, the guards were being active even after a component got destroyed. Second. state transition requests blocked by a guard still executed after a state was requested in synchronous mode. Third, multiple callbacks to be executed once a state was reached (upward or downward) were not supported at all. o IMPROVEMENT: Added new await()/unwait() methods to each component that allow one to wait until the component reaches a particular state. The optional callback from state() now uses await() internally, too. o IMPROVEMENT: The Vue plugin was causing performance issues if it created ComponentJS observers for each and every model field it finds. It now only creates observers if Vue is actually calling for a bindings to the fields. o MAINTENANCE: Updated all dependecies to their latest versions. Major changes between ComponentJS 1.4.4 and 1.5.0 ------------------------------------------------- o INCOMPATIBILITY: Previously, in a CommonJS environment (like Node.js, Webpack, Browserify, etc) ComponentJS exported to the less convenient and conventional "module.exports.ComponentJS". It now exports to just the conventional "module.exports" and this way can be used with just "require('componentjs')" instead of "require('componentjs').ComponentJS". o IMPROVEMENT: Move documentation of Vue plugin from source code to documentation. o BUGFIX: Silence Google Closure Compiler again for arguments.callee usage. Major changes between ComponentJS 1.4.3 and 1.4.4 ------------------------------------------------- o IMPROVEMENT: Allow the Vue plugin method vue() method to accept either option.template or option.render to be more flexible. o IMPROVEMENT: Improve TypeScript definition of API. o BUGFIX: Allow the automatic socket generation for all "data-socket" attributes in the Vue plugin to also handle root elements. Major changes between ComponentJS 1.4.2 and 1.4.3 ------------------------------------------------- o IMPROVEMENT: Be more descriptive in debug messages related to the dispatching of events to subscribers. o IMPROVEMENT: Improve rendering of testdrive plugin dialog in SPAs which change CSS "box-sizing" at the top-level (as Bootstrap-based SPAs do) by enforcing "box-sizing: content-box" in the displayed testdrive dialog. Also enforce "white-space: nowrap" on the "Identifier" column. Major changes between ComponentJS 1.4.1 and 1.4.2 ------------------------------------------------- o ADDITION: Added to the Vue plugin the functionality of generating Vue trampoline methods for all utility methods named "utilXXX" in the ComponentJS (view) component backing objects. They can be used for complex checks or calculations in the Vue data-binding. o ADDITION: Added detailed functionality documentation to the top of the Vue plugin. Major changes between ComponentJS 1.4.0 and 1.4.1 ------------------------------------------------- o IMPROVEMENT: Vue plugin: allow values to be set in event binding by using "eventFooBar(value)" instead of just "eventFooBar". o INCOMPATIBILITY: Vue plugin: switch from Vue recognized 'ref="socketFoo"' to standard non-Vue 'data-socket="foo"' and use the new freedom by supporting a "[][@]" syntax for the socket auto-generation mechanism. Major changes between ComponentJS 1.3.1 and 1.4.0 ------------------------------------------------- o BUGFIX: Fixed height of console and infobox parts in ComponentJS debugger. Removed duplicated CSS styles in ComponentJS debugger. Changed CSS appearance of all ComponentJS debugger buttons. Set overflow only to overflow-y in ComponentJS debugger. o IMPROVEMENT: Changed ComponentJS debugger infobox output to sort model values. Added filter to console list in ComponentJS debugger. o IMPROVEMENT: Throw an error when a clazz or trait tries to define a static or dynamic field with the name of one of the defined life-cycle enter/leave methods. Major changes between ComponentJS 1.3.0 and 1.3.1 ------------------------------------------------- o BUGFIX: Fix default socket handling in Vue plugin. Major changes between ComponentJS 1.2.7 and 1.3.0 ------------------------------------------------- o BUGFIX: The "op" parameter of method value() accepted an empty string which is not valid. o IMPROVEMENT: Revamped values plugin (component.plugin.values.js): no more caching (as it can make trouble), use correct owner component, use the internal .data sub-field. o IMPROVEMENT: Upgraded all build environment dependencies. o ADDITION: Added a Vue.js plugin (component.plugin.vue.js). Major changes between ComponentJS 1.2.6 and 1.2.7 ------------------------------------------------- o BUGFIX: Pass-through arguments in internal intermediate/auto-generated "this.base()" trampoline methods and always annotate those methods with the intended name. This allows mixins to correctly call "this.base(arg)" and get "arg" to be correctly passed to a base function in the inheritance chain of the class the mixin is mixed into. o BUGFIX: Add missing documentation for publish() parameters. o IMPROVEMENT: Update all build-time dependencies. o IMPROVEMENT: Update all build-time dependencies. Major changes between ComponentJS 1.2.5 and 1.2.6 ------------------------------------------------- o BUGFIX: Aligned versions between NPM package.json and VERSION file. Major changes between ComponentJS 1.2.4 and 1.2.5 ------------------------------------------------- o BUGFIX: Fix special case for clazz/trait functionality: in case a mixin with function exists, a target class has no such function, but in inheritance chain a function exists, then a dummy function calling "this.base()" has to be provided in the target class to not interrupt the base resolving process. o BUGFIX: Internet Explorer chokes on many characters in the debugger window title, so in IE we finally replace all characters in the title which potentially could lead to problems. o IMPROVEMENT: Update all build-time dependencies. Major changes between ComponentJS 1.2.3 and 1.2.4 ------------------------------------------------- o IMPROVEMENT: As NPM also becomes popular for shipping client-side code, ship ComponentJS under name "componentjs" via both Bower and NPM now. Major changes between ComponentJS 1.2.2 and 1.2.3 ------------------------------------------------- o BUGFIX: fix viewing of "Model" components in the debugger where the model items were not correctly displayed. o IMPROVEMENT: provide platform independent alternative to Unix Makefile by leveraging NPM scripts which have node_modules/.bin/ in PATH Major changes between ComponentJS 1.2.1 and 1.2.2 ------------------------------------------------- o BUGFIX: Once again fix edge cases of the class/trait system and the rather complex resolving of "this.base()" in traits. o BUGFIX: Switch embedded Thenable.js from minified to original version to circumvent JSHint trouble during compilation time. Major changes between ComponentJS 1.2.0 and 1.2.1 ------------------------------------------------- o IMPROVEMENT: Update build-time dependencies and remove the use of the now obsolete Grunt task "grunt-extend-config". o BUGFIX: Fixed "wait" parameter of testdrive#poll() for the case of a passed number instead of a function. o BUGFIX: The resolving order of Clazz/Trait was fixed. o BUGFIX: The traversal of Clazz/Trait on "this.base()" calls was fixed. Major changes between ComponentJS 1.1.1 and 1.2.0 ------------------------------------------------- o INCOMPATIBILITY: Renamed the second argument of state() from "callback" to just "func" to be aligned with all other callback parameters in the API. This is just an incompatibility if state() is called with named parameters, not if state() is called with positional parameters. o ADDITION: Added new parameter "boot" (boolean) to method observe() which allows one to once execute the callback function (and only the callback function and no other callback functions of other observers). o ADDITION: Added new "testdrive" plugin which provides a use-case based suite of tests for test-driving an application through bare state transitions and model manipulations. o ADDITION: Added "noevent" parameter to observe() which (similar to "noevent" on subscribe()) prevents the event to be passed as first argument to the callback function. o ADDITION: Provide internal hooks "ComponentJS:state-enter" and "ComponentJS:state-leave" to plugins. o ADDITION: Method state() now supports the additional optional parameters "min" and "max" for conveniently refining the transition request. o BUGFIX: On .create() enter the first user-defined state (on top of "dead") instead of the hard-coded "created" state. o BUGFIX: Implement the internally published events "ComponentJS:state::enter" and "ComponentJS:state::leave" the way they were documented. o BUGFIX: Prevent errors in debugger in case the subscription is not a string (but perhaps a RegExp) o BUGFIX: Fix debugger's "click on component and show infobox" functionality under Firefox and similar browers (where an Event has no .offsetX/Y but .layerX/Y and .clientX/Y properties). o BUGFIX: fix description of parameter "touch" of method observe(). Major changes between ComponentJS 1.1.0 and 1.1.1 ------------------------------------------------- o BUGFIX: Fixed .base() method for inheritance chaining situations with more than one parent class. o BUGFIX: Fixed the build-time substitution for the ComponentJS version information in the API. Major changes between ComponentJS 1.0.1 and 1.1.0 ------------------------------------------------- o IMPROVEMENT: Allow empty "protos" fields in clazz() and trait() methods. o BUGFIX: Support "@: type" validation notation also in subsetting cases. o IMPROVEMENT: Replaced the HTML API documentation generator component-api.pl (Perl script) with component-api.js (JavaScript script) to have even less external dependencies. o IMPROVEMENT: Major Build Environment Refactoring: switched from plain Unix make(1) to Grunt. o ADDITION: Added (API exposed) utility select() method for selecting values from arbitrary structured object graphs. o ADDITION: Added support for validating a value against a subset of the type specification. o ADDITION: Added support for manipulating and observing arbitrary structured model values. o ADDITION: Added "def" (default value) option to method property() to simplify application code. o INCOMPATIBILITY: Removed API methods "subscription" and "registration" as they are effectively useless for application code and only useful for ComponentJS internals. They should never have been used in any application, as it is not necessary to remember a subscription/registration id and to explicitly check whether it is still active. o INCOMPATIBILITY: Renamed the observe() option "operation" to just "op" as the name "operation" is really too long and we want to also use the more concise "op" for value(), etc. o INCOMPATIBILITY: Rename attribute() option "validate" to "valid" to be more in sync with similar options of other methods. o IMPROVEMENT: For params() use the new validate() functionality (which now also supports RegExp and functions) only. o INCOMPATIBILITY: params() now validates already the default value of a parameter against its validation specification. o INCOMPATIBILITY: renamed the name of the only argument of model() from "model" to "spec" to be in sync with the documentation. This is harmless, because one usually always use the argument in positional variant only. o IMPROVEMENT: Refactored models created by model() into a read-only specification and separate data. This allows forthcoming plugins to directly access the model data more easily. o INCOMPATIBILITY: Remove an undocumented feature: the model() method no longer returns the (old) model and no longer can be called without any arguments (to just retrieve the model). Major changes between ComponentJS 1.0.1 and 1.0.2 ------------------------------------------------- o BUGFIX: Cherry-picked and back-ported all major bugfixes from the ComponentJS development branch. Major changes between ComponentJS 1.0.0 and 1.0.1 ------------------------------------------------- o ADDITION: add an "enabled" state on top of visible for those situations where we want to show a UI but still keep it disabled. o BUGFIX: correctly tear down the component tree in shutdown() as the root component cannot be directly destroyed. o BUGFIX: fix syntax of TypeScript type definition file "component.d.ts". o IMPROVEMENT: document "clazz" behavior better in the API documentation. Major changes between ComponentJS 0.9.9 and 1.0.0 ------------------------------------------------- o INCOMPATIBILITY: Removed the "async" option on register() as it never worked and was a wrong design idea anyway. o INCOMPATIBILITY: On publishing events the "spreading" option no longer defaults to "true" in order to improve performance in standard cases. o IMPROVEMENT: Improve build process: provide a "stage0" target which does not need any special tools beside "perl" and "shtool" in order to allow developers under Windows to participate more easily. o ADDITION: Added "targeting" (boolean) option to plug() / unplug() and this way indirectly fix the semantic of link() in case a target should link onto itself. o ADDITION: Added "scope" (string) option to property() to allow a more convenient way to scope a property instead of the special "name@scope" syntax of the "name" option. o INCOMPATIBILITY: In the debugger, prepend log messages instead of appending them as this is a lot more convenient during debugging. o IMPROVEMENT: Added necessary hooks for companion project "componentjs-tracing", to allow easier instrumentation of ComponentJS based applications. o IMPROVEMENT: Improved and updated TypeScript definition for newer TypeScript 0.9 world order (where "bool" is not "boolean", etc). o BUGFIX: Skip not-enumerable fields and the special fields "constructor" and "prototype" on object/hash validation. o BUGFIX: Fixed internal cloning of Array objects (which is used for the "dynamics" part of cs.clazz!). o IMPROVEMENT: Improve the internal JSON encoder to more correctly detect cycles. o INCOMPATIBILITY: Allow also "null" as an identifier to validate against the special Object null. o INCOMPATIBILITY: Allow application to still enforce standard sockets by skipping the jQuery/ExtJS inference if no 'type' parameter is given. Major changes between ComponentJS 0.9.8 and 0.9.9 ------------------------------------------------- o IMPROVEMENT: Switch code-base to latest JSHint. o IMPROVEMENT: Improve API documentation. o IMPROVEMENT: Reduced the external build-time dependencies. o BUGFIX: Bugfix cs.params() function and add additional hook for plugins to cs.params(). o ADDITION: Provide "this.result" (the current aggregated result) and "this.hooks" (the total number of registered hooks) to the internal hooking mechanism to allow plugins to leverage from more information. o IMPROVEMENT: Reduce the number of redundant internal annotation calls in the central clazz/trait mechanism. o BUGFIX: Cleanup all internal "cs.params()" usages by using either "req" or "def" but never both in parallel (as it makes no sense). o ADDITION: Allow all "spool" parameters to use the syntax ":" in addition to the standard "" in order to use the spool of component, addressed via the relative path "". o BUGFIX: Sockets created with socket()/link() can be not destroyed with unsocket()/unlink() Major changes between ComponentJS 0.9.7 and 0.9.8 ------------------------------------------------- o IMPROVEMENT: Improved Debugger plugin: the components in the component tree view are now clickable. Once clicked details about the component are displayed in the new infobox view which overlays the console view. Additionally, the component tree view now provides a zoom and scroll functionality in order to allow you to display large component trees in a reasonable way, too. o IMPROVEMENT: Modularized the debugger plugin sources. o INCOMPATIBILITY: The localStorage persistence functionality of models is now in a dedicated plugin (component.plugin.localstorage.js) because the localStorage functionality is not available everywhere (e.g. not in NodeJS head-less testing situations, etc). Major changes between ComponentJS 0.9.6 and 0.9.7 ------------------------------------------------- o BUGIX: Fixed internal "clazz" parameter validation. Major changes between ComponentJS 0.9.5 and 0.9.6 ------------------------------------------------- o IMPROVEMENT: Improved Debugger plugin: the status bar is now grabbable to allow you to more precisely control the size of the component tree visual display. The background of the visual display, header and status bar are now gradient based. Active state transition guards are now indicated by partially-overlayed red light bulps (rendered only if guards are not at level 0). o INCOMPATIBILITY: .subscribe({ origin: true, ... }) functionality was removed as the Event object on callbacks has the origin via its .target() method. o BUGFIX: fixed "exclusive" subcription handling. Major changes between ComponentJS 0.9.4 and 0.9.5 ------------------------------------------------- o INCOMPATIBILITY: Replaced the object validation mechanism of cs.params() and cs.model() with a full-blown DSL-based implementation. The most notably changes are that a "null" value now matches the type "object". Upgrade your source: "array(foo)" is now "[foo*]" Major changes between ComponentJS 0.9.3 and 0.9.4 ------------------------------------------------- o INCOMPATIBILITY: The 4th argument (DOCUMENT) for ComponentJS.plugin() is now gone. Plugins should not need it anyway. o ADDITION: Additional internal hooks are provided for plugins. o INCOMPATIBILITY: Model default values are initially validated, too. o INCOMPATIBILITY: The