You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support pre-dispatch hook registration in app! #434
Core pre-dispatch hooks landed in PR #403, but app! still accepts only state and owns_logging keyword arguments; crates/edgezero-macros/src/app.rs:33. Application authors must reconstruct the generated router to install a hook while retaining routes, middleware, state, manifest/store/logging metadata and app identity.
Steps to reproduce
Attempt to register a pre-dispatch hook using app! keyword syntax. The parser rejects an unknown argument. Compare the manual workaround/tests from #403 and enumerate every generated surface the replacement must preserve.
Expected behavior
An optional documented app! hook argument installs the existing pre-dispatch hook while preserving generated behavior and legacy invocation syntax.
Impact
Manual reconstruction repeats routing/metadata configuration and is easy to drift when generated application surfaces change.
Proposed fix
Extend only app! argument parsing and builder generation using the existing hook registration contract. Specify value/Arc and duplicate registration behavior, and test continuation/terminal paths plus preservation of generated surfaces. No runtime-specific dependency belongs in core/macros.
Done when
Define and document an optional macro argument for hook installation, including value/Arc behavior and duplicate-registration semantics.
Existing macro syntax and generated application behavior remain compatible.
Tests demonstrate terminal and continuation behavior and preservation of every generated metadata/router surface.
No runtime-specific dependencies enter core or macros.
Activity