Documentation Index
Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Extension lifecycle
The extension lifecycle controls how Veryfront discovers, orders, starts, and stops extension factories.Prerequisites
- At least one extension installed or local (see Extensions).
- The dev server running so you can observe setup and teardown logs.
Load sequence
- Discovery finds configured, local, and package-provided extensions.
- Presets expand into their child extensions.
- Topological sort loads providers before consumers.
setup()runs in sorted order.teardown()runs in reverse order during shutdown or reload.
Presets
Use presets to group extensions that should usually be installed together:Configuration
Pass configuration through the extension factory:ctx.config during setup().
Development reloads
During development, changes toveryfront.config.ts trigger teardown, rediscovery, and setup. Extensions must release resources in teardown() so reloads do not leak connections, timers, or file handles.
Verify reload behavior by adding a temporary log in the extension setup() and teardown() methods, then run:
veryfront.config.ts. The dev server should run teardown() for the previous extension instance and setup() for the new one.
Verify it worked
With the temporarysetup()/teardown() logs in place:
- On
veryfront devstartup, every extension prints asetuplog line. - Save
veryfront.config.ts. Each affected extension should print ateardownlog line and then a freshsetuplog line. - On Ctrl+C, every extension prints its final
teardownlog line.
Next
- Extension testing: test factories and contracts
- Extension publishing: package reusable extensions
Related
- Extensions: extension overview
- Extension authoring: writing extension factories
veryfront/extensions: extension API reference