Problem/Motivation

Slack discussion:

longwave Nov 23rd at 7:17 PM
@nod_ do we want to try and upgrade shepherd.js to 11.0.0 for D10? (tagging you because you are listed in https://github.com/shipshapecode/shepherd/blob/master/CHANGELOG.md#v1100...)

maybe too late though as it's a breaking change, not sure

nod_
I think we can try to go for it. it's used only in tour so impact will be limited

catch
I think if we can just do the library update without a lot of changes, then we should go ahead. If it's hard because they've broken stuff... we'd find out.

(https://drupal.slack.com/archives/C1BMUQ9U6/p1669227448852719)

Steps to reproduce

Proposed resolution

I think if we can just do the library update without a lot of changes, then we should go ahead. If it's hard because they've broken stuff... we'd find out.

Remaining tasks

User interface changes

$ yarn-lock-diff -o old.yarn.lock -n yarn.lock
┌──────────────────────────────┬───────────────────┬───────────────────┐
│ package name                 │ old version(s)    │ new version(s)    │
├──────────────────────────────┼───────────────────┼───────────────────┤
│ @popperjs/core               │ 2.11.6            │ -                 │
├──────────────────────────────┼───────────────────┼───────────────────┤
│ smoothscroll-polyfill        │ 0.4.4             │ -                 │
├──────────────────────────────┼───────────────────┼───────────────────┤
│ sheperd.js                   │ 10.0.1            │ 11.0.0            │
├──────────────────────────────┼───────────────────┼───────────────────┤
│ @floating-ui/core            │ -                 │ 1.0.2             │
├──────────────────────────────┼───────────────────┼───────────────────┤
│ @floating-ui/dom             │ -                 │ 1.0.7             │
└──────────────────────────────┴───────────────────┴───────────────────┘

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#3 3323834-3.patch914.24 KBspokje

Comments

Spokje created an issue. See original summary.

spokje’s picture

Assigned: Unassigned » spokje
spokje’s picture

StatusFileSize
new914.24 KB
spokje’s picture

Issue summary: View changes
spokje’s picture

Issue summary: View changes
spokje’s picture

Assigned: spokje » Unassigned
Status: Active » Needs review
spokje’s picture

Hmmm, could it really be this easy?

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Not sure how to best test but the fact you updated and nothing broke is a good thing right?

nod_’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs manual testing

needs someone to try some of our tours

Some code needs to be removed/updated on our end.

smustgrave’s picture

Ah just tested the tour for block layout.

The tour opens but at the bottom and page slowly auto scrolls up. So definitely buggy now.

Reverting patch makes the tour work perfectly again.

effulgentsia’s picture

Although the parent issue is already tagged as a stable release blocker, I think we're now getting close enough to 10.0.0's scheduled release date, that it's time for the individual issues to also be tagged with that.

That said, per the issue title, the scope of this issue is to "try to" do this, so if we get to a point where we feel we sufficiently tried without succeeding, at that time we can bump this to Drupal 11. But it would be nice to succeed with this prior to 10.0.0's release if we can.

bnjmnm’s picture

I did some poking around and my findings have me thankful for the (Try to) qualifier.

The Floating UI equivalent of the PopperJS modifier option is middleware.. This middleware requires args that wrapped are by functions exported by Floating UI. For example, an offset middleware:

import {computePosition, offset} from '@floating-ui/dom';


computePosition(referenceEl, floatingEl, {
  middleware: [offset(10)],
});

Notice how that offset() is imported from '@floating-ui/dom'? Core doesn't have a runtime node_modules to pluck that from, and (as far as I can tell), Shepherd does not expose their Floating UI instance outside of the scope it is used in. It's also not available as window.FloatingUIDOM, which is how CDN supplied Floating UI's are provided. I see two options here:

  1. work with Shepherd to expose their Floating UI instance in the Shepherd object
  2. It looks like we'd either need to work with Shepherd to expose their Floating UI instance, or add Floating UI as a core library and be careful to keep the core and Shepherd Floating UI's on the same version

I don't see either working well for a 10.0 release, but perhaps there's an option 3?

bnjmnm’s picture

Also, if we need to provide true ['drupalSettings']['tourShepherdConfig'] backwards compatibility so there's a deprecation window, this will likely require a complex shim. I think there might be valid arguments for limiting how much that shim covers, though.

effulgentsia’s picture

Title: (Try to) update Sheperd.js to latest version » (Try to) update Sheperd.js to latest major version

Given #12, I think we're too close to Drupal 10's release to do this for Drupal 10. We're already in the RC phase (and pretty far along in it), and it sounds like this can cause non-trivial disruption, even if it's contained to Tour and rogue modules depending on core/internal.shepherd despite "internal" being in the name.

catch’s picture

Let's make this a Drupal 11 blocker, although #12 is not especially encouraging.

effulgentsia’s picture

bnjmnm’s picture

Re: item 1 from #16: Although removing Shepherd is an alternative to keep in mind, the scope of issue mentioned: #3204011: Replace Tour BackboneJS usage with VanillaJS equivalent is an orthogonal concern. That issue is focused on removing Tour's BackboneJS usage which is relatively easy to do but unfortunately would not bring us closer to addressing the issues faced here. It would change how the Shepherd code is invoked, but Shepherd would continue to operate as it currently does.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

anybody’s picture

Status: Needs work » Closed (outdated)

Isn't this outdated now that Tour is a contrib module? #3442286: Deprecate and remove shepherd.js
https://www.drupal.org/node/3442299

Otherwise please reopen!

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

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

Maintainers, please credit people who helped resolve this issue.