v8.0.0
π₯ 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:
setDefaults()
(usemixin()
instead: https://sweetalert2.github.io/#mixin)resetDefaults()
(usemixin()
instead: https://sweetalert2.github.io/#mixin)getButtonsWrapper()
(usegetActions()
instead)showValidationError()
(useshowValidationMessage()
instead)resetValidationError()
(useresetValidationMessage()
instead)
π΄ 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
π 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 resolveSwal.fire()
's promise with{}
(novalue
ordismiss
) (#1379)- SASS variables
$swal2-validationerror-*
were renamed to$swal2-validation-message-*
inputValidator
andpreConfirm
should always resolve and never reject- Swal.DismissReason.backdrop is now
'backdrop'
, it was'overlay'
previously for backward compatibility.