UPD: To do
Matreshka code and its structure is really outdated. The code contains ugly encapsulations, smelly parts, it's written in ECMAScript 5 and the project uses really old bundler (RequireJS + Grunt). That's why I decided to start everything from scratch and make Matreshka 2 follow modern practices.
You can follow changes on "next" branch.
Features:
- ECMAScript 2015+
- Separated node modules. You can require any part of the framework with no need to require everything.
const bindNode = require('matreshka/bindnode');
- 99% compatibility with apps written with Matreshka 1.
- Test framework both in browser environment and in nodejs environment (using jsdom). This will allow us to use Matreshka on servers.
- Best code practices (at least use everything I've learned these 4 years).
- Commented code.
- High performance (all tricks I know).
- Lint via ESLint, bundle via Webpack.
- Release via semantic-release (so I'm not going to make releases manually and everything will be done automatically).
- No meaningless "rebuild" commits, another repo for browser bundle will be used instead.
- So on.
Breaking changes
Also I'm going to make the framework simpler and get rid of meaningless methods.
MK.delay
,MK#delay
Reason: the method does not do anything useful.
Alternative: setTimeout
(plus Function.prototype.bind
or arrow functions).
MK.define
, MK#define
, MK.defineSetter
, MK#defineSetter
, MK.defineGetter
, MK#defineGetter
Reason: the methods was made to easily modify a property descriptor in IE8
Alternative: since IE8 no longer supported you can use well known Object.defineProperty
and Object.defineProperties
instead.
MK#getAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything
Reason: outdated eastern egg :)
Alternative: no
MK.trim
Reason: unnecessary helper
Alternative: String.prototype.trim
or _.trim
MK.orderBy
Reason: unnecessary helper
Alternative: _.orderBy
MK.noop
Reason: unnecessary helper
Alternative: own noop (eg. const myNoop = () => {}
)
MK.extend
Reason: unnecessary helper
Alternative: Object.assign
, jQuery.extend
, _.assignIn
MK.each
Reason: unnecessary helper
Alternative: jQuery.each
, _.forEach
, for..of
MK.bound
, MK#bound
, MK.$bound
, MK#$bound
Reason: functionality duplication
Alternative: select
, selectAll
(this.selectAll(':bound(a), bound(b)')
) or nodes
and $nodes
.
MK.randomString
Reason: unnecessary helper
Alternative: will be moved to its own project
MK.get
, MK#get
Reason: meaningless method
Alternative: ordinary property access
MK.deepFind
Reason: unnecessary helper
Alternative: no
MK.setProto
Reason: the function is added for experiments and should not be published
Alternative: Object.setPrototypeOf
MK.toArray
Reason: unnecessary helper
Alternative: _.toArray
, array spread
MK.version
Reason: minor feature which is hard to implement
Alternative: no
MK#sandbox
, MK#$sandbox
Reason: misrepresentation and functionality duplication
Alternative: MK#nodes.sandbox
, MK#$nodes.sandbox
MK.Object#toNative
, MK.Object#toObject
, MK.Array#toNative
, MK.Array#toArray
Reason: functionality duplication
Alternative: toJSON
methods will get recursive=true
parameter.
MK.binders.file
, MK.binders.dropFile
, MK.binders.dragOver
Reason: highly specialized binders
Alternative: they will be moved to their own project
MK.Array#each
Reason: functionality duplication
Alternative: MK.Array#forEach
, for..of
MK.Array#hasOwnProperty
Reason: anti pattern, native method override
Alternative: no
MK.Array#useBindingsParser
Reason: bindings parser will be working by default
Alternative: no
MK.Object#hasOwnProperty
Reason: anti pattern, native method override
Alternative: isDataKey
method will be created instead
Class
function will not be global. Instead you'll need to use MK.Class
or make global variable manually (but better to use ES2015 classs instead).
bQuery
will be removed at all (little private library will be used instead for framework needs)
matreshka-magic
will be removed
linkProps
will be renamed to calc
to
will be renamed to toMatreshka
setClassFor
probably will be renamed to instantiate
.
Matreshka.Object#jset
will be renamed to Matreshka.Object#setData
MK#isMK
, MK.Object#isMKObject
, MK.Array#isMKArray
will be renamed to isMatreshka
, isMatreshkaObject
and isMatreshkaArray
useAs$
will be renamed to useDOMLibrary
You'll never see the phrase "a list of keys separated by spaces", only array of keys will be used in methods (eg addDataKeys
).
The roadmap will be published later. I hope you're enjoying Matreshka!