Repository navigation
v2.0.0-alpha.0
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
- ❗
Matreshka.delay - ❗
Matreshka#delay - ❗
Matreshka.define - ❗
Matreshka#define - ❗
Matreshka.defineSetter - ❗
Matreshka#defineSetter - ❗
Matreshka.defineGetter - ❗
Matreshka#defineGetter - ❗
Matreshka#getAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything - ❗
Matreshka.trim - ❗
Matreshka.orderBy - ❗
Matreshka.noop - ❗
Matreshka.extend - ❗
Matreshka.each - ❗
Matreshka.bound - ❗
Matreshka#bound - ❗
Matreshka.$bound - ❗
Matreshka#$bound - ❗
Matreshka.boundAll - ❗
Matreshka#boundAll - ❗
Matreshka.randomString(moved there) - ❗
Matreshka.get - ❗
Matreshka#get - ❗
Matreshka.deepFind - ❗
Matreshka.setProto - ❗
Matreshka.toArray - ❗
Matreshka.version - ❗
Matreshka#sandbox - ❗
Matreshka#$sandbox - ❗
Matreshka.Object#toNative - ❗
Matreshka.Object#toObject - ❗
Matreshka.Array#toNative - ❗
Matreshka.Array#toArray - ❗
Matreshka.binders.file(moved there) - ❗
Matreshka.binders.dropFile(moved there) - ❗
Matreshka.binders.dragOver(moved there) - ❗
Matreshka.Array#each - ❗
Matreshka.Array#hasOwnProperty - ❗
Matreshka.Array#useBindingsParser - ❗
Matreshka.Object#hasOwnProperty - ❗
window.Class(use `Matreshka.Class`` instead) - ❗
window.$b,Matreshka.$b - ❗
Matreshka.$ - ❗
matreshka-magiclibrary - ❗
Matreshka.binders.innerHTML - ❗
Matreshka.binders.innerText - ❗
Matreshka.binders.attribute - ❗
Matreshka.binders.property
Renamed methods and properties
- ❗
Matreshka#linkProps->Matreshka#calc - ❗
Matreshka.to->Matreshka.toMatreshka - ❗
Matreshka#setClassFor->Matreshka#instantiate Matreshka.Object#jset->Matreshka.Object#setData(jsetstill exists)- ❗
Matreshka#isMK->Matreshka#isMatreshka - ❗
Matreshka.Object#isMKObject->Matreshka.Object#isMatreshkaObject - ❗
Matreshka.Array#isMKArray->Matreshka#isMatreshkaArray - ❗
Matreshka.useAs$->Matreshka.useDOMLibrary
Changes in methods bindNode and unbindNode
- ❗ No more
{ key: [node, binder] }syntax. - ❗ No more "heap of arguments" syntax.
- New syntax
([{key, node, binder, event}], commonEventOptions). - New syntax
{key: { node, binder }}and{key: [{ node, binder }]}. (Eureka! It makes us to callbindNodeonly once per many bindings). - ❕ Events
bind,bind:KEYare fired once per node. - ❕
unbind,unbind:KEYare fired once per node. useExactBinderevent option- ❗
assignDefaultValueevent option is renamed togetValueOnBind setValueOnBindevent option- ❗
debounceevent option is removed - ❕
debounceSetValueevent option (now true by default) - ❕
debounceGetValueevent option (now true by default) debounceSetValueOnBindevent optiondebounceGetValueOnBindevent option- ❗
exactKeyevent option instead ofdeep
For more info check out bindNode and unbindNode
Changes in binders
destroymember for binders.- ❗
classNamebinder doesn't support "!" syntax anymore, useswitcher=falseinstead. bindingOptionsargument for all binder members (eggetValue(bindingOptions) {...}).
For more info check out bindNode and binders
Changes in parseBindings
- The method accepts
eventOptionsargument {{things}}are not replaced byspanelement.- ❗ The first argument is required.
For more info check out parseBindings
Changes in bindSandbox
- It now re-binds sandbox.
For more info check out bindSandbox
Changes in calc (previously called linkProps)
- ❗
debounceevent option is renamed todebounceCalc - ❕
debounceCalcis true by default debounceCalcOnInitevent optionexactKeyevent option- ❗
skipCalccan be used instead ofskipLinkscan be used insetmethd to skipcalchandlers - ❗ No more
[inst, key, inst, key]syntax - New syntax
{ target: {source, event, handler} }(Eureka! It makes us to callcalconly once per many definitions). - New syntax
[{object, key}].
For more info check out calc
Changes in Matreshka.Array
- ❗
skipMediatorevent option is renamed toskipItemMediator. - ❕
pullmethod supports only object or number as its argument. fromandofstatic methods can be inherited.- ❗
addoneevent object containsaddedIteminstead ofadded. - ❗
removeoneevent object containsremovedIteminstead ofremoved. - ❕ does not wrap renderer with
spanelement. useBindingsParserproperty is removed.- ❗ Bindings parser is enabled by default for renderer.
For more info check out Matreshka.Array, pull, from, of, itemRenderer
Changes in Matreshka.Object
setevent is fired when data property was reassigned but not removed.jsetmethod is renamed tosetData(but still exists in the framework)replaceDataevent option forsetDatamethod.isDataKeymethod
For more info check out Matreshka.Object, setData, isDataKey
Changes in Matreshka.Class
- Static methods are inherited
- Symbols are supported as prototype and static properties/methods
For more info check out Matreshka.Class
Other changes
- ❗ Not allowed to get ot set
sandboxfor all objects used in the framework. - ❗ Not allowed to get ot set
containerforMatreshka.Arrayinstances. - ❗ "List of the keys separated by spaces" no longer supported in all methods.
- Some hidden bugs are fixed
- All classes and functions can be imported nicely (eg
import text from 'matreshka/binders/text') - Clear errors