Description
The ZObject represented on the page is stored in the zobject.js store module as a flat table, where every node (and hence, every child ZObject represented under that node) can be reached directly by any component using its unique row id.
More details about this: https://www.mediawiki.org/wiki/Extension:WikiLambda/Frontend_Architecture#ZObject_Table
While this data structure is beneficial for direct node value access, it is not scalable with large objects.
More details about performance issue: https://docs.google.com/document/d/1q-AkqLXx0jT43eLj1IxBqE6XpjHRqFdeiwNh4buaAzQ/edit?tab=t.0
We have tried a number of mitigation strategies and the performance improvements are minimal. We've determined it is high priority to move away from flat table representation and into nested object, using Pinia store reference features.
The following POC has shown this possibility performs well, loads immediately and doesn't require an excessive refactor:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/1126604
Desired behavior/Acceptance criteria
- ZObject is stored as is (converted to hybrid form) instead of flat table
- Front-end load times visibly improve
- UI can load an expanded Q144 wikidata object in a reasonable time with no browser crashes
- Unit test coverage is equivalent to current
- UI snapshots are identical
- Integration and e2e tests pass with no changes
- Frontend Architecture documentation is updated
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist