raspiblitz-web icon indicating copy to clipboard operation
raspiblitz-web copied to clipboard

Update react-toastify: 9.0.8 → 9.1.1 (minor)

Open depfu[bot] opened this issue 2 years ago • 0 comments

Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ react-toastify (9.0.8 → 9.1.1) · Repo

Release Notes

9.1.0

Release notes

🚀 Features

  • toast.promise let you type data for each state. This is useful when rendering something based on the response.

For example:

interface Success {
  username: string
}

interface Error { err: string }

toast.promise<Success,Error>(myPromise, { success: { render({ data }) { return data.username; } }, error: { render({ data }) { return data.err; } } })

  • toast.update accepts a generic as well to specify the data type
interface TData {
  username: string
}

toast.update<TData>(id, { data: payload, render({ data }) { return hello <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">data</span><span class="pl-kos">.</span><span class="pl-c1">username</span><span class="pl-kos">}</span></span> } })

🕷 Bugfixes

  • fix progress countdown stops on mobile #580
  • prevent clash with ios native gesture #397
  • fix toast when a word is too long #864
  • fix missing types declarations in exports #843
  • fix toast.done not dismissing toast #853
  • fix cursor when close on click is false #839

🚨 Deprecated API

Added deprecation notice for the API below. They will be removed in the next major release

API Why Alternative
onClick Not used that much, it's increasing the API surface for nothing Can easily be implemented in userland. Just render a react component and attach the handler to it. toast(<div onClick={doSomething}>hello</div>)
onOpen Does not play well with useEffect behavior in react18 (runs twice in dev mode) see #741 A better approach is to use toast.onChange see https://fkhadra.github.io/react-toastify/listen-for-changes/
onClose Does not play well with useEffect behavior in react18 (runs twice in dev mode) see #741 A better approach is to use toast.onChange see https://fkhadra.github.io/react-toastify/listen-for-changes/
toast.POSITION Reduce bundle size :) Thanks to typescript, we now have autocomplete
toast.TYPE Reduce bundle size :) Thanks to typescript, we now have autocomplete

⚙️ Chore

  • bump dependencies
  • refactor internal

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 32 commits:


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

depfu[bot] avatar Nov 03 '22 22:11 depfu[bot]