question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Just 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 use const 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 to state.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 final send() 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 it data (optional of course)
  • The data param passed to reducers and effects does not need to be an object, so you can do things like send('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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
yoshuawuytscommented, Jul 6, 2016

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! ✨

1reaction
krawallercommented, Jul 6, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found