Skip to content
Peyton Gasink edited this page Sep 17, 2021 · 8 revisions

Welcome to the wiki! Here you can find official documentation for Bootstrap Toaster!

Release Notes

Full release notes can be found on the Releases page of the repo, but a summary of breaking changes in each version is below.

Breaking Changes in 5.1.0/4.1.2

  1. There are new interfaces and enums available in the TypeScript code, which are now used as the parameters to the configure, create, setPlacement, setTheme, enableTimers.
    • For regular JavaScript users, simply pass in an object with the same properties as the new interfaces. Once compiled, the enums behave identically to prior versions, so no issues should arise there.
    • To upgrade, either use the interfaces/objects, or use the new temporary shims, oldConfigure, oldCreate, and oldEnableTimers, which have the same signatures as in previous releases. Unfortunately, JavaScript has no concept of method overloads, so this isn't entirely painless.
      • These shims will all be removed in a future version.

Breaking Changes in 5.0.0

  1. As of 5.0.0 this package targets Bootstrap 5 rather than 4.
    • If updating from 4.x, assuming your website is using Bootstrap 5, there are no breaking changes.
    • If updating from 3.x, all breaking changes of 4.x will apply here as well.

Breaking Changes in 4.0.0

This version is designed to back-port improvements made from version 5.0.0 to Bootstrap 4. As such, its features code improvements from that version while maintaining full compatibility with Bootstrap 4. Unlike previous versions, 4 and 5 will both be maintained as current releases.

  1. To better align with Bootstrap's documentation, all references to "position" have been renamed to placement, so a find and replace will be necessary for the following:
    • TOAST_POSITION -> TOAST_PLACEMENT
    • Toast.setPosition -> Toast.setPlacement
  2. When adding many new placement options for toasts, I changed the internal number values of the artificial TOAST_PLACEMENT enum. If you were using those rather than their named equivalents, you will likely need to update your code. If you used the named values, the above find and replace is all you need to update.
  3. Replaced Font Awesome 5 dependency with Bootstrap Icons for toast status icons.
    • For the icons to display, including a link tag for the Bootstrap Icons icon font stylesheet is required. View instructions on the Bootstrap Icons Docs.

Breaking Changes in 3.0.0

  1. This package is now officially named Bootstrap Toaster, and new versions will be published as bootstrap-toaster on npm rather than the previous bootstrap-toast.js. All old versions of the old package will be deprecated on npm.
  2. The CSS and JS files have been renamed to go along with the new package name. You will need to adjust your code as follows:
    • bootstrap-toast.css -> bootstrap-toaster.css
    • bootstrap-toast.js -> bootstrap-toaster.js
  3. Removed the v1 API that was deprecated in v2.