Refactor asset aggregation to avoid using deprecated asset optimization classes

Created on 14 November 2023, about 1 year ago
Updated 9 February 2024, 10 months ago

Problem/Motivation

H5P was relying on an implementation detail of core's JavaScript and CSS aggregation - that it would write out files when generating a URL. This no longer happens when the URL is generated but in a system module asset controller.

In 🐛 Drupal 10 compatibility JS aggregation causes js error with aggregation enabled RTBC services using the old, deprecated classes from Drupal 9/10.0 were added to maintain the same as the current behaviour. Instead, the logic should be changed either generate the URL and use the route if possible, or if not to copy some logic from the controller to write it out instead.

In general I wonder if instead of 'faking' libraries, whether dynamic libraries could be created instead, and then the whole logic could use #attached instead of re-implementing parts of Drupal's asset handling.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024