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

common.blocks: prepare for bem-xjst@2.x #1495

Merged
merged 3 commits into from
Jul 24, 2015
Merged

Conversation

indutny
Copy link
Contributor

@indutny indutny commented May 5, 2015

  • Remove match() with inline value
  • Always return when doing applyNext()/applyCtx()

cc @veged

@levonet levonet added the ready label May 5, 2015
delete this._menuItemDisabled;
this.mods.disabled = true;
apply();
return applyNext();
Copy link
Contributor

Choose a reason for hiding this comment

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

здесь точно надо apply менять на applyNext?

Copy link
Member

Choose a reason for hiding this comment

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

@Guria для новой версии bem-xjst нужны такие изменения — по семантике это вполне корректно, просто раньше мы "экономили" applyNext т.к. был кастомный гард про _menuItemDisabled

Copy link
Member

Choose a reason for hiding this comment

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

@veged Но гард все еще оставляем?

Copy link
Member

Choose a reason for hiding this comment

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

@zxqfox да, т.к. он нужен по смыслу

@veged veged force-pushed the feature/prepare-for-bem-xjst-v2 branch 3 times, most recently from 642411f to 6677f82 Compare May 6, 2015 11:18
var checkedOptions = this._checkedOptions,
firstOption = this._firstOption;
if(firstOption && !checkedOptions.length) {
firstOption.checked = true;
checkedOptions = [firstOption];
}
applyNext({ _checkedOption : checkedOptions[0] });
return applyNext({ _checkedOption : checkedOptions[0] });
}),

content()(function() {
Copy link
Member

Choose a reason for hiding this comment

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

when compiled with bem-xjst@2.x, this._checkedOption is undefined in content()() for some reason
// cc @indutny

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How did you test it? Could it be that _checkedOptions was undefined too?

Copy link
Member

Choose a reason for hiding this comment

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

looks like it is defined at https://github.com/bem/bem-components/blob/feature/prepare-for-bem-xjst-v2/common.blocks/select/select.bemhtml#L34 and undefined in block('select').mod('mode', 'radio')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it was present in select.bemhtml? It is especially interesting to see, because this block appears to be present in the one of the desktop.pages, and I have verified that generated html is the same with old and new bem-xjst.

Copy link
Member

Choose a reason for hiding this comment

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

please take a look at https://github.com/tadatuta/select-template-issue-demo
not the very best test case but hope it will help

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tadatuta very interesting!

@veged the situation is following: there are block('select').mod('mode', 'radio') which has higher priority than block('select').def() in the .bemhtml file. When block('select').def() calls applyNext() - it is only invoking the matches in the blocks with lower priority than block('select').def(), skipping the block('select').mod('mode', 'radio').

Looks like our idea about incrementing index and invoking next templates is not as viable as we thought it will be. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tadatuta may I ask you to give a try to the latest bem-xjst 2.x master? It might be fixed by bem/bem-xjst@ee7d1de

Copy link
Member

Choose a reason for hiding this comment

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

yes, this issue is resolved, thanks!

@aristov
Copy link
Contributor

aristov commented May 14, 2015

Is it WIP?

@narqo
Copy link
Member

narqo commented May 28, 2015

@indutny ping!

@indutny
Copy link
Contributor Author

indutny commented May 28, 2015

@narqo I think all issues are resolved now. Feel free to land it if it LGTY

@tadatuta
Copy link
Member

I think we should merge bem/bem-core#1022, release a version and then update dependency. Otherwise there's just no reason.

@indutny
Copy link
Contributor Author

indutny commented May 28, 2015

It doesn't seem like it is blocking this one, or am I missing something?

@tadatuta
Copy link
Member

it's not blocking but it's kinda useless without support in bem-core

@indutny
Copy link
Contributor Author

indutny commented Jul 6, 2015

@tadatuta do we want to merge this, considering that bem/bem-core#1022 was merged?

@tadatuta
Copy link
Member

tadatuta commented Jul 6, 2015

yeah. but looks like rebase is needed.

@aristov
Copy link
Contributor

aristov commented Jul 9, 2015

@indutny rebase and merge, please.

indutny and others added 3 commits July 23, 2015 16:34
* Remove `match()` with inline value
* Always return when doing `applyNext()`/`applyCtx()`
@aristov aristov force-pushed the feature/prepare-for-bem-xjst-v2 branch from 9f81d64 to 7a905fb Compare July 23, 2015 13:35
tadatuta added a commit that referenced this pull request Jul 24, 2015
common.blocks: prepare for bem-xjst@2.x
@tadatuta tadatuta merged commit 2425f87 into v2 Jul 24, 2015
@tadatuta tadatuta removed the ready label Jul 24, 2015
@tadatuta tadatuta deleted the feature/prepare-for-bem-xjst-v2 branch July 24, 2015 20:45
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.

None yet

8 participants