- Issue created by @fathershawn
- Assigned to fathershawn
- πΊπΈUnited States fathershawn New York
Drupal ajax.js has this:
// Allow Drupal to return new JavaScript and CSS files to load without // returning the ones already loaded. // @see \Drupal\Core\StackMiddleWare\AjaxPageState // @see \Drupal\Core\Theme\AjaxBasePageNegotiator // @see \Drupal\Core\Asset\LibraryDependencyResolverInterface::getMinimalRepresentativeSubset() // @see system_js_settings_alter() const pageState = drupalSettings.ajaxPageState; options.data['ajax_page_state[theme]'] = pageState.theme; options.data['ajax_page_state[theme_token]'] = pageState.theme_token; options.data['ajax_page_state[libraries]'] = pageState.libraries;
I think we can use hx-vals on the body tag for this:
The simplest is:hx-vals='js:{"ajax_page_state[libraries]": drupalSettings.ajaxPageState.libraries}'
But it may be more secure to dynamically set this attribute on the body tag via JS before we load HTMX rather than introduce a JS execution path into the DOM
- πΊπΈUnited States fathershawn New York
Since this proposal adds some of our own JS, I've made a commit to the feature branch that moves HTMX JS into a subdirectory, along with the documentation expected by d.o policy.
- Status changed to Needs review
7 months ago 7:33pm 12 April 2024 - πΊπΈUnited States fathershawn New York
All tests and code checks passing
-
FatherShawn β
committed 81236e8a on 1.0.x
Issue #3436841 by FatherShawn: Leverage hx-swap-oob for assets
-
FatherShawn β
committed 81236e8a on 1.0.x
- Status changed to Fixed
7 months ago 1:11pm 24 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.