Skip to content

[rush] Refactor actions to async load all complex dependencies #5636

@dmichon-msft

Description

@dmichon-msft

Summary

Refactor the various CommandLineAction subclasses in Rush so that the only logic synchronously included in the class is the definitions of the CLI parameters, and the actual business logic of the class is in an async imported executor.

The purpose of the exercise is to optimize the initial generation of the command line parser and the --help and tab-complete actions, as well as to remove large, complex dependencies from the loading path for actions that don't require them.

The executeAsync method should read values from the CLI arguments, then const { fooExecutor } = await import(/* webpackChunkName: 'foo-executor' */ './FooExecutor.js') then invoke the executor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions