Problem/Motivation

HTMX dependency was committed to Drupal 11.2, and is a candidate to replace:

Some ongoing work may cover our needs:

Proposed resolution

Adapt our implementation as the time goes to be compliant with what Core do a remove our specific mechanisms.

Let's not hesitate to participate to the Core effort & discussions.

It will also make our life easier to propose Island plugin addition to Core.

Also, remove dependency HTMX module as soon as the Core addition make it possible ;)

Command icon 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

pdureau created an issue. See original summary.

pdureau’s picture

Title: Follow Core's HTMX integration » [1.0.0-beta1] Follow Core's HTMX integration
pdureau’s picture

Issue summary: View changes
mogtofu33’s picture

pdureau’s picture

Title: [1.0.0-beta1] Follow Core's HTMX integration » Follow Core's HTMX integration
pdureau’s picture

See also: https://www.drupal.org/node/3539472 (For Drupal 11.3)

mogtofu33’s picture

We are close and will probably need to switch to the HTMX in core, but then we will be compatible only with Drupal > 11.3, which is ok for me but some users will be disappointed. IMO to maintain compatibility before 11.3 makes no sense and is a waste of ressources.

As soon as we start this we will be only Drupal 11.x compatible. Unless 11.3 is out, but I think we don't want to wait for that long.

pdureau’s picture

Title: Follow Core's HTMX integration » 11.3 compat: Follow Core's HTMX integration
pdureau’s picture

Title: 11.3 compat: Follow Core's HTMX integration » Follow Core 11.3's HTMX integration
pdureau’s picture

Once #3556198: Minimal requirement is now Drupal 11.3.x is merged, we can resume this task.

I guess we will meet the same issue as in #3544108: Support HTMX 1.5.0 and @ipumpkins may be right:

BTW, Using bareHtmlPageRenderer render html is not required, output render array directly is works now in ApiController.

Because of both:

  • Drupal\Core\Render\MainContent\HtmxRenderer
  • Drupal\Core\EventSubscriber\HtmxContentViewSubscriber

See: https://www.drupal.org/project/display_builder/issues/3544108#comment-16...

pdureau’s picture

Status: Active » Needs work

I have just pushed one "naive" commit, as a starting point. The playwright jobs will not be useful until #3556198: Minimal requirement is now Drupal 11.3.x is merged anyway.

pdureau’s picture

just_like_good_vibes made their first commit to this issue’s fork.

pdureau’s picture

Assigned: Unassigned » just_like_good_vibes

careful, i have rebased the MR.

It works OK for me.

Next steps:

  • fix pipeline KOs
  • check if components or blocks with a specific asset library, when added for the first time in BuilderPanel, have the expected CSS and/or JS in the HTMX resposne

Follow-up: #3536288: HTMX array rationalization

pdureau’s picture

HI Jean, we may need your help. It is hard to guess what is causing the playwright fail in await element.click({ position: { x: 5, y: 10 } })

mogtofu33’s picture

The test failing part is about adding a component and a token in this component slot.
It seems it works for other cases doing the same, so perhaps something else, checking.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned

Here is how to reproduce the problem (it do not occur on 1.0.x), fresh install theme display_builder_theme_test :

  • Create a page layout
  • Add component test simple
  • Move token before the component
  • Try to drag the component, it will fail as it's not draggable

Refresh or edit config anything and it will work. So I guess we just miss the update when something is attached to root.

pdureau’s picture

Assigned: Unassigned » just_like_good_vibes

So I guess we just miss the update when something is attached to root.

It is not related to root because dropping in a slot do the same and we can reproduce this with other sources .

First drop of a source (source_id in the URL query Drag of an existing source (node_id) in the URL query
On root
On a slot

So it seems we have the exact opposite situation as before commit e438d783: instead of blocking the other view panel (BuilderPanel for LayersPanel and the other way around) the drop is blocking the same panel.

Because it is the same panel, it may be related to this mechanism from DisplayBuilderEventsSubscriber::dispatchToIslands():

      // Skip the island triggering the HTMX event. Useful to avoid swapping
      // the content of an island which is already in the expected state.
      // For examples, if we move an instance in Builder, Layers or Tree
      // panels, if we change the settings in InstanceForm.
      // @see Drupal\display_builder\Controller\ApiControllerBase::islandId
      if ($island_id === $event->getCurrentIslandId()) {
        continue;
      }

If I comment it, it works OK.

Mikael, do you want to have a look?

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » pdureau
Status: Needs work » Needs review

please test again with that new add-on :)

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Reviewed & tested by the community

It is OK for me (and all tests are green)

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed 9a1e4d05 on 1.0.x authored by pdureau
    chore: #3529064 Follow Core 11.3's HTMX integration
    
    By: pdureau
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.