Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Use ES6 classes for custom OOUI widgets #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use ES6 classes for custom OOUI widgets #561

wants to merge 1 commit into from

Conversation

MatmaRex
Copy link
Owner

Just for a lark.

Do not use ES6 static properties though, as they're only introduced in ES2020, and also apparently everyone hates them.

Just for a lark.

Do not use ES6 static properties though, as they're only introduced in
ES2020, and also apparently everyone hates them.
@MatmaRex MatmaRex requested a review from edg2s May 19, 2023 11:14
@edg2s
Copy link
Collaborator

edg2s commented May 19, 2023

We should work out the limitations of this. I did this a while ago with a personal project (https://github.com/edg2s/deal/blob/master/static/model/GameModel.js), so for example OO.mixinClass is still required.

@MatmaRex
Copy link
Owner Author

The only limitation I noticed was that you can't set properties on this before calling super. It was trivial to avoid here, but there are some classes in OOUI and probably in Wikimedia projects where it would be more difficult. Everything else either has a direct equivalent in ES6 classes, or you can just do it by calling the OOUI methods as before.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants