aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
5.86k stars 3.54k forks source link

[Feature Request] Add `--fetch-deps-only` flag to `aptos move compile` #13279

Open mkurnikov opened 2 weeks ago

mkurnikov commented 2 weeks ago

šŸš€ Feature Request

Motivation

Is your feature request related to a problem? Please describe.

If user changes dependencies in the Move.toml file, IDEs need to fetch and index updated source code to be able to provide the name resolution functionality. It can run aptos move compile to do that on every change.

There are some problems with this approach:

  1. it's slow, doing unnecessary work generating the bytecode, which could be a problem if it's called often enough,
  2. it could, and probably will fail with compilation error, as user could be in the middle of typing the code. Ignoring the errors works, but creates unnecessary friction,
  3. finally, it can create side effects for the user, as one won't expect project to be compiled.

Pitch

Describe the solution you'd like

Add --fetch-deps-only flag to the aptos move compile, wrapping functionality added in https://github.com/move-language/move/pull/267. sui move build --fetch-deps-only can be used as a reference.

Describe alternatives you've considered

Are you willing to open a pull request? (See CONTRIBUTING)

Additional context

@gregnazario