Refactor asset and behaviors management away from swap-oob

Created on 4 July 2024, 5 months ago
Updated 19 July 2024, 5 months ago

Problem/Motivation

We replicated the current core pattern by sending the asset json as an additional element to add to dom and then processing it.

Instead we can use HX-Trigger-After-Settle (see https://htmx.org/headers/hx-trigger/) to send the json and trigger it to be processed

Proposed resolution

  1. Improve the code architecture of htmx-assetManagement.js and htmx-drupalBehaviors.js based on prior feedback.
  2. Change HtmxResponseAttachmentsProcessor to add a HX-Trigger-After-Swap header. In the header pass the event htmxDrupalAssetsAttached along with the JSON encoded asset arrays.
  3. Listen for and process the custom event in htmx-assetManagement.js.
πŸ“Œ Task
Status

Fixed

Version

1.2

Component

Drupal Code

Created by

πŸ‡ΊπŸ‡ΈUnited States fathershawn New York

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024