-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Next.js Commerce refresh. #966
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for providing some clarity on the status of the project. Over at Vendure we have been getting quite a lot of support questions about the status of this repo. It has been clear for a while that v1 had hit a bit of a dead end. I think the decision you took makes sense - being platform agnostic is theoretically good but in practice any one project will only ever use a single backend, so all the abstraction required to make it agnostic is immediately just unwanted bloat that over-complicates the architecture. I think this is also what Vue Storefront also eventually learned. There's still going to be demand for Next.js in the Vendure community of course, but we might go with building our own starter kit tailored to our APIs, like we did with our existing Remix, Qwik & Angular starters. But I'll be keeping an eye on this repo still to see to what degree it makes sense to recommend to our users to fork and adapt it for their Vendure projects. |
Thank you for the update. I must admit that I am not as fond of this decision. I appreciate the performance and architecture of the frontend Next.js Commerce, as well as the ability to choose the backend. Removing this option means I am now forced to use the Shopify solution, which is not the one I currently use. However, I am hopeful that the "lib" folder's architecture will allow me to replace the GraphQL queries with those I already use on v1. This would make replacing the "lib" a simple copy-and-paste process with some code replacements. I look forward to your future updates regarding the v2 version. |
I agree with @megetron. I hope that the It almost makes me want to fork and keep maintaining the v1... How hard can it be to make it work nicely with Next.js 13? I imagine it would be quite the effort if Vercel themselves decided against it. |
We understand that the new direction will come with mixed feelings. @michaelbromley is right. Being platform agnostic is theoretically good, but typically comes with a more complex architecture to allow the flexibility. That was evident with v1. As you can see, this PR removed close to 150k lines of code while only adding 6k. The goals of the new template are to:
As for supporting other providers, that’s where Vercel’s Template Marketplace comes in. We recommend and welcome templates that will produce the same goals listed above. |
We're making some updates to Next.js Commerce. Everything prior to this commit marks what we're calling [`v1`](https://github.com/vercel/commerce/releases/tag/v1) as a point in time to be able to reference and still use going into the future. The current architecture of Commerce is a multi-vendor, interoperable solution, including: - [Shopify](https://shopify.vercel.store/) - [Swell](https://swell.vercel.store/) - [BigCommerce](https://bigcommerce.vercel.store/) - [Vendure](https://vendure.vercel.store/) - [Saleor](https://saleor.vercel.store/) - [Ordercloud](https://ordercloud.vercel.store/) - [Spree](https://spree.vercel.store/) - [Kibo Commerce](https://kibocommerce.vercel.store/) - [Commerce.js](https://commercejs.vercel.store/) - [SalesForce Cloud Commerce](https://salesforce-cloud-commerce.vercel.store/) All features can be toggled on or off, and it's easy to change between commerce providers. To support this, we needed to create a ["commerce metaframework"](https://github.com/vercel/commerce/blob/d1d9e8c4343e70d72df6e00ec95f6ea4efbb7c54/packages/commerce/new-provider.md) where providers could confirm to an API spec to add support for Next.js Commerce. While this worked and was successful for `v1`, we have different design goals and ambitions for `v2`. **What You Need To Know** - `v1` will not be updated moving forward. If you need to reference `v1`, you will still be able to clone and deploy the version tagged at this release. - `v2` will be shifting to be a single provider vs. provider agnostic. Other providers are welcome to fork this repository and swap out the underlying `lib/` implementation that connects to the selected commerce provider (Shopify). This architecture was chosen to reduce the surface area of the codebase, remove the intermediate metaframework layer for provider-interoperability, and enable usage with the latest Next.js and React features. - We will be sharing more about `v2` in the future as we continue to iterate before the marked release.
import { defaultSort, sorting } from 'lib/constants'; | ||
import { getProducts } from 'lib/shopify'; | ||
|
||
export const runtime = 'edge'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for providing an amazing demo.👍
I have a question to ask you.
Could you please explain the rationale behind choosing to use the Edge runtime in this page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m1nsuplee it provided the fastest experience at the time, though we're now converting the app to use Partial Prerendering (see #1236 for more information).
We're making some updates to Next.js Commerce. Everything prior to this PR marks what we're calling
v1
as a point in time to be able to reference and still use going into the future. The current architecture of Commerce is a multi-vendor, interoperable solution, including:All features can be toggled on or off, and it's easy to change between commerce providers. To support this, we needed to create a "commerce metaframework" where providers could confirm to an API spec to add support for Next.js Commerce. While this worked and was successful for
v1
, we have different design goals and ambitions forv2
.What You Need To Know
v1
will not be updated moving forward. If you need to referencev1
, you will still be able to clone and deploy the version tagged at this release.v2
will be shifting to be a single provider vs. provider agnostic. Other providers are welcome to fork this repository and swap out the underlyinglib/
implementation that connects to the selected commerce provider (Shopify). This architecture was chosen to reduce the surface area of the codebase, remove the intermediate metaframework layer for provider-interoperability, and enable usage with the latest Next.js and React features.v2
in the future as we continue to iterate before the marked release.Thank you so much! 🎉