Support Elysia 2 while retaining Elysia 1 compatibility - #212
Conversation
Keep the existing adapter API while supporting Elysia 2 beta hooks, status values and local request context. Preserve child plugin reuse and native hook deduplication, including deferred macro hooks. Validate packed ESM/CommonJS exports and JSR-shaped source against Elysia 1.4.0, 1.4.30 and 2.0.0-beta.12 on Node.js, Bun and Deno. Document shared dependencies, Deno overrides, and Elysia 2's native async plugin registration constraint with supported examples and tests. Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-fable-5-1
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
==========================================
- Coverage 86.18% 84.41% -1.77%
==========================================
Files 72 73 +1
Lines 13612 13956 +344
Branches 3151 3162 +11
==========================================
+ Hits 11731 11781 +50
- Misses 1307 1590 +283
- Partials 574 585 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 490477d4d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A compatibility layer translates native hooks and response values so Elysia 1.4 and 2 beta can share the existing
elysiaLogger()API in LogTape 2.4.For local request context, the adapter copies Elysia 2 route metadata and wraps callbacks after macro expansion. This preserves request IDs in child hooks without mutating reusable plugins or changing native hook deduplication. The docs explain JSR dependency overrides and Elysia 2's restriction on registering macros after
awaitin a plugin function.The compatibility matrix tests packed ESM/CommonJS exports and JSR-shaped source on Node.js, Bun, and Deno against 1.4.0, 1.4.30, and 2.0.0-beta.12. Consumer type checks allow only dependency diagnostics also present without LogTape. The matrix, repository checks, and documentation build pass.