Rejuvenating vs deprecating Form.Media

Just a quick update on this to say Wagtail now has a clearer path towards adopting the modern standards I mentioned above, in particular import maps and declarative shadow DOM for Web Components. Import maps are now supported in the latest versions of all the browsers we want to support, and our browser support targets will allow us to use the technology in November 2024. Declarative Shadow DOM isn’t supported by Firefox currently but I have hopes it’ll also be available there by November 2024.

We’ve not had planning discussions about this yet, but I think it’s crystal clear those technologies would help us with extensibility of the admin interface and improvements for compatibility with CSPs (which @lbee touched on above). I suspect they’d also help us make Wagtail faster and more energy-efficient (being more clever about what we load in the browser when).

I’d assume they’d be helpful to many more projects in the Django ecosystem, so keen to make it happen not just for Wagtail if people are interested.


With that said, I’m not clear on what’s possible. Even with being aware of those requirements a year ahead of time, it’s still not enough time for us to make the changes and have them be available in the supported versions of Django which we have to support.

As I understand it, if we made changes happen in django/django in time for the v5.1 release code freeze ahead of the final release in August, we’d only be able to rely on them once v4.2 is no longer supported in April 2026 (so almost two years behind schedule for us).

So I suppose the best option would be to create our own API that bridges over compatibility until then? What do people think? Would you want to collaborate on changing this in django/django? Does this feel like it will require a DEP?

1 Like