bem / bem-history

BEM wrap for History API
https://bem.info/libs/bem-history/
Other
22 stars 20 forks source link

bem-core v4 #45

Open adinvadim opened 8 years ago

adinvadim commented 8 years ago

Is it possible to use bem-history whith bem-core v4?

tadatuta commented 8 years ago

not yet. actually bem-core v4 is not released yet.

adinvadim commented 8 years ago

Что нужно сделать чтобы перевести на 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

belozer commented 7 years ago

Дополню переписку из 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

tadatuta commented 7 years ago

@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.

veged commented 7 years ago

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

tadatuta commented 7 years ago

Created branch v4 with discussed changes: https://github.com/bem/bem-history/commit/aab34ca3f662f65fc43a1cd1a01f3c0d4c4973b2

Please make review.

// cc @veged

veged commented 7 years ago

looks ok