support skipping aspects-load from workspace.jsonc by either a prop on a command or --self-mode flag #8849
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is about the loadAspects triggered from the Workspace during the onStart hook, which loads the aspects set on the workspace.jsonc file.
It takes time and if it's possible to avoid it, it improves the performance. (on a new react workspace, it saves as much as 500ms).
The reason this is needed is that users can add aspects which register to various slots and if these aspects are not loaded, they won't be registered. Also, keep in mind, that these aspects are not dependencies of the components, so the fact that workspace components are loaded, doesn't mean that these aspects will be loaded.
Until now, it was skipped for bit login/logout. It was hard-coded.
With this PR, the machanism is baked into
Component
class. Also, it is skipped for all legacy commands. These commands don't use any slots, so it's fine to not load the aspects for them.The global flag
--safe-mode
was changed as well to avoid loading the aspects.