Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Matreshka 2 #34

Closed
finom opened this issue Jul 30, 2016 · 0 comments
Closed

About Matreshka 2 #34

finom opened this issue Jul 30, 2016 · 0 comments

Comments

@finom
Copy link
Owner

finom commented Jul 30, 2016

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!

@finom finom changed the title Matreshka 2 About Matreshka 2 Jul 30, 2016
@finom finom closed this as completed Jul 30, 2016
@finom finom mentioned this issue Jul 31, 2016
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant