Page MenuHomePhabricator

MFA: Drop all usages of isBorderBox and className props on View and remove log warnings
Closed, ResolvedPublic3 Estimated Story Points

Description

In T209007 we started the deprecation process for className and isBorderBox properties on our View classes.

The warning Use of "className" is deprecated. Setting className on the View is deprecated. Please use options. now shows for many workflows.

This task completes the work by dropping those warnings and then restricting className and isBorderBox to be options only.

This work puts us on course for making greater use of composition in our codebase.

Acceptance criteria

  • className is always passed to the parent constructor rather than set as a property
  • isBorderBox is always passed to the parent constructor rather than set as a property
  • If a class extends View and defines className and isBorderBox these have no impact
  • No deprecation notices can be shown in the console under any circumstances

Developer notes

This is a 2 patch job - 1 to clean up the deprecation warnings, 1 to remove the root of the console.logs

Event Timeline

Jdlrobson renamed this task from Drop all usages of isBorderBox and className props on View and remove log warnings to MFA: Drop all usages of isBorderBox and className props on View and remove log warnings.Dec 12 2018, 10:28 PM
Jdlrobson triaged this task as High priority.

Change 479344 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Suppress deprecation warnings on various Views

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

Change 480251 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Break the View property contract for isBorderBox and className

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

Change 479344 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Suppress deprecation warnings on various Views

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

Change 480251 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Break the View property contract for isBorderBox and className

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

phuedx updated the task description. (Show Details)
phuedx updated the task description. (Show Details)

className is always passed to the parent constructor rather than set as a property

[[ https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/resources/mobile.notifications.overlay/NotificationsFilterOverlay.js#L42-L46 | This is not true for mobile.notifications.filter.overlay/NotificationsFilterOverlay ]].

isBorderBox is always passed to the parent constructor rather than set as a property

Confirmed with ag --before=3 --after=3 --js isBorderBox src/ resources/mobile.*.

If a class extends View and defines className and isBorderBox these have no impact
No deprecation notices can be shown in the console under any circumstances

These were both done in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/480251/. The first was done by removing the _resolveInheritedProp function and its usage to resolve the className property. The second was done by setting the DEPRECATED_PROPERTIES constant to [].

Change 481181 had a related patch set uploaded (by Phuedx; owner: Phuedx):
[mediawiki/extensions/MobileFrontend@master] notificationsFilterOverlay: Pass className as prop

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

Change 481181 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] notificationsFilterOverlay: Pass className as prop

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

className is always passed to the parent constructor rather than set as a property

Confirmed with ag --before=3 --after=3 --js className src/ resources/mobile.*.