Last modified: 2014-11-17 10:36:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41813, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39813 - Implement immutable object constructors with caching for mw.User, mw.Title, mw.Page (tracking)
Implement immutable object constructors with caching for mw.User, mw.Title, m...
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.20.x
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Krinkle
:
Depends on: 52894
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-30 21:30 UTC by Krinkle
Modified: 2014-11-17 10:36 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2012-08-30 21:30:15 UTC
mw.Title already exists though it needs more work and could use some caching.

mw.User doesn't exist yet as a constructor, but preliminary work has already been done with a lazy-loading system (with the introduction of mw.user.getGroups and mw.user.getRights - similar to in PHP where those methods call ->init() which does nothing if already loaded and loads it if not).

Each of these would be constructed (without being initialized) by default in their lowercase equivalents (mw.title, mw.user, mw.page).

I suggest we write an abstract class that implements:
* Caching by unique identifier
* Methods to clear cache
* Methods to populate cache
* etc.

Eventually this will also allows us to clean up stuff that doesn't belong in mw.config (wgUserName, wgUserGroups, wgCategories, wgCurRevisionId, wgTitle).

And if those vars provide sufficient information to fully populate a cache, we can even optimize for the current context instances and prepopulate them.

Or do it the other way around (populate mw.user/title/page/revision from the page output, and put a backwards compatible thing in mw.config that accesses those from mw.user/title/page/revision)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links