Allow dynamic code within `defineRouteMeta`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Related:
- #2641
- #2912
Experimental route meta (#2102) (docs) only allows static definition like this:
defineRouteMeta({
openAPI: {
tags: ["test"],
description: "Test route description",
parameters: [{ in: "query", name: "test", required: true }],
},
});
However, users might want to generate it with other tools like zod.
In order to support this, we need to update handlers-meta rollup plugin to detect defineRouteMeta and actually evaluate (run) the code necessary in place since by-design this information should be statically extracted into the bundle.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/rollup/plugins/handlers-meta.ts and the existing defineRouteMeta handling, then review the related issues #2641 and #2912 plus the route-meta documentation. Determine how the plugin can evaluate code such as metadata generated with tools like zod while still extracting the result into the bundle. Done means dynamic defineRouteMeta values are evaluated and included in generated route metadata.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rollup, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100