Skip to content

Conversation

blond
Copy link
Member

@blond blond commented Mar 25, 2018

No description provided.

// try-catch optimization
function tryCatch(tryFn, catchFn) {
try {
tryFn();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets test, I think it may not catch async functions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wont' catch throws in callbacks, but will catch async functions afair.

* @param {*} bemConfig
* @returns {Introspection}
*/
module.exports = async (levelPaths, bemConfig, { cache=false } = {}) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDoc doesn't has options and cache description.


const introspect = introspectLevel(levelPath, bemConfig);

levelCache[levelPath] = introspect;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets invert if.
Let save in cache with cache=true, and read always if exists

}
}))
.on('error', reject)
.on('finish', () => resolve(entityMap));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on → once?

* @param {Object} entity
* @returns {Iterator}
*/
*entityFiles(entity) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filesByEntity

"vinyl": "2.1.0"
},
"devDependencies": {
"@bem/sdk.naming.entity.parse": "^0.2.4",
"@bem/sdk.naming.presets": "^0.0.7"
"@bem/sdk.naming.presets": "^0.0.7",
"stream-to-array": "2.3.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

крышечки долой, гринкипер в помощь

Copy link
Contributor

@birhoff birhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А где тесты, хоть один

entityFiles.add(file);
}

opts.introspection = new Introspection(['<level-path>'], [entityMap]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is <level-path> ?

@qfox
Copy link
Member

qfox commented Mar 26, 2018

Судя по тому, что я вижу, просел профицит, надо понять где мы теряем время, это лучше, чем было, но в gulp-bem/gulp-bem-src#23 в 4 раза быстрее.

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

Successfully merging this pull request may close these issues.

3 participants