Page MenuHomePhabricator

De-deprecate gt.defineTour
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
Un-deprecate gt.defineTour and fix the functionality of the "back" action
Maybe also make it return a TourBuilder object or even make it a TourBuilder constructor

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
gt.defineTour was a nice way to specify multiple step objects in an array at once without having to gt.step and add names for each one

Benefits (why should this be implemented?):
Way easier steps sequencing (for mostly linear tours) and perhaps easier porting for legacy tours

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Per discussion on MW.org, +1. The method's been "deprecated" for almost a decade without being removed and there'd be a real use case for it, so let's simply revert that part of rEGTOfc9de92a6ae6: Refactor and add non-linear tours, with tests.

I'm not sure if much people will see this though, the last tasks I've created got no response. I may have to learn how to fix back myself.

I'm inclined towards just doing this, because the deprecation happened so long ago. But, I'm unsure why it is needed. On a first check, both gt.defineTour and an object-driven approach of Step can be used to create the same GuidedTour? Is there a specific example in which gt.defineTour would be more appropriate (or the only such solution)?

It’s useful when you have a mostly linear tour and want to chain them together. With defineTour, you can chain steps like an array. Otherwise, you have to add names, .next(<name>) and .back(<name>) for every single tour.Step .

Also, after undeprecating we still have to

fix the functionality of the "back" action
Maybe also make it return a TourBuilder object or even make it a TourBuilder constructor

Hey @Urbanecm_WMF , is there any progress on this?

Hey @Urbanecm_WMF , is there any progress on this?

Hello, none that would not be recorded on the task :-). Thanks for the clarification from the other day. I think we'd be fine with that change being made, but unfortunately, we currently do not have the capacity to actually create the patch. If you do, please feel free to upload a patch!

Change #1028874 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/extensions/GuidedTour@master] De-deprecate gt.defineTour

https://gerrit.wikimedia.org/r/1028874

Change #1028874 merged by jenkins-bot:

[mediawiki/extensions/GuidedTour@master] De-deprecate gt.defineTour

https://gerrit.wikimedia.org/r/1028874

Feel free to file any remaining issues as separate tasks - I may (or may not) woork on them.