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.

2.0.0 Release Checklist

See original GitHub issue

The alpha versions on npm should be code-complete and more or less working.

The git repo though needs to be cleaned up to update to the 2.0.0 version and remove any inconsistencies.

  • The documentation generator script needs to be updated to read the JavaScript sources because the CoffeeScript ones no longer exist. (PR #271)
  • All the examples in the eg/ directory need to update their use of reply() and the other functions that have broken backwards compatibility.
  • Other tickets in the v2.0.0 milestone
  • Documentation for the 2.0.0 migration.
    • A stand-alone Upgrading Guide that details every single way the API has broken backwards compatibility and how to fix it.
    • An introduction to the new features that async/await brings and why users should bother upgrading to v2.

v2.0.0-alpha.5 is now live with all the critical features needed. After some time in the wild I’ll move forward with final releases.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kirslecommented, Jul 4, 2018

For async/await, there was no choice but to break backwards compatibility. To use the await keyword, your function must be an async function, and those always return a Promise (even if you return a string, it wraps it in a Promise automatically).

And so the synchronous reply() function that just returned a string couldn’t exist. The await keyword affects the whole call stack and it’s Promises all the way up.

However, async/await in turn provides all sorts of benefits because now I can await in various places inside the reply and these things will be possible:

  • Using an async object macro in a condition. i.e.,

    // assume the object macro runs an async http request
    // and returns a Promise with "true" or "false"
    + does * exist on wikipedia
    * <call>wikipedia exists "<star>"</call> == true => It does exist.
    - It does not.
    

    In v1.x of RiveScript you can’t have an asynchronous object macro in a condition, because the bot needs the answer now because reply() was a synchronous function that couldn’t wait. And now it can.

    This already works in the v2.0.0-alpha.* versions.

  • It will be possible to swap out the user variable session manager (currently an in-memory JavaScript object) with one backed by Redis or MongoDB or anything else. Like the Python, Go and Java versions of RiveScript.

    • Similarly to the async <call> in conditions, user variables couldn’t be async either. A single call to reply() would set and get user variables many times, sometimes the JavaScript code itself would, but sometimes your RiveScript code as well – think <set name=<formal>><get name>. The reply() function couldn’t wait around for user variables to be stored asynchronously before, and now it can.
    • #268 I intend to have the interface available (to provide your own object to fullfill the session manager functions) for v2.0.0 stable.

So the choices came down to either: delete the reply() function completely, because there’s no way to make it work anymore, or just change it to return a Promise because that’s the only thing it can do now.

0reactions
kirslecommented, Jul 8, 2018

I’ve published v2.0.0-alpha.5 to npm now which adds the User Variable Session Manager interface.

Backwards Incompatible Changes

For the user variables to be async everywhere, all of their functions now have to return Promises.

If you are using these public RiveScript API methods to interact with user variables, these will now return their result as a Promise:

  • setUservar(user, name, value)
  • setUservars(user, data)
  • getUservar(user, name)
  • getUservars([user])
  • clearUservars([user])
  • freezeUservars(user)
  • thawUservars(user, action="thaw")
  • lastMatch(user)
  • initialMatch(user)
  • lastTriggers(user)
  • getUserTopicTriggers(user)
Read more comments on GitHub >

github_iconTop Results From Across the Web

2.0.0 release checklist · Issue #1363 · pika/pika - GitHub
Review all example code (especially in the .rst files); Modernize setup.py; pylint #1371 add pylint and formatting to CI.
Read more >
Release checklist — pysyncgateway 2.0.0 documentation
Release checklist¶. Items to be completed for each release. Given a new version called x.y.z : Create a branch for the new release....
Read more >
Release Checklist - OpenTripPlanner 2
Release Checklist · Make sure the documentation is up to date · Check all links and references to the release and update to...
Read more >
Release checklist — metosin/compojure-api 2.0.0-alpha31 - cljdoc
Release checklist. Are you going to publish a new release of compojure-api? Great! Please use this checklist to ensure that the release is...
Read more >
Releases/Firefox 2.0.0.18/Checklist - MozillaWiki
This is the general release checklist we should use for maintenance releases. ... Something like "Subject:Add 2.0.0.x to stats;Description:Please add ...
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