-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC 100: Enhancing headless support in Wagtail core #100
base: main
Are you sure you want to change the base?
Conversation
I had to add extra code to get redirects to work in the API - would that be helpful to have included? |
@ahosgood I would assume so? Redirects is a contrib module so not as "core" as some of the more fundamental aspects of the CMS, but certainly something that many sites would consider core CMS functionality. |
I think it would be good to somehow include the pattern for JSON rendering using normal Page routing. Essentially each Page path can have a different request header and then return JSON instead of HTML. It's quite an intuitive approach and aligns with how other CMSs (e.g. Adobe Experience Manager) can provide their APIs. It's not going to make sense for every installation but worth reviewing as part of this RFC. In the abstract, this also could align with applications that may want to build out HTMX style applications, still returning HTML but providing a partial render of 'inner' HTML based on request headers. |
Headless was on the agenda for Wagtail Space NL but this only involved incorporating the areweheadlessyet.org website into the Wagtail documentation. The resulting PR is here: wagtail/wagtail#12039 |
Another long-standing issue with the current API is that we cannot easily generate an OpenAPI specification I would say that we must have a documented or even out of the box way to generate specifications for our APIs if we want to truly say we have headless support. |
3757ef4
to
48d0b14
Compare
Thank you everyone for the feedback! I’ve heavily updated the RFC. Now’s the time for further reviews and feedback (approval?) The RFC now has two well-separated sections:
I’ve also published a 2024 Wagtail headless survey so we get input from a bigger group of developers. Some of you might recall the 2022 survey, which helped us tremendously back then in documenting the current state. Those survey results will help us understand where it’d be most helpful to direct headless support contributions. If you want to help
We’re not big on issue emoji reactions / votes as a way to make decision, but there’s a big corpus of existing tickets here so could be interesting. Here are all open issues sorted by theme: Headless-related existing issues
Last thing, re long-standing issues and schema specifications: At this stage I think we need to move past the No True Scotsman chain of thought, asking ourselves whether Wagtail is truly headless or not. Wagtail is a hybrid system, it’s pretty clear. Some features aren’t headless-compatible, but clearly there’s hundreds if not thousands of headless sites out there built with Wagtail, some pretty high-profile. So yes it’s truly headless. We don’t want to mislead people, so there are gaps to fill (docs in particular), but it’s already a thing and has been for years. |
A frontend client like wagtail-js will make integrating wagtail for many frontend developers easier. |
@itzomen I’m not sure I follow your point, as you shared it, that front-end client already exists? Is there a need for more than one JS client? |
Oh no, I meant the continuous development of a JS client (could be that one or something else) will be a great addition to the efforts to promote the usage of Wagtail as a headless cms. And this is definitely something I will like to provide support with |
Ah yes! that makes a lot of sense :) I just looked at the analytics on our now-retired "Are we headless yet?" website, the most-viewed page was REST API support, so a JS client working with the REST API is a big win. |
View as an HTML document. This RFC attempts to set a direction for Wagtail’s future headless support improvement. It covers:
I’ve also published a 2024 Wagtail headless survey so we get input from a bigger group of developers. Some of you might recall the 2022 survey, which helped us tremendously back then in documenting the current state. Those survey results will help us understand where it’d be most helpful to direct headless support contributions.