[4.0.0] - 2023-07-26
See the release notes and
upgrade guide for details.
Features
- Built-in scroll support
- New hook system for customizing the page load lifecycle
- Context object for controlling the transition process
- Animation scope: add animation classes to html element or to containers
- Easier customization of official themes
- Allow pruning cache entries
Breaking changes
- Hooks replace events:
swup.hooks.on()
- Use the
visit
argument in hooks instead of swup.transition
- Container selectors now only match one single element per selector
- Custom animation attribute renamed to
data-swup-animation
- Swup no longer adds
data-swup
attributes to containers - Navigation method renamed:
swup.navigate()
- Simplified cache API:
cache.set()
- Support for custom payload formats was dropped