Do modules that are dependent on other modules load sync or async?

I have created two custom modules where module A is dependent upon module B and module B is dependent on the Third Parties module.
Module A → Module B → Third Parties Module

If I were to enable module A which module would be loaded first, module B or Third Parties module? Is module dependency loading sync or async? What would be the best way to implement this so I can ensure when a user clicks module A it first loads in the order I am hoping. Apologies, but I can’t seem to find the documentation regarding this, any assistance would be appreciated.

After some experimentation it appears as though Module A is loaded first, as it’s SQL tables, then it links to module B and loads all of those files, then goes to third parties module. However, if module A has code that modifies a value generated on initialization of third parties module, then it will not work work as expected because the third party value generated on initialization has not occurred yet and module A is referencing a nonexistent value.

1 Like