Skip to content

[EXTREMELY BREAKING CHANGE] Eliminate ZObjectKeyFactory; use createZObjectKey instead.

Cory Massaro requested to merge apine-remove-zobject-keys into main

Bug: T369653 Bug: T369173

Changes:

  • move ZObjectKeyFactory tests to test/unit/src/utilsTest.js; update expectations
  • replace ZObjectKeyFactory with createZObjectKey

Advantages:

  • slight performance improvement
    • we no longer create a bunch of ZObjectKeys; instead, we operate only over Arrays of Strings
  • no more infinite backslashes

Disadvantages:

  • less readable keys (but see below)
  • need to do an additional check to detect list types (one of the few use cases of the non-stringified ZObjectKey)
    • but this additional check is quite cheap and intuitive
    • given that, in some cases, the new check obviates the creation of a key altogether, and that, in other cases, key creation is faster than it was before, this is still a beneficial tradeoff in terms of performance

Open Questions:

  • should we go back to the old format?
    • if so, we should also implement this logic in PHP to create cache keys
    • if not, we'll need to tweak both this format and the PHP-side one to prevent ambiguity
Edited by Cory Massaro

Merge request reports