floatdrop / gulp-bem

BEM toolset for gulp
26 stars 2 forks source link

API refactoring #10

Closed floatdrop closed 10 years ago

floatdrop commented 10 years ago

In first stable version API will be significantly changed and simplified. Reasons to do this:

We need to speed up building process for larger projects. Now we query all folder structure under all levels, generating bem-objects, reading *.deps.js files and only then proceeding to build page. This is highly inefficient, if we have big layers, but using small parts of them.

I propose dropping some functions (like objects) and focus on lazy building - read *.deps.js files only when they are needed:

We query for page/index, reading it dependencies and proceeding to fetching dependencies of page/index dependencies, etc...

This will significantly reduce build startup time and make API more understandable.

You can read rework of API in https://github.com/floatdrop/gulp-bem/tree/1.0 branch.

This is not final version of API - we should thinks of ways to customize build process (like resolver functions and stuff).

floatdrop commented 10 years ago

Short progress note: I published 1.0.0-alpha-1 release with implemented new API :dancers:

What seems strange:

noDeps and specifying dependencies of another bem entity will be not implemented - other wise we should read all *.deps.js files before emitting bem entities - it sucks.

You can look at getbem.com/gulp-bem-1.0 branch - as working example.

floatdrop commented 10 years ago

gulp-bem@1.0.1 published