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

1.0 Release #126

Closed
hoangvvo opened this issue Mar 6, 2021 · 7 comments · Fixed by #196
Closed

1.0 Release #126

hoangvvo opened this issue Mar 6, 2021 · 7 comments · Fixed by #196

Comments

@hoangvvo
Copy link
Owner

hoangvvo commented Mar 6, 2021

This library has been sitting in v0 for awhile. After a period of using it in several production apps, it does not seem to yield any problems. After all, most crux of this library depends on the awesome https://github.com/lukeed/trouter library, so nothing much can really go wrong.

Before the 1.0 release though:

  • I want to make sure the APIs are reasonable so that we can avoid breaking changes to it.
  • Update documentation to be more general. Even though this is originally built of Next.js, I have been using it on top on http very fine. Therefore, it should be about more than Next.js.
  • Decide on whether to add several features like routing caching to improve perf. I have been debating this since one of the goal of this library is to stay lightweight.
  • Decide on whether to add several utils like middleware concurrent execution
@qnxdev
Copy link

qnxdev commented Mar 30, 2021

How to use it with GrahQL

If I use it in my production build, how difficult could it be to switch to expressjs later?

@hoangvvo
Copy link
Owner Author

You can always switch to express by replace nc() with express(). Regarding GraphQL, you probably use it with something like express-graphql, in which case their example works simply by replacing express() with nc()

@qnxdev
Copy link

qnxdev commented Mar 31, 2021

What about using GraphQL with next-connect? And even if I achieve it will it work on Vercel serverless?

@hoangvvo
Copy link
Owner Author

It definitely works:

// api/graphql.js
const nc = require("next-connect");
const { graphqlHTTP } = require("express-graphql");

module.exports = nc()
  .use(middleware)
  .all(graphqlHTTP({
    schema: MyGraphQLSchema
  }));

@stigkj
Copy link

stigkj commented Nov 5, 2021

Would it be smart to include support for the new middleware support in Next.js? Or do you see that as a v2? Or never ;-)

@hoangvvo
Copy link
Owner Author

hoangvvo commented Nov 9, 2021

Would it be smart to include support for the new middleware support in Next.js? Or do you see that as a v2? Or never ;-)

It is totally possible. I am just wondering what would be a good naming for this functionality:

import nc from "next-connect/next-middleware
// or
import { middleware } from "next-connect"

@stigkj
Copy link

stigkj commented Nov 19, 2021

I think I would go with the second one.

@hoangvvo hoangvvo mentioned this issue Jul 2, 2022
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.

3 participants