Problem/Motivation
A new add_js command was added to core 9.5 by #1988968: Drupal.ajax does not guarantee that "add new JS file to page" commands have finished before calling said JS, and add_css may be updated to a CSP-compatible implementation (although with a fallback until 11.0) in 10.1 #3110517: Improve Drupal\Core\Ajax\AddCssCommand to accept an array of CSS assets
Instead of the current custom implementation (that combines css and js into a single asset response), the module should backport the commands as necessary instead.
Proposed resolution
Update module classes & javascript to backport core code when necessary
Remaining tasks
API changes
Issue fork csp-3323011
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
gappleModule compatibility bumped to
^9.5 || ^10so that we can take advantage of core'sadd_jscommand and theloadjslibrary added in 9.5, and only backport the necessary code foradd_cssfrom 10.1.On 10.1+, CSP Extras is just a no-op, and adds a warning to the status page notifying that it can be uninstalled.
Comment #4
gappleComment #6
gapple