Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving definition of AxiomRequest type #137

Closed
francofantini opened this issue Jul 25, 2023 · 3 comments
Closed

Improving definition of AxiomRequest type #137

francofantini opened this issue Jul 25, 2023 · 3 comments

Comments

@francofantini
Copy link

Currently, the AxiomRequest type is defined as follows:

export type AxiomRequest = (NextRequest | Request) & { log: Logger };

However, this definition poses difficulties when trying to use Next.js-specific APIs like req.nextUrl, which are not available in the Request type.

I propose updating the AxiomRequest type to the following:

export type AxiomRequest = NextRequest & { log: Logger };

This change will ensure that the AxiomRequest type aligns with Next.js APIs.

Please let me know if I'm missing any important considerations or if you have any suggestions for alternative solutions.

Thank you

@schehata
Copy link
Collaborator

hey @francofantini, lets give it a shot. I am not sure though when does Next.js passes NextRequest and when does it pass a normal Request.

schehata added a commit that referenced this issue Aug 21, 2023
issue #137; align AxiomRequest with Next.js APIs
@francofantini
Copy link
Author

Thanks @schehata! When can we expect the next npm release?

@schehata
Copy link
Collaborator

hi @francofantini will check on Monday, if there is any other open issues or features we would like to implement, and I will get back to you. will try to release this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants