Plugin Lifecycle
Ecopages keeps lifecycle ordering in core. Integrations and processors declare contributions, but they do not decide startup order or manifest assembly themselves.
Phase 1: Config Finalization
ConfigBuilder.build() is the app-owned finalization boundary.
During this phase Ecopages:
- validates integration names and extensions
- validates processor names
- derives absolute paths and semantic template paths
- installs required default loaders
- initializes processor context
- validates runtime capability declarations
- creates the app-owned build adapter, build executor, dev graph service, runtime specifier registry, and Node runtime manifest
This is where app-owned build/runtime state becomes stable.
Phase 2: Build Contribution Preparation
Build-facing contributions are collected before the app starts handling requests.
The ordering is:
- processors run
prepareBuildContributions()first - processor
pluginsare collected into runtime plugin contributions - processor
buildPluginsare collected into browser bundle contributions - integrations then run
prepareBuildContributions() - integration
pluginsare collected into runtime plugin contributions
This ordering is core-owned because processors often provide generic asset capabilities that integrations depend on indirectly.
Phase 3: App Startup Setup
Runtime-only setup happens after the build manifest has already been sealed.
The ordering is:
- processors run
setup()first - processor runtime plugins are exposed to the active runtime startup path
- integrations receive app config, runtime origin, and HMR manager context
- integrations register HMR strategies through the shared integration setup path
- integrations run
setup()
At this point Ecopages has enough live runtime context to resolve integration dependencies, initialize renderers, and register development behavior.
Phase 4: Request-Time Rendering
For each request, core owns routing and dispatch:
- route resolution picks the matching page or API handler
- the owning integration is selected from the file extension
- the integration renderer handles framework-specific rendering
- shared HTML/document finalization runs before the response is returned
Integrations own rendering semantics here. Core still owns orchestration and shared post-processing.
Phase 5: Development Invalidation And HMR
Development invalidation is classified in core and then routed to the appropriate participant.
The main model is:
- core classifies file changes through
DevelopmentInvalidationService - processor-owned watch paths are handled through processor watch configuration
- integration-owned HMR behavior runs through registered HMR strategies
- full reloads remain a core decision when the change category requires it
This keeps generic invalidation policy out of individual integrations.
Ownership Summary
Use this rule when deciding where new behavior belongs:
- put it in core when it affects orchestration, lifecycle ordering, server loading, browser bundling coordination, or invalidation policy
- put it in an integration when it affects rendering semantics, hydration behavior, framework-specific HMR, or cross-integration ownership behavior
- put it in a processor when it affects asset transformation, emitted assets, asset-specific caching, or watch behavior for owned files