Skip to main content
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

Magento's uiClass/uiElement objects have a featurehave 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.

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.

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.

Source Link
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.