Skip to content

Commit

Permalink
docs: note on perf
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Nov 8, 2024
1 parent ff1b67c commit 2f331a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/userguides/developing_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ from ape import plugins
# Here, we register our provider plugin so we can use it in 'ape'.
@plugins.register(plugins.ProviderPlugin)
def providers():
# NOTE: By keeping this import local, we avoid slower plugin load times.
from ape_my_plugin.providers import MyProvider

# NOTE: 'MyProvider' defined in a prior code-block.
yield "ethereum", "local", MyProvider
```
Expand All @@ -69,6 +72,11 @@ This decorator hooks into ape core and ties everything together by looking for a
Then, it will loop through these potential `ape` plugins and see which ones have created a plugin type registration.
If the plugin type registration is found, then `ape` knows this package is a plugin and attempts to process it according to its registration interface.

```{warning}
Ensure your plugin's `__init__.py` file imports quickly by keeping all expensive imports in the hook functions locally.
This helps Ape register plugins faster, which is required when checking for API implementations.
```

### CLI Plugins

The `ape` CLI is built using the python package [click](https://palletsprojects.com/p/click/).
Expand Down

0 comments on commit 2f331a6

Please sign in to comment.