Skip to content

v8.0.0

Compare
Choose a tag to compare
@limonte limonte released this 19 Jan 08:15

πŸ₯‡ This release is delivered because of the awesomeness of these people (ordered a-z): @ACupaJoe, @gverni, @limonte, @toverux, @zenflow

πŸ”΄ Breaking change # 1 - swal(...) -> Swal.fire(...)

- swal({
+ Swal.fire({
  ...
})

Here's why we did that.

πŸ”΄ Breaking change # 2 - Bower support has been discontinued

Bower has been deprecated for almost 2 years bower/bower@0bd318d and since then they recommend using Yarn as a package manager:

...psst! While Bower is maintained, we recommend using Yarn and Webpack or Parcel for front-end projects read how to migrate!

Stick to 7.x if you need Bower support.

πŸ”΄ Breaking change # 3 - Deprecated methods were removed:

πŸ”΄ Breaking change # 4 - Deprecated parameters were removed:

  • extraParams
  • useRejections
  • expectRejections

πŸ”΄ Breaking change # 5 - Android Browser is no longer supported

Stick to 7.x if you need Android Browser 4.4 support.


πŸŽ‰ ES modules support

https://www.pikapkg.com/packages/?q=sweetalert2

image

πŸŽ‰ Swal.update({...})

Now, it's possible to update most of popup instance paramters dynamically:

Swal.update({
  title: 'Oops, something went rwong',
  html: 'Please try again',
  type: 'error'
})

Use Swal.isUpdatableParameter(paramName) to check if a given parameter is updatable.

Other changes

  • Swal.close() will resolve Swal.fire()'s promise with {} (no value or dismiss) (#1379)
  • SASS variables $swal2-validationerror-* were renamed to $swal2-validation-message-*
  • inputValidator and preConfirm should always resolve and never reject
  • Swal.DismissReason.backdrop is now 'backdrop', it was 'overlay' previously for backward compatibility.