Page MenuHomePhabricator

[Gadgets 2.0] Allow defining multiple ResourceLoader modules from a single gadget definition
Closed, DeclinedPublic

Description

Use case: some light JavaScript code, loaded by all users who enabled a gadget, which conditionally loads the 'real' gadget only if it is going to be useful.

Event Timeline

Ricordisamoa raised the priority of this task from to Needs Triage.
Ricordisamoa updated the task description. (Show Details)
Ricordisamoa subscribed.

What is the criteria for "going to be useful"? Seems like your usecase might be covered by T63007: Allow specifying when a gadget should load (action, namespace, content model).

We could also implement skip-module support in Gadgets, but that's mostly for feature detection I think...

Is this a bug report? Is this a feature request? From reading the summary "More than 1 ResourceLoader module for each gadget?", I have no idea. Adding a verb is welcome. :)

What is the criteria for "going to be useful"? Seems like your usecase might be covered by T63007: Allow specifying when a gadget should load (action, namespace, content model).

This one is broader than T63007. Conditions might include not only patterns to match the page title against, but also different buttons loading different parts of the gadget on demand, etc., which is good for promptness but hard to do with a purely declarative syntax.

Ricordisamoa renamed this task from More than 1 ResourceLoader module for each gadget? to Allow defining multiple ResourceLoader modules from a single gadget definition.Feb 5 2016, 12:14 PM
Ricordisamoa renamed this task from Allow defining multiple ResourceLoader modules from a single gadget definition to [Gadgets 2.0] Allow defining multiple ResourceLoader modules from a single gadget definition.
Krinkle subscribed.

Creating multiple definitions is quite straight-forward. The complexity required to somehow allow multiple modules in one definition is imho not worth the minimal gain (which is that a gadget author would have to type just a few characters less).