-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Classic component currently reaches a higher parallelization. Assuming PaymentComponent awaits initialization of some SDK, and UI awaits PaymentComponent this can delay the first render. Functionality of started PaymentComponent is not required in start phase of UI.
A rough guess at an API is to utilize classic component Lifecycle for this. User implements both Lifecycle and LifecycleAsync. The loader will first call Lifecycle start on all components, and they assoc async promises to themselves and expose them, i. e. this phase is 100% classic component. After that, in a second pass all components are started via LifecycleAsync, but start is called with the result of the first pass.
Assuming UI doesn't need PaymentComponent during start now, UI can just implement Lifecycle/start on itself. In start it will see an unloaded PaymentComponent as a dep, but it just starts the UI right away, and, if necessary, assocs a starting promise/channel to itself. Then in LifecycleAsync it somewhere install the loaded PaymentComponent dep, awaits its own starting promise from start.