https://bugzilla.wikimedia.org/show_bug.cgi?id=66390
--- Comment #2 from Krinkle <[email protected]> --- Per discussion between Roan and me we're taking this use case as a story rather than a specific call to implementation. We won't be adding a feature to conditionally declare something as a dependency. So the following will not be the how it is used: visualeditor.dependencies = [es5] -> visualeditor.dependencies = function (deps) { if ( browser doesn't support es5 ) { deps.push( es5); } }; Instead we're going to take it the other way around and have the condition be on the target module (e.g. es5.js instead of visualeditor). visualeditor.dependencies = [es5] es5.skip = function () { return browser supports es5; }; This way will result in much less duplication, and feels more semantically correct because it doesn't make sense for an application to have a dependency that can change. Modules are supposed to be a canonical representation of an interface, not a specific implementation, skin, language or file. Either the module to provide it or it doesn't. Instead visualeditor (or indeed, oojs) would declare it needs the thing that es5-shim.js provides. And es5-shim can decide to forego fetching of any actual files if it detects the environment has it already (either by native or another polyfill). This will make the experience for developers much easier (no need to duplicate if -conditions for es5 all over the place) and practically removes any possibility of abusing this feature for implementing any bad ideas. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
