Problem/Motivation
jQuery Joyride was added to support tours. It is used in a Views tour and a welcome tour in Umami. However Joyride has not been maintained for the last 2 years. See https://zurb.com/playground/jquery-joyride-feature-tour-plugin and commit history at https://github.com/zurb/joyride
Proposed resolution
- Replace joyride with Shepherd.
- Refactor Tour JavaScript to work with the Shepherd API instead of Joyride's
- Deprecate tour config properties and Tour tip plugin methods specific to joyride that won't work with Shepherd
- Trigger E_USER_WARNING warnings when deprecated Tour tip methods are called directly to encourage changing these as soon as possible. These methods will still be available with BC support for common use cases, but it ma not be possible to cover every use case due to the extensibility of tip plugins.
- Provide an update hook that converts deprecated tour config properties to Shepherd-compatible ones.
- Refactor Tour Tip plugin and view builder PHP to work with Shepherd config, as well as Backwards compatibility support for plugins configured for Joyride
- Provide JavaScript in Stable/Stable9 that rebuilds Shepherd tip markup to the markup provided by Joyride.
Shepherd Dependency evaluation (see #58)
Dependency evaluation reply from Shepherd maintainer
Maintainership of the package
The package is managed by Ship Shape Consulting, and features 80 contributors with 302 applications on GitHub marked as direct dependencies of shepherd.
- https://github.com/shipshapecode/shepherd/graphs/contributors
- https://github.com/shipshapecode/shepherd/network/dependents?package_id=...
It features the use of automated dependency management and has no security advisories active. It features a wealth of commits and has been recently committed to by varying contributors - not only dependabot.
Security policies of the package
Packages with security vulnerabilities are publicly disclosed via the built-in vetting functionality provided by GitHub, and the management of those dependencies is automated with the use of Dependabot. The commit history shows there's a significant amount of this work happened and without issue.
Expected release and support cycles
Releases are infrequent but they consistently have occurred at least once every couple of months throughout the current year (2020). Release notes however are a little inconsistent - as some lack detail. 2021 Update - minor releases have been updated roughly once a month this year, and have good notes and links to docs and issues.
https://github.com/shipshapecode/shepherd/releases
Code quality
shepherd features the use of many open source static analysis tools in its workflow and uses CI as part of development workflow. With the security measures and tools in place to secure the analysis of the code quality and security - not limited to maintainability rating scores and code coverage tests. shepherd appears to be a very good library if it's fit for purpose.
Remaining tasks
Implement proposed resolutionAdd tons of test coverageAdd dependency evaluationget release manager sign-offReview the MR and address remaining feedbackUpdate issue summary with API changes and release noteUpdate change records
User interface changes
Tour tips now appear as true modals. When open, the rest of the page is not intractable, and keyboard focus is trapped within the modal. The non-interactable area is masked.
Shepherd pointing to the horizontal center of the element they are associated with. This is different from Joyride, which defaults to pointing to the left side
API changes
TipPluginInterface::getOutput() is deprecated
TipPluginInterface::getAttributes() is deprecated
New TourTipPluginInterface should be implemented by existing plugins
Full BC and deprecation warnings are in place.
Data model changes
Deprecated the attributes key of the tour schema.
New selector key added to the tour schema.
Release notes snippet
The tour module previously depended on jQuery Joyride. Joyride is now replaced with Shepherd.
Thecore/jquery.joyrideis now deprecated andcore/shepherdis added. Tour config has changed, it no longer usesattributeswith adata-idordata-classto indicate a target element for the tour. Theselectorproperty is used instead.
A BC layer is provided so that existing tours will still function, and any themes which use Stable or Stable9 as a base will have consistent markup for the Tour so that no theming changes should be necessary.
| Comment | File | Size | Author |
|---|---|---|---|
| #93 | tour-wildwest.png | 20.24 KB | zrpnr |
| #93 | tour-stable.png | 16.98 KB | zrpnr |
| #93 | tour-bartik.png | 17.05 KB | zrpnr |
| #93 | tour-seven.png | 34.93 KB | zrpnr |
| #93 | tour-claro.png | 34.4 KB | zrpnr |
Issue fork drupal-3051766
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
Comment #2
wim leersContrib modules also use it. At least https://www.drupal.org/project/cdn does :)
Comment #3
baluertlRight at the very beginning of this issue thread, I do feel that two questions were asked:
A) Relying on Joyride JS-library or seek another one?
I'm not eligible to form an opinion on that.
B) Keeping the Tour functionality in Drupal core?
I vote a heartful +1 to support keeping Tour module in Drupal core as it has a great (yet underused, indeed) added value for those in the audience we'll try to engage better: sitebuilders.
Comment #4
andypostIt still mentioned many times in help topics issue #2920309: Add experimental module for Help Topics as better approach to help
Comment #5
rachel_norfolkOh no! We were literally talking yesterday about the Tour functionality in core being key to the "Try Drupal" refresh on Drupal.org!!
Being able to guide people around a new demo install is super useful. Would be a great shame to lose it but I also appreciate that the library in question does need support for that to be safe.
Comment #6
andrewmacpherson commentedTour module has a lot of accessibility problems. Not all of them are Joyride's fault, but linking the related issue.
Comment #7
finnsky commentedComment #8
finnsky commentedHello all!
Added quick implementation of https://github.com/shipshapecode/shepherd
which seems me good alternative of Joyride.
DEMO: https://shepherdjs.dev/demo/
Looks pretty accessible and configurable out of box.
This patch is just for tests. But mostly api and configs should be same.
Use default umami profile installation for tests with drush for example:
`drush si demo_umami`
Comment #9
claudiu.cristeaCould please look alo into this? Now the tour is hard coupled with the toolbar: #3012027: Decouple tour triggering from the toolbar.
Comment #10
wim leersGreat research and PoC, @finnsky! That's looking very promising indeed. I'd love to see this fleshed out further.
tour.js, but I'm sure you knew about that :)(Fixed two nits in the patch: Joyride was still being injected and was not yet deprecated.)
Comment #11
finnsky commentedComment #12
finnsky commented@Wim Leers i see much more abilities to optimise tour here.
https://github.com/zurb/joyride#usage Joyride required tour source to be in html list on page. But shepherd dont. we can change backend of module to send simple js object with tour items in drupalSettings. So maybe we need to rework it?
Comment #13
wim leersThat HTML list is just an implementation detail and not an API, so I think it's definitely reasonable to rework this 👍 Thanks for taking this on!
Comment #14
andypostStoring tours in
drupalSettingsis bad idea, because it syncs with every ajax requiest.@finnsky Tours are markup and conversion of it to JSON looks useless browser operation
Comment #15
andypostAlso the related issue could change how tours could be found
Comment #16
wim leersHuh?
drupalSettings.ajaxPageStatedoes, not all ofdrupalSettings. Or what am I missing?Comment #17
finnsky commented@andypost thanks for review
1) get tour items from js object cheaper than search html list it on page/parse attributes/and render as tour items again.
https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/tour/j...
2) On shepherd side we need js object. Not markup. Example from specs:
3) We may use something like Drupal.TourNotRefresheableOnEveryAjaxRequest. I'm sure can be way
4) Shepherd has pretty nice default markup. We should reuse it. So current backend should be changed anyway. Right now it adds Title/Text/Pagination in predefined tags, which we will need to parse on js before send it to shepherd.
Default shepherd markup


Current tour module list.
So API will be same. Tours will be attached in same way https://www.drupal.org/docs/8/api/tour-api/overview#content-tour-yaml-do...
As @Wim Leers mentioned it will be change only implementation in module.
Comment #18
finnsky commentedComment #19
finnsky commented1) updated shepherd to 5.0.0 to disable default shepherd styles https://github.com/shipshapecode/shepherd/pull/526
2) Moved tour items to drupalSettings. Backenders help definetly needed.
3) Updated js according.
4) Updated part of css.
5) Enabled partial background shadow in shepherd. Looks nice imo. Browsers tests needed.
6) Tested a11y. On gif attached i used tabs only :)
TODO:
1) Manage js logic in case of query in url http://example.com/foo?tour=1&tips=bar
2) Manage data attributes.
3) Update css in module, stable theme, and in umami installation profile.
4) Update functional tests. Here should be same problems as in https://www.drupal.org/project/drupal/issues/3074267#comment-13232996
Comment #20
finnsky commentedComment #21
wim leersWow, that auto-highlighting feature is excellent! That was often lacking in existing tour integrations.
I'm not sure it is equally clear for low vision users though. This will need accessibility review. I see you already tested as a keyboard-only user for the GIF in #20 — that's already an excellent piece of validation, thanks! :)
Comment #23
wim leersIt'd be great to fix those last 4 failures while we wait for accessibility review :)
Comment #24
oleksiyUpdated a bit backend part + little changes to js.
Comment #25
oleksiySorry, missed to add library in patch
Comment #26
finnsky commentedComment #27
finnsky commentedComment #28
oleksiyTried to fix the failures.
Comment #29
rachel_norfolkQuick review of #28 on Safari 12.1.2:
Comment #30
wim leersJust one more failing test to fix!
Comment #31
oleksiyComment #32
oleksiyComment #33
wim leersYay, this is green now! Well done, @Oleksiy! 👏
@Oleksiy Do you think you could also address @rachel_norfolk's feedback in #29?
Although I think this already addressed her point 4 :)
Comment #34
rachel_norfolkAlso worth taking a look in places that might still need some JoyRide artefacts pulling out?
Places I think look like candidates:
Comment #35
oleksiyThanks, @Wim Leers
Yes. It seems related to the point 4.
Comment #36
wim leers#34 All good feedback! Only point 6 is not quite true: we can't remove an asset library, we can only deprecate it. Removing it would be a backwards compatibility break.
Deprecating asset libraries is possible since about two months, see https://www.drupal.org/node/3064022 :)
Comment #37
rachel_norfolkAh that is a good point about deprecation (though it does remind me we *really* need to declare what is a public and what is a private api, so we can replace the implementation without changing the public interface of the tour module!)
It might mean that 2,3,5 and 6 should all remain ( as "part of the library") ?
Comment #39
jungleRerolled from #32 and made a small change below.
included version is 5.0.0
in lib, it's 4.6.0
So changed 4.6.0 to 5.0.0
Comment #40
jungleChanged the library version to 7.0.1
As https://github.com/shipshapecode/shepherd/releases/tag/v7.0.1 was released, let's work on the new version if it's ok. But:
See https://github.com/shipshapecode/shepherd#ie-11
Comment #41
bnjmnmUpdated issue summary to document @todo items referencing this issue.
Also regarding #40. First, good catch! One of the three polyfills needed -
Object.assignis already part of coredrupal.object.assign, but I'm setting this to needs work to add the two additional ones needed,Symbolandelement.matchesand to make them dependencies of core/shepherd. For reference, polyfills were recently added as part of a library update in this issue: #3108402: Update to Popper.js to 2.0.0Also wanted to make sure shepherdjs meets the criteria here: https://www.drupal.org/core/dependencies#criteria, I may have missed this in the issue but wanted to mention just in case as it would be unfortunate if all this effort was directed towards it only to discover it didn't meet the criteria necessary to be included in core.
Comment #42
catchTagging for Drupal 10 since this is one of about two ways we can replace our jquery cookie shim (the other would be relying on joyride's fallback behaviour).
Comment #43
finnsky commentedcurrent patch is broken. since ol#tour was removed and some code still expect it. gonna fix.
Comment #44
finnsky commentedReworked patch.
1) Added `Shepherd` in eslint globals
2) Updated library to 7.0.4
3) Updated css for module, stable, claro and umami
4) Fixed js.
Now all previous features work. Like:
Removed jQuery where it is possible.
Current results:
Seven:

Claro:
Umami:
We need to update specs and tests. Patch is mostly ok.
Comment #46
finnsky commentedComment #47
finnsky commentedHi all!
1) Fixed coding standard messages.
2) Managed focus states for all themes.
3) Removed `console.log`. Sorry:)
4) Fixed tests
5) Moved tour.theme.css to /theme dir for claro
Patch became ready to implement now. Please review.
Comment #50
oleksiyThe tests still need work
Comment #51
oleksiyComment #52
oleksiyComment #53
oleksiyFixed TourViewBuilder and tests.
(Sorry, for the empty comments above. There was some issue with the comment submit)
Comment #54
vacho commentedPatch #53 rerolled.
Comment #55
vacho commentedAfter a test, I found all right execpt by one issue.
At the home screen of unamy profile, the first tour message has a bad space at the right.
Comment #56
vacho commentedComment #58
fubarhouse commentedIn evaluation for the use of `shepherd`, I'd like to throw my evaluation for the use against Drupal's Criteria for adding dependencies.
Maintainership of the package
The package is managed by Ember Consulting, and features 79 contributors with 200 applications on GitHub marked as direct dependencies of `shepherd`. It features the use of automated dependency management and has no security advisories active. It features a wealth of commits and has been recently committed to by varying contributors - not only dependabot.
Security policies of the package
Packages with security vulnerabilities are publicly disclosed via the built-in vetting functionality provided by GitHub, and the management of those dependencies is automated with the use of Dependabot. The commit history shows there's a significant amount of this work happened and without issue.
Expected release and support cycles
Releases are infrequent but they consistently have occurred at least once every couple of months throughout the current year (2020). Release notes however are a little inconsistent - as some lack detail.
Code quality
`shepherd` features the use of many open source static analysis tools in its workflow and uses CI as part of development workflow. With the security measures and tools in place to secure the analysis of the code quality and security - not limited to maintainability rating scores and code coverage tests. `shepherd` appears to be a very good library if it's fit for purpose.
Comment #59
larowlanComment #60
bnjmnmThis
<button>element instead of<a>. I'd want to spend a bit more time with it before granting an accessibility signoff, but this is promising.Comment #61
nod_That looks great! love the highlight of the element. Just a few details:
We have a polyfill for that
core/drupal.nodelist.foreach, also feels like a no-jquery once? if that's the case I wouldn't change it here at the moment.Can we put the default settings at the top of this file? not a fan of putting a whole bunch of configuration values in the middle of code logic, makes it easier to find as well if people want to change it somehow.
do we still need this method?
Comment #62
bnjmnm#61.1 Looks like that was trying to get around using once(), so I agree that should be switched back and taken care of in #3183149: Deprecate jquery.once and use the new once lib
#61.2
This could be seen as out of scope as the existing joyride tour accepts config in this manner, but this also seems like a potentially useful non-risky change so I've added it in the initialization of tour's JS settings in
\Drupal\tour\TourViewBuilder#61.3 May technically be out of scope too, but looks like
_getDocument()hasn't been needed for ~7 years #2088121: Remove Overlay and seems like a reasonable thing to address as it's incorporated into code blocks we're already refactoring.Comment #63
xjmComment #64
bnjmnmThis provides a reroll, addresses several things caught by the new custom commands on DrupalCI, and a few other small fixes.
I also did an accessibility review and compared it against the many accessibility bugs found in the Joyride implementation: #2961001: [META] Improve accessibility of tour module
Here's a list of accessibility issues with the Joyride implementation that are fixed with the Shepherd implementation here:
Joyride accessibilty issues that are fixed here
I tested with browser Zoom and there it's not always ideal at higher magnifications when the tourtip text is longer. This is also a problem with Joyride, but the symptoms are different with Shepherd.

Shepherd: The tip may overlap the content it's highlighting
Scrolling will align it, however
Joyride: the tip may not be fully in view

Similar to Shepherd, scrolling will get these to a good place.
While zoom isn't perfect with Shepherd, it does not appear to be a step down from Joyride.
While Shepherd seems to address all accessibility "bugs" There are still some good suggestions in #2961001: [META] Improve accessibility of tour module, but are better categorized as improvements. That issue should get updated when this one is committed.
Comment #65
nod_Any reason why this moved from toggle to initialize? I think the idea was that the page can be dynamic and the moment the tour is triggered, some items could have gone missing.
here $tour is the settings right? should be tourSettings or something.
any chances we can use something more meaningful than
#wrapper_attribute? it's too render-array-y.Putting that in the PHP could be good, what I meant was to put that at the top of the tour.es6.js file, so that it's not mixed with the initialization logic.
I don't think there is a lot of value to make it go through drupalSettings.
with this we're not using the DOM anymore to check for elements, it's only checking that a value is in an array.
I'm ok with it, just that the test is very different.
Comment #66
bnjmnm#65.1
It looks like it was removed from toggle in #24 and I'm not sure why. I agree with the reasoning that this should be in toggle, so I've returned it there.
#65.2
Improved the variable naming
#65.3 This has been changed as the use of
#wrapper_attributeswas for joyride, which required an already-rendered HTML list. After making these changes I realized it may be a BC break as custom/contrib may be attempting to override this property. I'm leaving the changes in for now as this will likely require some discussion and that will make the discussion easier. The tour is not rendered as an HTML list, so there are some definite differences already occurring. I find @lauriii is quite helpful when I'm trying to figure out acceptable levels of BC changes#65.4
My thought is that the tour items are already configured via tourSettings, so it would be structurally consistent to approach global tour config the same way. It's not a particularly strong opinion, though.
#65.5
These tests were added well before I started working on the issue, but the comment motivated me to look at the tests a little closer. My takeaway is similar, it's quite different but the changes seem like a good way to adjust to the new library. It's quite possible tests written from scratch would be structured quite differently, but I'm glad so much of the existing test code still works.
Comment #67
bnjmnmFixing a stray keystroke that got into the patch in #66
Comment #69
bnjmnm#67 addressed an issue that allowed tests to run, and once the tests run there were failures due to #wrapper-attributes being removed since tips are no longer a render array. This suggests it may be necessary to keep that property for BC purposes. I'll look into that further.
Comment #70
lauriiiWe should update docs in
Drupal\tour\TipPluginInterfacegiven that the expected return value has changed. However, the fact that we have to make changes to an interface points out that this is a BC breaking change.Given that the name of the method name is
::getOutput, it seems that it would be better to split this method into three different methods for each of the array items (to not have to deal with arrays). I'm not sure what to do with the current method given that it would have to be deprecated.Adding a reminder for myself to check all of the potential impacts of this change later.
The fact that we have to make this many changes in Stable suggests that this patch is introducing BC breaking changes for markup. Is there way for us to revert those changes in Stable?
Comment #71
bnjmnmRegarding the TipPlugin BC concerns from #70 #70, I've thought of a potential approach.
Given that:
Tip Plugins extend
TipPluginBase.TipPluginBaseimplementsTipPluginInterfacegetOutput()method inTipPluginInterface.TipPluginShepardCompatibleInterfacewith new Shepard-specific methods. This interface would be implemented by individual plugin definitions, notTipPluginBaseTipPluginText, would implementTipPluginShepardCompatibleInterfaceTourViewBuilderwould build tips differently if the tip wasinstanceof TipPluginShepardCompatibleInterfaceTipPluginBasewould implement TheTipPluginShepardCompatibleInterfacein addition toTipPluginInterfaceComment #72
larowlanI think #71 sounds like a great approach, but note we have the 1:1 rule here, so we could do 5 now, with a best-intentions approach by putting 4 inside the base plugin as a bridge
Comment #73
bnjmnm@tim.plunkett suggested adding a new
getConfiguration()method toTipPluginBasethat defaults to returning null. Then the checks for old/new plugin can be made based on whatgetConfiguration()returns. That is the approach in this patch.This patch also added shims to Stable that rebuild the markup to match Joyride. Accomplishing this is different depending on whether the
TipPluginusesgetOutput()or
getConfiguration(). Tests were added to confirm both scenarios result in the same markup that Joyride would have been provided.Some of the remaining tasks (assuming the approach is sound)
Comment #74
anmolgoyal74 commentedFixed CS issues.
Comment #75
lauriiiFor better DX, instead of returning an array, we could split this into multiple methods.
If the interface doesn't contain
::getOutputmethod in Drupal 10, people writing code using Drupal 10 could end up writing code incompatible with Drupal 9 LTS because the interface in Drupal 9 would still require::getOutput. It's also not ideal to leave classes with stale::getOutputmethods which would have to be cleaned up at a later point when Drupal 9 is not supported anymore.Solution for this would be to deprecate
Drupal\tour\TipPluginInterfaceas a whole, and replace with a new interface. If we also created a new base class for the new interface,Drupal\tour\TipPluginBasewe wouldn't have the problem with stale::getOutputmethods getting left in the code base. Then we would check inDrupal\tour\TourViewBuilder::viewMultiplewhich interface the plugin is implementing as proposed in #71. This way also any code written in Drupal 10 would be compatible with Drupal 9 LTS because it would include the new interface.Comment #76
bnjmnmThis goes with the direction in #75 and the result is a chunky 62k interdiff. Some of the 62k is copying the Tour JS from Stable to Stable 9, but that's certainly not all of it.
Also tried to expand the docs+comments to make this increasingly large patch (even without the Shepherd library) reviewable.
Comment #77
bnjmnmStill needs review from someone that didn't write the past several patches, but spotted these two things in my own patch:
tp-js class is not neccessary
A 9.0.0 fixture was just added to core, probably best to switch to that.
Comment #78
lauriiiI'm fine with prepending tour to the class names but I wanted to mention that Shepherd is calling these as steps. I'm wondering if it would make sense for us to rename Tips to Steps?
Why do we allow using attributes with the new abstract class but not output?
Should we add an assert that checks if a valid location has been defined?
Is there a particular reason we want this method to return a string rather than render array? That seems like better DX because it would rely on pre-existing XSS handling in render arrays.
Is there a particular reason for handling these in a follow-up rather than on this issue?
Comment #79
bnjmnmThis covers #78, and I confirmed that the deprecated properties I planned to change in #3195823: [PP-1] refactor all tours to not use deprecated code/properties should happen here as it's policy to not have core code use anything deprecated, so this patch now has many new changes to existing tours.
I've run into one snag with this, specific to the deprecated schema properties. I have a test,
TourLegacyMarkupTest, that runs a tour that uses these deprecated properties. If I create the tour with a file in config/installDefaultConfigTest, which tests EVERY config in core (tests included) will fail with a deprecation error. I attempted to work around this by removing the tour with deprecated properties from config/install and manually adding it in the test.I've confirmed the config is added to the database, but the tour that should accompany the page still doesn't load. This is why
TourLegacyMarkupTestis failing in the attached patch. Hopefully there is an obvious fix I'm overlooking.Comment #81
bnjmnmSetting this to needs review. The failing test flipped it to Needs Work, but that was an expected fail and a review/help with #79 is welcome.
Comment #86
tim.plunkettHiding old patch files now that this issue has an MR
Comment #87
volegerNeeds rebase against 9.3.x branch. The target branch of MR also requires to be updated to 9.3.x.
Comment #88
lauriiiDiscussed with @alexpott about the changes to the plugins. We talked about various potential approaches, and tried to find one that would be least disruptive to site maintainers, as well as module authors.
Because
Drupal\tour\TourInterface::getTip()has a return signature of\Drupal\tour\TipPluginInterface, replacing the interface with another is a bit tricky. Therefore, we thought it would be better to deprecated individual methods from the interface rather than the whole interface. This can be done by adding@deprecatedto the method documentation.New interface is needed for the new methods that we want to add. We should create a new interface that extends
\Drupal\tour\TipPluginInterface. Now that the interface is not deprecated, we don’t necessarily need a new base class. Instead of the base class implementing the new interface, we should add a check in the__constructorfor whether the class is implementing the new interface, and throw a deprecation error in the cases where it doesn’t. The action that we expect plugin implementation to take is to continue extending the base class, and make the plugin implementation implement the new interface.We should add empty methods to the base class for deprecated methods in
\Drupal\tour\TipPluginInterfacethat trigger warnings for any code calling them, and returns empty values that are compatible with the signatures defined in the interface. Instead of deprecation errors, the functions should usetrigger_error()withE_USER_WARNINGseverity to make sure that the errors are logged, since the empty values would lead into some functionality rendered unusable.To avoid the error from being triggered, we should try to find a way to implement BC layers in the core plugin implementations. However, even those functions should call the base class function for the warning to be triggered.
D10 Only (prior to major release)
D10 Follow-up
D11 Only (prior to major release)
Comment #89
bnjmnm#88 makes sense. I have one concern regarding how to best warn plugins that use
getOutput()instead ofgetBody()/getTitle()(as a list just to separate points for readability)
getOutput()is a requirement ofTipPluginInterfaceTipPluginBase, implementsTipPluginInterface, but it's and abstract class and leaves it up to the classes that extend it to implementgetOutput()TipPluginBaseimplmentation ofgetOutput()would never be triggered, as all plugins at the moment must implement their owngetOutput(), and there's no parent method to callgetOutput()is the method that would most benefit from havingE_USER_WARNINGseverity warning trigger, but custom Tip plugins extendingTipPluginInterfacewon't get this warning (Plugins that extend existing tip plugins such as the one in tour_ui will work)Comment #90
tim.plunkettThis might be a really bad idea, but could we in
__construct()call$this->getOutput()and emit a warning if it is non-empty?Comment #91
bnjmnmComment #92
tim.plunkettNoticing this in test runs:
Comment #93
zrpnrI manually tested Shepherd vs Joyride using the Views tour, the Example tour from examples module and the overview and tour edit pages from the Tour UI module.
Shepherd is visually an improvement, the default modal and highlighting are nice.
With a window resize Shepherd is able to re-orient itself while Joyride cancels entirely.
The "next" button maintains focus on each step, unlike joyride, which make it more accessible.
The main changes in core/modules/tour/js/tour.es6.js are related to how joyride gets the steps from markup on the page while shepherd loads an object stored in drupalSettings.
Shepherd's approach simplifies adding and filtering the steps in
toggleTourand_removeIrrelevantTourItems.Adding a query string
?tour=anythingto any page with a tour works for autostarting the tour.The class name filter just needs a change to the property name, class --> classes, I added a suggestion in the issue fork. With that change it works as well.
This file also checks for
convertToJoyrideMarkupto convert the markup for any themes that use stable or stable9 as a base theme.This is needed for BC, so any themes based on stable or stable9 that style a tour don't have changes to markup.
The markup is similar, but when converted to joyride the
<header>, body div, and<footer>elements are removed, the<h3>replaced with<h2>. All the joyride classes are present and on the correct elements, plus the added shepherd classes.I noticed that in joyride, the
<h2>has an id that corresponds to the steptour-tip-first-item-labeland the body has an id liketour-tip-first-item-contents. This increments first, second, third etc. In the converted shepherd markup the ids are generated with a uuid likestep-0f62c302-ee2e-4d56-9a4f-5f12e4f4e6a9-label. Not sure how important it is to match the ids, it also seems like these are internal for Shepherd.The javascript and css in stable are identical to stable9.
All the tour.tour yml files were updated, I didn't find any occurrences of
attributes,data-id,data-classorlocationin any files except for where they are supposed to still be in:core/modules/tour/tests/tour_legacy_test/config/install/tour.tour.tour-test-legacy-location.ymlcore/modules/tour/tests/fixtures/legacy_config/tour.tour.tour-test-legacy-location.ymlThe docs page at https://www.drupal.org/docs/8/api/tour-api/overview will need to be updated after this lands.
Attached side by side screenshots for each theme I tested, Claro, Seven, Bartik, test theme based on stable, and wild west (not based on stable).
Comment #94
zrpnrThe latest changes: https://git.drupalcode.org/project/drupal/-/merge_requests/400/diffs?dif...
Step?tips=some-class-namenow works!I didn't look at the hook update changes, but the javascript changes look good!
Comment #96
zrpnrLooks like @bnjmnm addressed all of @lauriii 's comments, I wasn't able to mark them resolved but I commented when I checked each change.
I made a small change to match formatting and comment in tour.es6.js between stable and stable9, and fixed the casing in
TourJavascriptTest.Comment #97
alexpottRe adding to the skippedDeprecations - we shouldn't be adding to that. As per the UpdatePathTestBase documentation ALL update path tests should be in the legacy group...
Comment #98
lauriiiComment #99
zrpnrDependency evaluation in #58, the IS link didn't go anywhere.
Updated the IS and tagging needs release manager review
Comment #100
zrpnrComment #101
catchThe dependency evaluation looks great.
Change records: https://www.drupal.org/node/3204096 - this still needs a description.
https://www.drupal.org/node/3195234 and https://www.drupal.org/node/3204093 - both of these are very clear.
Left a couple of comments on the PR. Can't usefully review the js, but it looks like the bc layer is pretty comprehensive.
Untagging for release manager review - looks good to go with the minor points above.
Comment #102
tim.plunkettUpdated CR per #101: https://www.drupal.org/node/3204096
Updated IS to include API changes and Data model changes section.
Comment #103
zrpnradded a release note
Comment #104
zrpnrComment #105
tim.plunkettI think that's everything taken care of! Marking this RTBC, thanks.
Comment #106
zrpnrHeard back from Shepherd maintainer about the dependency evaluation, updated the IS with a link.
Comment #107
lauriiiWent through all recent commits and all of the changes looked good 👌
Comment #110
catchOK @lauriii and @alexpott asked me to review this since they didn't feel comfortable committing having both done recent work on the patch.
Did not really do a full review (and can't usefully review JavaScript recently), but found a couple of minor issues (now resolved) and not much else to complain about.
So.. Committed/pushed to 9.3.x and cherry-picked to 9.2.x, thanks!
Comment #111
gábor hojtsyAdding to highlights.
Comment #113
andypostNot clear why 2 change records are not published but have a lot of mentions in code
- https://www.drupal.org/node/3204093
- https://www.drupal.org/node/3195234
Faced in #3261249: Remove deprecated tour.module functions
Comment #114
clemens.tolboomI've published the mentioned + 1 CR as D 9.2.0 is long out
- https://www.drupal.org/node/3204096
- https://www.drupal.org/node/3195234
- https://www.drupal.org/node/3204093
@andypost we can do this too ;-)
Comment #115
clemens.tolboomHmmm ... there are more draft CR regarding Tour 28-Jun-2016 between 30-Nov-2021 ... anyone?
See https://www.drupal.org/list-changes/drupal/drafts?keywords_description=tour
Comment #116
andypostMaybe we could reopen and repurpose #3261249: Remove deprecated tour.module functions for 9.4.x (property drprecate tour parts)
And use #3195193: Remove Shepherd shim code from Tour to remove the deprecations