Skip to main content
1 of 2
Alana Storm
  • 44.4k
  • 35
  • 169
  • 354

Magento 2: Are uiClass/uiElement Imports/Exports order sensitive?

Magento's uiClass/uiElement objects have a feature that allow them, at the time of instantiation, to populate a property of their own (imports) from a uiRegistry registered object, or populate a property from another object (exports) from a third uiRegistry object.

What's not clear from the implementation is

  • Are there imports/exports sensitive the the order components are loaded? (i.e. naive implementation)
  • Or will the property "linking" functionality retry until it finds a registered object in the uiRegistry
  • Or is the "link" lazy loaded?
  • Does this behavior change if the uiClass/uiElement objects are used stand-alone vs. being used in a Magento_Ui/js/core/app application

I'd assume a naive implementation -- but there's a lot of javascript promise use and deferred callback loading going on in Magento_Ui/js/core/app that's not easy to follow. That, plus poor documentation of how the object system works or its intent makes this difficult to know for sure without fully unspooling a Magento_Ui/js/core/app app.

I'm hoping someone already has the answer and can spare me that code dive.

Alana Storm
  • 44.4k
  • 35
  • 169
  • 354