Skip to content

Releases: torchbox/wagtail-headless-preview

v0.8 - overridable `get_client_root_url` and Wagtail 6

23 Feb 15:52
9be63e5
Compare
Choose a tag to compare

The main change is that get_client_root_url is overridable on your page model inheriting from our mixins. The method takes the request parameter.

What's Changed

New Contributors

Full Changelog: v0.7.0...v0.8

v0.7 - Wagtail 5.1 and 5.2

20 Oct 14:00
2848367
Compare
Choose a tag to compare

This release adds official support for Wagtail 5.1 and 5.2, Python 3.12 (via Wagtail 5.2).

It also switches to using Flit for packaging, and PyPI trusted publishing

What's Changed

New Contributors

Full Changelog: v0.6.0...v0.7.0

v0.6 - Wagtail 4.1+ and internal 📦 tidy ups

08 Jun 11:52
Compare
Choose a tag to compare

This release makes Wagtail 4.1+ only support official.

It also moves to using ruff under the hood

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.6.0

v0.5 - fewer race conditions 🏎 and lighter package 🪶

27 Nov 15:10
Compare
Choose a tag to compare

This release fixes a race condition when creating tokens, thanks to @johncarter-phntm.

It also drops the "live preview" functionality as it was somewhat broken, and with Wagtail 4.0 introducing live preview it just made sense to keep things leaner.

What's Changed

New Contributors

Full Changelog: v0.4.0...v0.5.0

v0.4 - trailing slashes ///

14 Sep 10:53
fbf3f91
Compare
Choose a tag to compare

This is a small maintenance release.

It adds a new ENFORCE_TRAILING_SLASH setting option to control the preview URL behaviour. It defaults to True to match the previous logic where the trailing slash was enforced. Set it to False to respect the URLs defined in CLIENT_URLS

# settings.py

WAGTAIL_HEADLESS_PREVIEW = {
    # ...
    "ENFORCE_TRAILING_SLASH": True,  # set to False in order to disable the trailing slash enforcement
}

⚠️ Support for the deprecated HEADLESS_PREVIEW_CLIENT_URLS and HEADLESS_PREVIEW_LIVE was now removed. You will get a runtime error if you are still using these settings.

What's Changed

  • Add setting for enforcing trailing slash for the preview URL and various other tidy ups by @zerolab in #32

Full Changelog: v0.3.0...v0.4.0

v0.3 - Wagtail 2.15 to 3.0

05 Jun 15:47
Compare
Choose a tag to compare

This is a maintainance release to add support for Wagtail 3.0, and drop support for Wagtail < 2.15.

Thanks @BrianXu20 for the work, and @Tobeyforce for the initial PR

v0.2.1 - deprecated settings not forgotten

01 Feb 22:20
Compare
Choose a tag to compare

This is bug fix for the deprecated settings not picked up correctly. Kudos @Schille for the report 🥷

Check out the full v0.2 changes

v0.2 - zoom, enhance and one setting to rule them all

30 Jan 11:08
Compare
Choose a tag to compare

This release adds a number of useful features such as a default client URL placeholder,
ability to redirect to the front-end URLs when viewing a page in the Wagtail admin, and
an option to redirect the preview to the client URL rather than use the default iframe embed mechanism.

A big change is the move to a single, namespaced settings dictionary - WAGTAIL_HEADLESS_PREVIEW:

WAGTAIL_HEADLESS_PREVIEW = {
    "CLIENT_URLS": {},  # previously HEADLESS_PREVIEW_CLIENTS_URLS
    "LIVE_PREVIEW": False,  # previously HEADLESS_PREVIEW_LIVE
    "SERVE_BASE_URL": None,  # new optional setting for HeadlessServeMixin / HeadlessMixin
    "REDIRECT_ON_PREVIEW": False,  # new optional setting to redirect the preview to the client preview URL
}

We added the HeadlessServeMixin and HeadlessMixin mixins for a fuller headless experience. HeadlessMixin is a combination of HeadlessPreviewMixin and HeadlessServeMixin. The latter changes the Page.serve() method to redirect the page to the front-end URL rather than try to render it. With this, the "View live" buttons in the Wagtail admin are usable again 🥳

Finally, the project structure has changed, with tests moving to the project root and the source code to src/. This should make for smaller packaged releases 🌍

Changelog

Added

  • Add support for a {SITE_ROOT_URL} placeholder in "default" preview client URL (#20) - Thanks @jaap3
  • Add pre-commit support (#21) - @zerolab
  • Add HeadlessMixin and HeadlessServeMixin (#22) - @zerolab based on code from @tbrlpld 🙌
  • Add setting to redirect to the client preview URL (#23) - @zerolab based on real world code from @jaap3 🤘

Changed

  • Move to GitHub Actions (#21)
  • Update test targets, including Python 3.10 and Django 4.0 (#21)
  • Move to a single, namespaced settings dictionary (#24) - @zerolab
  • Updated repository structure for lighter packages (#25)

0.1.4 - The black release

21 Aug 10:57
Compare
Choose a tag to compare

You can have any linter as long as it is black

New

  • Black-ified
  • Added linting step and simplified test matrix

Fixes

  • UNIQUE constraint failed: wagtail_headless_preview_pagepreview.token
  • Static files not packaged
  • Wrong JS file loaded for live preview
  • Wrong token used in live preview.
  • Explicit utf-8 encoding for long description to fix UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 6282: ordinal not in range(128) on some systems when trying to pip install

Live preview

20 Aug 15:22
f9c47cc
Compare
Choose a tag to compare

Adds live preview support.

To enable, set

# settings.py

HEADLESS_PREVIEW_LIVE = True

Note: Your front-end app must be set up for live preview, a feature that usually requires Django Channels or other WebSocket/async libraries.

For an example front-end implementation, see https://github.com/torchbox/wagtail-grapple and its documentation