-
Notifications
You must be signed in to change notification settings - Fork 987
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
Upgrade re-frame #15963
Comments
Thank you so much for this issue. I'll do some research to find any potential problem and will comment on this issue! |
Excellent @ulisesmac, thanks for that! I just tried to upgrade directly to |
This commit upgrades re-frame to v1.3.0 (latest stable release), released ~9 months ago, in 2022-08-27. This is a solid upgrade, with no breaking changes as far as I tested status-mobile. It's a great testament of re-frame's stability and commitment to backwards compatibility, as are many Clojure libs. Fixes #15963 The big, and truly relevant addition is the introduction of the :fx built-in effect that was added ~3 years ago in Aug/2020 in v1.1.0. Relevant changelog: - Global interceptors are now supported (added in v1.0.0). - reg-event-fx will just warn (not generate an error) if the effect map returned contains an unknown effect key. - re-frame will now warn us when we are calling subscribe outside of a reactive context. - "re-frame now guarantees that a :db effect, if present, will be actioned before any other sibling effects. re-frame continues to provide NO guarantees about the order in which other effects will be actioned." (https://day8.github.io/re-frame/releases/2020/#110-2020-08-24) - There's syntactic sugar for trivial reg-sub declarations (added in v1.3.0). See the documentation for reg-sub for more details https://day8.github.io/re-frame/api-re-frame.core/#reg-sub - "The built-in effect :dispatch-later can now take a single map value. Supplying a sequence of maps is now deprecated in favor of using multiple :dispatch-later effects within the new :fx effect." https://day8.github.io/re-frame/releases/2020/#111-2020-08-26
Problem
The last commit of the re-frame library we use is from Mar 7, 2020, version
0.12
, more than 3 years ago. It's working decently, so why upgrade?re-frame is very stable, but it introduced improvements in 2020 that we're dearly missing. Whatever is in double-quotes below is verbatim text extracted from re-frame's changelog.
:fx
, which allows for effects to be ordered." Mike Thompson explains in more detail the goals and importance of introducing:fx
Ordered Effects day8/re-frame#639 (comment):dispatch
) which means there is no longer any need for special effects like:dispatch-n
. Indeed, all *-n style effects are now redundant. This feature is a stepping stone towards making it easier to create an event handler which is a composition of other functions". See any similarities with our customutils.re-frame/defn
macro andutils.re-frame/merge
function?And then?
Once re-frame is upgraded, I would like to tackle the re-implementation of
rf/defn
andrf/merge
to take advantage of:fx
, and do it in a way that's as compatible as possible with our existing guidelines.Notably, I think it would be possible to come up with a solution that's fully lintable by clj-kondo. Right now we need to code without almost any linter help in event handlers, and this is a cost we should not be paying since every little piece of the puzzle is in our hands. Last time I checked, changing clj-kondo to lint
rf/defn
asdefn
correctly found more than 200 warnings. Not to count the cost of refactoring tools that don't work with our current solution.Limitations?
Do we have any library blocking us from upgrading? cc @flexsurfer, @cammellos, @ulisesmac
The text was updated successfully, but these errors were encountered: