Matreshka.js fills the gap between juna and seigneur formed in recent years
A beta of the second version of the framework Matreshka.js has been released. The release will be released in a week (plus a couple of days) after the last patch, the report begins with the release of this post. The version can be considered stable, and the beta status - pure formality, since the project was in prealpha / alpha status for quite a long time and without major changes and was tested in real projects.
Instead of the naive "JavaScript framework for all", Matreshka.js is now positioned as the "Simple June Framework". Let me, instead of duplicating the text from the site, place a link to the text explaining this point in more detail.
const bindNode = require('matreshka/bindnode'); bindNode(object, key, node); Previously, for the release of a new release, we had to perform several repetitive actions:
Therefore, I was in no hurry to make a release if the change corrected the problem, which can be regarded as "minor", but preferred to accumulate a list of changes and release a new version on the weekend (of course, fixes for critical problems came out as soon as possible).
Due to the inclusion of a semantic-release project, the use of Travis CI and other changes (for example, the removal of the Russian-language changelog), releases are made using a very simple scheme.
Moreover, getting new features into the framework itself is unlikely (more on that below), so the last and penultimate paragraphs can be ignored.
After a commit with the fix prefix or feat gets on Github, the following happens:
Do not be surprised if you see several patches made on the same day (I hope that such cases will be rare).
In turn, for any commit to the site repository , Travis will automatically deploy the site to the server using PM2 .
The biggest change was the removal of many functions that were not to the village, not to the city (for example, the trim function).
Why did these functions even exist? The motivation was simple: they were needed for the internal mechanisms of the framework and, if these functions are already there, why not add them to the framework's public API?
As a result, the documentation has become very bloated, which not very pleasantly affected the ease of familiarization with the framework, many useful methods were lost in information noise, and the ability to remove such functions was lost (since this is a breaking change).
Starting from the second version of Matreshka.js includes features specific to the framework itself, but does not include any "common" functions. About the specific reasons for the removal of some methods, I wrote on the forum .
New features, rather, will come out in the form of additional plug-ins and libraries than fall into the framework itself (although the latter is not excluded).
API changes are described below very briefly, so as not to duplicate the text of the documentation.
(!!!) - breaking changes
(!) - breaking changes that most likely will not affect old applications
Matreshka.delayMatreshka#delayMatreshka.defineMatreshka#defineMatreshka.defineSetterMatreshka#defineSetterMatreshka.defineGetterMatreshka#defineGetterMatreshka#getAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverythingMatreshka.trimMatreshka.orderByMatreshka.noopMatreshka.extendMatreshka.eachMatreshka.boundMatreshka#boundMatreshka.$boundMatreshka#$boundMatreshka.boundAllMatreshka#boundAllMatreshka.randomString ( now lives here )Matreshka.getMatreshka#getMatreshka.deepFindMatreshka.setProtoMatreshka.toArrayMatreshka.versionMatreshka#sandboxMatreshka#$sandboxMatreshka.Object#toNativeMatreshka.Object#toObjectMatreshka.Array#toNativeMatreshka.Array#toArrayMatreshka.binders.file ( now lives here )Matreshka.binders.dropFile ( now lives here )Matreshka.binders.dragOver ( now lives here )Matreshka.Array#eachMatreshka.Array#hasOwnPropertyMatreshka.Array#useBindingsParserMatreshka.Object#hasOwnPropertywindow.Class (use Matreshka.Class instead of global variable)window.$b , Matreshka.$bMatreshka.$matreshka-magic libraryMatreshka.binders.innerHTMLMatreshka.binders.innerTextMatreshka.binders.attributeMatreshka.binders.propertyMatreshka#linkProps -> Matreshka#calcMatreshka.to -> Matreshka.toMatreshkaMatreshka#setClassFor -> Matreshka#instantiateMatreshka.Object#jset -> Matreshka.Object#setData ( jset not removed)Matreshka#isMK -> Matreshka#isMatreshkaMatreshka.Object#isMKObject -> Matreshka.Object#isMatreshkaObjectMatreshka.Array#isMKArray -> Matreshka#isMatreshkaArrayMatreshka.useAs$ -> Matreshka.useDOMLibrarybindNode and unbindNode{ key: [node, binder] } no longer supported.([{key, node, binder, event}], commonEventOptions) .{key: { node, binder }} and {key: [{ node, binder }]} . (Eureka! This syntax allows you to beautifully hang many bayindings with a single call to bindNode ).bind , bind:KEY are called on each associated node.unbind , unbind:KEY are called on each untied node.useExactBinder .assignDefaultValue flag has assignDefaultValue renamed to getValueOnBind .setValueOnBind .debounce flag has been removed.debounceSetValue flag.debounceGetValue flag.debounceSetValueOnBind flag.debounceGetValueOnBind flag.debounceGetValueDelay flag.debounceSetValueDelay flag.exactKey flag instead of deep .See the bindNode and unbindNode documentation for details.
destroy .className no longer supports exclamation mark syntax. Instead, you can pass false as the second argument.bindingOptions argument for all binder methods (for example, getValue(bindingOptions) {...} ).See the bindNode and binders documentation for details.
parseBindingseventOptions second argument.{{}} not replaced by the span element.{{ }} .See the parseBindings documentation for details.
bindSandboxSee the bindSandbox documentation for details.
calc method (formerly called linkProps )debounce flag is renamed to debounceCalc .debounceCalc defaults to true .debounceCalcOnInit .exactKey flag.skipLinks flag has skipLinks renamed skipCalc for use in the set method.[inst, key, inst, key] removed.{ target: {source, event, handler} } (Eureka! You can call the calc method once for many properties).[{object, key}] .debounceCalcDelay flag.See the calc documentation for details.
Matreshka.ArrayskipMediator flag has skipMediator renamed to skipItemMediator .pull method supports only objects and numbers.from and of now inherited.addone event addone contains the added object under the addedItem property instead of the added .removeone contains the deleted object under the removedItem property instead of the removed .itemRenderer does not turn into a span if it contains several nodes; instead, an exception is thrown.useBindingsParser property has useBindingsParser removed.includes .find methodfindIndex method.fill method.copyWithin method.keys method.values .entries .For details, refer to the documentation Matreshka.Array , pull , from , of , itemRenderer , METHOD .
Matreshka.Objectset event that is triggered by a change in the properties (but not the deletion) responsible for the data.jset method has jset renamed to setData (at the request of the community, the old name will still be present).replaceData flag for the setData method.isDataKey method.values .entries .For details, see the Matreshka.Object , setData , isDataKey , values , entries documentation.
Matreshka.Classsymbol type names are supported both as prototype properties and as static properties.See the Matreshka.Class documentation for details.
sandbox properties generate an exception for all objects.container generate an exception for Matreshka.Array instances.import text from 'matreshka/binders/text' )for loop instead of calling Object.assign .for loop.Matreshka.randomString ).Matreshka.$b.create ).Thanks for attention!
Source: https://habr.com/ru/post/312274/
All Articles