Assets 2

The documentation for v2 lives there, the branch of the repo is "next".

There are many changes described below but the main change is ideological one: Matreshka.js is now positioned as "framework for beginners". This solution is made watching on whos usually used Matreshka.js for the last few years.

Another big change is that releases will be published right after a fix is made or a feature is added, thanks to semantic-release. That means sometimes you can notice few releases at the same day but this is normal.

The changes

Matreshka is rewritten from scratch and the goals was to

  • Get rid of things that the framework actually doesn't need
  • Increase the performance
  • Get rid of potential memory leaks
  • Split features into small modules
  • Make nice ECMAScript 2015+ code
  • Make f..g huge review of everything

❗️ - breaking change

- unlikely breaking change

Removed things

  1. ❗️ Matreshka.delay
  2. ❗️ Matreshka#delay
  3. ❗️ Matreshka.define
  4. ❗️ Matreshka#define
  5. ❗️ Matreshka.defineSetter
  6. ❗️ Matreshka#defineSetter
  7. ❗️ Matreshka.defineGetter
  8. ❗️ Matreshka#defineGetter
  9. ❗️ Matreshka#getAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything
  10. ❗️ Matreshka.trim
  11. ❗️ Matreshka.orderBy
  12. ❗️ Matreshka.noop
  13. ❗️ Matreshka.extend
  14. ❗️ Matreshka.each
  15. ❗️ Matreshka.bound
  16. ❗️ Matreshka#bound
  17. ❗️ Matreshka.$bound
  18. ❗️ Matreshka#$bound
  19. ❗️ Matreshka.boundAll
  20. ❗️ Matreshka#boundAll
  21. ❗️ Matreshka.randomString (moved there)
  22. ❗️ Matreshka.get
  23. ❗️ Matreshka#get
  24. ❗️ Matreshka.deepFind
  25. ❗️ Matreshka.setProto
  26. ❗️ Matreshka.toArray
  27. ❗️ Matreshka.version
  28. ❗️ Matreshka#sandbox
  29. ❗️ Matreshka#$sandbox
  30. ❗️ Matreshka.Object#toNative
  31. ❗️ Matreshka.Object#toObject
  32. ❗️ Matreshka.Array#toNative
  33. ❗️ Matreshka.Array#toArray
  34. ❗️ Matreshka.binders.file (moved there)
  35. ❗️ Matreshka.binders.dropFile (moved there)
  36. ❗️ Matreshka.binders.dragOver (moved there)
  37. ❗️ Matreshka.Array#each
  38. ❗️ Matreshka.Array#hasOwnProperty
  39. ❗️ Matreshka.Array#useBindingsParser
  40. ❗️ Matreshka.Object#hasOwnProperty
  41. ❗️ window.Class (use `Matreshka.Class`` instead)
  42. ❗️ window.$b, Matreshka.$b
  43. ❗️ Matreshka.$
  44. ❗️ matreshka-magic library
  45. ❗️ Matreshka.binders.innerHTML
  46. ❗️ Matreshka.binders.innerText
  47. ❗️ Matreshka.binders.attribute
  48. ❗️ Matreshka.binders.property

Renamed methods and properties

  1. ❗️ Matreshka#linkProps -> Matreshka#calc
  2. ❗️ Matreshka.to -> Matreshka.toMatreshka
  3. ❗️ Matreshka#setClassFor -> Matreshka#instantiate
  4. Matreshka.Object#jset -> Matreshka.Object#setData (jset still exists)
  5. ❗️ Matreshka#isMK -> Matreshka#isMatreshka
  6. ❗️ Matreshka.Object#isMKObject -> Matreshka.Object#isMatreshkaObject
  7. ❗️ Matreshka.Array#isMKArray -> Matreshka#isMatreshkaArray
  8. ❗️ Matreshka.useAs$ -> Matreshka.useDOMLibrary

Changes in methods bindNode and unbindNode

  1. ❗️ No more { key: [node, binder] } syntax.
  2. ❗️ No more "heap of arguments" syntax.
  3. New syntax ([{key, node, binder, event}], commonEventOptions).
  4. New syntax {key: { node, binder }} and {key: [{ node, binder }]}. (Eureka! It makes us to call bindNode only once per many bindings).
  5. Events bind, bind:KEY are fired once per node.
  6. unbind, unbind:KEY are fired once per node.
  7. useExactBinder event option
  8. ❗️ assignDefaultValue event option is renamed to getValueOnBind
  9. setValueOnBind event option
  10. ❗️ debounce event option is removed
  11. debounceSetValue event option (now true by default)
  12. debounceGetValue event option (now true by default)
  13. debounceSetValueOnBind event option
  14. debounceGetValueOnBind event option
  15. ❗️ exactKey event option instead of deep

For more info check out bindNode and unbindNode

Changes in binders

  1. destroy member for binders.
  2. ❗️ className binder doesn't support "!" syntax anymore, use switcher=false instead.
  3. bindingOptions argument for all binder members (eg getValue(bindingOptions) {...}).

For more info check out bindNode and binders

Changes in parseBindings

  1. The method accepts eventOptions argument
  2. {{things}} are not replaced by span element.
  3. ❗️ The first argument is required.

For more info check out parseBindings

Changes in bindSandbox

  1. It now re-binds sandbox.

For more info check out bindSandbox

Changes in calc (previously called linkProps)

  1. ❗️ debounce event option is renamed to debounceCalc
  2. debounceCalc is true by default
  3. debounceCalcOnInit event option
  4. exactKey event option
  5. ❗️ skipCalc can be used instead of skipLinks can be used in set methd to skip calc handlers
  6. ❗️ No more [inst, key, inst, key] syntax
  7. New syntax { target: {source, event, handler} } (Eureka! It makes us to call calc only once per many definitions).
  8. New syntax [{object, key}].

For more info check out calc

Changes in Matreshka.Array

  1. ❗️ skipMediator event option is renamed to skipItemMediator.
  2. pull method supports only object or number as its argument.
  3. from and of static methods can be inherited.
  4. ❗️ addone event object contains addedItem instead of added.
  5. ❗️ removeone event object contains removedItem instead of removed.
  6. does not wrap renderer with span element.
  7. useBindingsParser property is removed.
  8. ❗️ Bindings parser is enabled by default for renderer.

For more info check out Matreshka.Array, pull, from, of, itemRenderer

Changes in Matreshka.Object

  1. set event is fired when data property was reassigned but not removed.
  2. jset method is renamed to setData (but still exists in the framework)
  3. replaceData event option for setData method.
  4. isDataKey method

For more info check out Matreshka.Object, setData, isDataKey

Changes in Matreshka.Class

  1. Static methods are inherited
  2. Symbols are supported as prototype and static properties/methods

For more info check out Matreshka.Class

Other changes

  1. ❗️ Not allowed to get ot set sandbox for all objects used in the framework.
  2. ❗️ Not allowed to get ot set container for Matreshka.Array instances.
  3. ❗️ "List of the keys separated by spaces" no longer supported in all methods.
  4. Some hidden bugs are fixed
  5. All classes and functions can be imported nicely (eg import text from 'matreshka/binders/text')
  6. Clear errors