bem-history
bem-history copied to clipboard
bem-core v4
Is it possible to use bem-history whith bem-core v4?
not yet. actually bem-core v4 is not released yet.
Что нужно сделать чтобы перевести на bem-core v4?
Вот переписка из телеграма
Sergey Berezhnoy, [29 Jul 2016 22:32]: предлагаю uri переименовать в querystring
Sergey Belozyorcev, [29 Jul 2016 22:32]: переименовать history-uri
Sergey Berezhnoy, [29 Jul 2016 22:32]: по смыслу это оно и есть
там просто более сложный объект, чем тот который в bem-core
доопределить модуль из кора
Sergey Belozyorcev, [29 Jul 2016 22:33]: @veged опередил меня)
Sergey Berezhnoy, [29 Jul 2016 22:34]: причём сложить его рядом с parse и stringify
чтобы в итоге получилось { parse, stringify, Uri }
и этот Uri это уже тот класс развесистый, что в bem-history
Дополню переписку из Telegram
Sergey Belozyorcev, [29.07.16 22:40] @adinvadim а другие проблемы всплыли ещё?
Sergey Belozyorcev, [29.07.16 22:50] Не уверен на все 100, взглянул код bem-core@v4 и history/uri. в history/uri используется только метод decodeURIComponent, который предоставляется нам из uri (bem-core@v4).
т.е. нам нужно в зависимости брать { block : ‘uri’ }, а не элемент { block : ‘uri’, elem : 'querystring' }. А дальше доопределять / наследоваться от него
Sergey Berezhnoy, [29.07.16 22:56] @belozyorcev блока uri больше не будет будет блок querystring и тот что в bem-history будет дополнять новым полем Uri тот который в bem-core
@veged, @dfilatov what do you think about https://github.com/bem/bem-history/issues/41?
As we will break backward compatibility anyways, let's implement (use polyfill) standard API instead of our own? Also I think we should merge https://github.com/bem/bem-history/pull/26 in major version.
https://github.com/bem/bem-history/issues/41 looks reasonable
not sure about such major changes in API — maybe better do it in two steps: 1) like what we already do 2) with URLSearchParams
Created branch v4
with discussed changes: https://github.com/bem/bem-history/commit/aab34ca3f662f65fc43a1cd1a01f3c0d4c4973b2
Please make review.
// cc @veged
looks ok