Page MenuHomePhabricator

ResourceLoader: Modules that are not marked as es6 that import es6 modules should log a JavaScript warning/exception
Closed, ResolvedPublicBUG REPORT

Description

During code review of Nearby, we realized that Nearby had an ES5 module that had a hard dependency on an ES6 module. This leads to an unexpected (rather than silent) error when viewed in older browsers e.g. IE11

Steps to replicate the issue (include links if applicable):

  • Create a module "foo" that is not flagged as ES6 code.
  • Add "vue" ( which is flagged as ES6 code) as a dependency to the foo declaration
  • Add the module unconditionally to the page via OutputPage::addModules
  • Load the code in a browser that doesn't support IE11

What happens?:

  • In JS console a JS error is thrown (unknown module)

What should have happened instead?:

A JavaScript warning should be logged on all browsers, not just IE11. We know that the dependency chain of an ES5 module importing an ES6 module will not always work.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle triaged this task as Medium priority.
Krinkle moved this task from Inbox to Accepted Enhancement on the MediaWiki-ResourceLoader board.

Change 827602 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ResourceLoader: Add structure test to detect incompatible `requiresES6`

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

Change 828115 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/ContentTranslation@master] Mark sx.publishing.followup as requiring ES6

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

Change 828124 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/Wikistories@master] Mark ext.wikistories.viewer and .builder as requiring ES6

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

Change 828121 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/SearchVue@master] Mark searchvue module as requiring ES6

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

Change 828122 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/UnifiedTaskOverview@master] Mark ext.unifiedTaskOverview.specialPage module as requiring ES6

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

Change 828120 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/MediaSearch@master] Mark mediasearch module as requiring ES6

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

Change 828119 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/MachineVision@master] Mark ext.MachineVision module as requiring ES6

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

Change 828118 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/GrowthExperiments@master] Mark MentorDashboard.Vue module as requiring ES6

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

Change 828117 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/GlobalWatchlist@master] Mark specialglobalwatchlist.vue module as requiring ES6

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

Change 828118 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Mark MentorDashboard.Vue module as requiring ES6

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

Change 828124 merged by jenkins-bot:

[mediawiki/extensions/Wikistories@master] Mark ext.wikistories.viewer and .builder as requiring ES6

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

Change 828121 merged by jenkins-bot:

[mediawiki/extensions/SearchVue@master] Mark searchvue module as requiring ES6

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

Change 828122 merged by jenkins-bot:

[mediawiki/extensions/UnifiedTaskOverview@master] Mark ext.unifiedTaskOverview.specialPage module as requiring ES6

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

Change 828120 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] Mark mediasearch module as requiring ES6

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

Change 828119 merged by jenkins-bot:

[mediawiki/extensions/MachineVision@master] Mark ext.MachineVision module as requiring ES6

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

Change 828117 merged by jenkins-bot:

[mediawiki/extensions/GlobalWatchlist@master] Mark specialglobalwatchlist.vue module as requiring ES6

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

Change 828115 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Mark sx.publishing.followup as requiring ES6

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

Change 828618 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/extensions/Wikibase@master] Mark wikibase.termbox module as requiring ES6

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

Change 828618 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Mark wikibase.termbox and wikibase.tainted-ref modules as requiring ES6

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

Change 827602 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Add structure test to detect incompatible `requiresES6`

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

Change 828759 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/WikibaseLexeme@master] Require ES6 for RL modules depending on vue/vuex

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

Change 828759 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Require ES6 for RL modules depending on vue/vuex

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