JS sidebar macros don't interact well with A/B testing framework

UNCONFIRMED
Unassigned

Status

Developer Documentation
JavaScript
P5
normal
UNCONFIRMED
10 months ago
10 months ago

People

(Reporter: Stephen Wille, Unassigned, NeedInfo)

Tracking

Details

(URL)

(Reporter)

Description

10 months ago
:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

When viewing the Array methods, clicking on any method takes me to a completely new page.  If that's not the method I want, I have to go through another page load to view all the Array methods.  The previous MDC docs did not do this, and were easier to consume.

Please change it back.
(Reporter)

Comment 1

10 months ago
This page is not nearly as readable or useful as the previous docs site.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce?v=b

Comment 2

10 months ago
Is the bug you're reporting about the difference between https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce (without interactive example) and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce?v=b (w/ interactive example)? Or is it about another issue?

If it's about the interactive example you're seeing at the top of the page, this takes place during a beta testing phase of a new feature for MDN (cf. https://discourse.mozilla.org/t/interactive-editors-in-beta/18548)

If it's not, could you please provide some more explanations? As far as I can tell, the links here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Methods_2 are working and the (left) sidebar seen from the different pages about Array point towards the right docs.

Comment 3

10 months ago
Hello Stephen, was I able to help about this matter?
Flags: needinfo?(p.stephenwille)
(Reporter)

Comment 4

10 months ago
Ah, yes.  That is the difference.  Seeing all the methods at once is much more helpful to me.
Flags: needinfo?(p.stephenwille)
Thanks for filing this!

I think the problem you're highlighting is the sidebar on the left-hand side of the page (under "See also").

In: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce?v=a it looks something like:

    Standard built-in objects
    Array
    Properties

        Array.length
        Array.prototype
        Array.prototype[@@unscopables]

    Methods

        Array.from()
        Array.isArray()
        ...

In https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce?v=b it looks something like:

    Standard built-in objects
    Experiment:InteractiveEditor
    Inheritance:
    Function
        Properties
        Methods
    Object
        Properties
        Methods

Is that a correct statement of the problem you're reporting?

Updated

10 months ago
Flags: needinfo?(p.stephenwille)
Summary: I don't like the new JS doc layout - it takes me to new pages and I lose the high level view of all JS methods → JS sidebar macros don't interact well with A/B testing framework
If so, this is I think because the macro used to build the JS sidebar doesn't interact well with the A/B testing system we use.

The page you reference is currently part of an A/B test. The "B" variant is the one you see at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce?v=b. In this page, the actual content lives at https://developer.mozilla.org/en-US/docs/Experiment:InteractiveEditor/Array.prototype.reduce(). That content includes a macro (https://github.com/mdn/kumascript/blob/master/macros/JSRef.ejs) that generates the sidebar on the left. The macro uses the page's URL to figure out which links to include in the sidebar. Because the page URL is the "Experiment:InteractiveEditor" URL instead of the real URL for Array.reduce(), the macro gets confused and adds the wrong links.

Probably the easiest fix would be to adapt the JSRef macro so it can accept a parameter telling it the desired URL, so it can work in "location independent" mode. Then the A/B test pages can pass that it, and the sidebar should be correct.
You need to log in before you can comment on or make changes to this bug.