Upgrade guide
See original GitHub issueJust upgrading my 2.0 app to 3.0 and wanted to document what’s involved for anyone else upgrading.
- Views previously used
choo.view
to construct HTML. Now you should useconst html = require('choo/html')
- Views previously received
(params, state, send)
as params. They now receive(state, prev, send)
- Any references to
params
inside the views should now point tostate.params
- Any references to the current location should now point to
state.location....?
- Effects and subscriptions now have a new parameter,
done
, which should either be explicitly called inside your effect or passed to your finalsend()
call - Effects and subscriptions which call
send()
multiple times should nest them inside the done callback, ie:
send('foo', {...}, () => {
send('bar', {...}, done)
})
- Reducers and effects formerly received a first parameter called
action
. The convention is now to call itdata
(optional of course) - The
data
param passed to reducers and effects does not need to be an object, so you can do things likesend('setTitle', 'New Title')
, which can improve readability
A pretty easy upgrade. The done
business is probably the only confusing part. Of course, this is just what I encountered in my app. I believe @toddself also upgraded an app recently and may have had to do other things.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Upgrade Guide - The PHP Framework For Web Artisans
Upgrade Guide. Upgrading To 8.0 From 7.x. High Impact Changes. Model Factories; Queue retryAfter Method; Queue ...
Read more >Database Upgrade Guide - Oracle Help Center
1 Introduction to Upgrading Oracle Database · Overview of Oracle Database Upgrade Tools and Processes · Definition of Terms Upgrading and Migrating ...
Read more >Upgrade Guide - Tailwind CSS
Upgrade Guide. Upgrading your Tailwind CSS projects from v2 to v3. Tailwind CSS v3.0 is a major update to the framework with a...
Read more >Upgrade Guide - Next.js
Upgrade Guide. Upgrading from 12 to 13. To update to Next.js version 13, run the following command using your preferred package manager:
Read more >Interactive upgrade guide - IBM
Upgrading to version 6.0.5. Select the options that apply to your environment to generate a customized guide to upgrade from a version 5...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Gehe - yeah I think async flow is amongst the hardest compsci things out there; coupled with a half-assed explanation in the docs there’s def no need to feel silly for not getting it straight away - always happy to help! ✨
@yoshuawuyts That makes a ton of sense! Feel silly for not grokking it, seems so obvious now. Thank you for your help and patience!
Creating issue for the model-route thing right away!