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

Does it not work for app dir route handlers? #178

Closed
rafbgarcia opened this issue Nov 4, 2023 · 4 comments · Fixed by #179
Closed

Does it not work for app dir route handlers? #178

rafbgarcia opened this issue Nov 4, 2023 · 4 comments · Fixed by #179

Comments

@rafbgarcia
Copy link

Hi, thanks for the lib! <3

Nextjs-routes works great with pages but it's not generating the type for a route handler I created.

Is this accurate? Or should it work fine for route handlers too?

Thanks!

@tatethurston
Copy link
Owner

tatethurston commented Nov 4, 2023

Thanks @rafbgarcia. Checkout #170 and let me know if you still have questions.

@rafbgarcia
Copy link
Author

rafbgarcia commented Nov 4, 2023

@tatethurston thanks! I have a question, I haven't tested NextJS typed links yet, but it only seems to support the Link component.

However, I find nextjs-routes very useful when I need to generate a route in other places, such as using the route() function in middleware.ts, as it gives me confidence that the route is correct.

Can NextJS solution do that?

Also, nextjs-routes already works for the app directory, the only issue I faced so far was this one, that it doesn't type the route handlers.

Thanks again :)

@tatethurston
Copy link
Owner

Also, nextjs-routes already works for the app directory, the only issue I faced so far was this one, that it doesn't type the route handlers.

Per #170 I believe there may be a few additional changes necessary when using the app directory. Personally, I haven't used the app router non trivially yet, so I have some knowledge gaps here.

That said, if you're you're running with this and find it covers some use cases that Next's experimental solution doesn't, I'm happy to add functionality to cover any gaps or rough edges you run into.

I'll ship route handler support in a moment.

tatethurston added a commit that referenced this issue Nov 4, 2023
tatethurston added a commit that referenced this issue Nov 4, 2023
tatethurston added a commit that referenced this issue Nov 4, 2023
tatethurston added a commit that referenced this issue Nov 4, 2023
tatethurston added a commit that referenced this issue Nov 4, 2023
@rafbgarcia
Copy link
Author

@tatethurston works great, thank you very much!! ❤️

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

Successfully merging a pull request may close this issue.

2 participants