Problem/Motivation

This is a planning issue for documenting how to implement equivalent functionality to our existing ajax commands.

We intend to create a developer guide or "cookbook" that shows how to configure HTMX.

Proposed resolution

Link a documentation issue or comment on why it is not needed for each existing command.

Remaining tasks

Complete and close all child issues. See the documentation added for refactoring ReplaceCommand for an example.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

fathershawn created an issue. See original summary.

fathershawn’s picture

Issue summary: View changes
fathershawn’s picture

Issue summary: View changes
fathershawn’s picture

Title: [Meta] Provide operations that replace existing Ajax API commands » [Plan] Provide operations that replace existing Ajax API commands
Issue summary: View changes
fathershawn’s picture

Category: Task » Plan

We are adding these pages under https://www.drupal.org/docs/develop/drupal-apis/htmx/ajax-api-to-htmx. I'm creating the child issues and standing up stub pages.

fathershawn’s picture

Issue summary: View changes
fathershawn’s picture

Title: [Plan] Provide operations that replace existing Ajax API commands » [Plan] Provide guidance for refactoring existing Ajax API commands
fathershawn’s picture

Project: Drupal core » Documentation
Version: 11.x-dev »
Component: ajax system » New documentation
mrebel’s picture

Issue summary: View changes
mrebel’s picture

Issue summary: View changes
mrebel’s picture

Issue summary: View changes
mrebel’s picture

Issue summary: View changes
fathershawn’s picture

@mrebel Even though the implementation is simple, we still need to document these for those unfamiliar with HTMX

HtmlCommand
We will not need this command. Default HTMX behavior (innerHTML) to return the new inner markup.
InsertCommand
We will not need this command. We choose the appropriate swap (beforebegin/afterbegin/beforeend/afterend/outerHTML) and return HTML.

"We will not need" as I understood it would be for commands that we will not provide guidance or documentation for how to replace or refactor its use, such as the CSS/JS commands.

Can you revert your changes and add the documentation?

mrebel’s picture

Issue summary: View changes
mrebel’s picture

Issue summary: View changes
mrebel’s picture

Issue summary: View changes
mrebel’s picture

Issue summary: View changes
mrebel’s picture

@fathershawn Ok, have not seen the link to the ajax-api-to-htmx docs in the first place. Started with insertcommand and still try to figure out how its related, rendered. The htmx docs are pretty good, not sure if we need to replicate always. I can imagine some commands need extended docs on how to in drupal like the AlertCommand.

fathershawn’s picture

Issue summary: View changes
fathershawn’s picture

Issue summary: View changes