commercelayer / demo-store-core

Commerce Layer Demo Store CORE
https://commercelayer.github.io/demo-store-core
MIT License
7 stars 19 forks source link

Login? #3

Open osseonews opened 1 year ago

osseonews commented 1 year ago

I think adding Login for the Auth component would be very helpful. Most ecommerce websites will require the user to login, and some of your components require user Login, for a user/pw token.

marcomontalbano commented 1 year ago

Hi @osseonews, this Demo Store is designed to be SSG first and foremost. We could manage the sign-in, but the Sales Channel is not enough for a sign-up. Since having the sign-in is useless without the sign-up we decided to postpone it. I can ensure you that implementing the sign-in/sign-up on Demo Store is on our radar!

osseonews commented 1 year ago

@marcomontalbano Probably best to just scrap this actually. Nextjs13 made this type of set up obsolete, in a way, as they are going to deprecate getstaticpaths etc soon. Yes, you don't need to use the app folder in Next13, but it is clear where they are going. So seems like a waste of time to build on this, as they head towards RSC as a default. Maybe CommerceLayer can build out something in remix as an alternative?

marcomontalbano commented 1 year ago

Hi @osseonews, when the RFC was first announced on May we knew that things would have changed some point in the near future. The idea is to update demo-store-core and use the new app folder feature as soon as this will be out of the beta. There are few things that are not yet implemented (e.g. next export). I think that what they did with app folder is really interesting, because you can optimize the way you fetch data and this will speed up the build time.

osseonews commented 1 year ago

Umm. I'll have to disagree on this one. RSC doesn't work. Shopify dropped it. I trust they tried their best and they have unlimited $ and brains. I do not think the "app" folder will gain acceptance any time soon, like in the next year. RSC just has too many problems and even assuming they get the bugs worked out in lets say 6 months, how many people really want to refactor their code once again?

marcomontalbano commented 1 year ago

I was referring to templates specifically. Currently using getStaticPath and getStaticProps you cannot cache results. My feeling is that using this new template feature we could have some improvements there, but I didn't deep dive into it yet. About the RSC, it is on by default but you can switch it off.

osseonews commented 1 year ago

Yeah, I agree, but you don't need to cache anything. That stuff runs on build and then it's cached as a JSON file I believe (not sure exactly how it works under the hood). I've never had any issues with getStatic and works great. I don't think RSC will be any faster, or at least nothing that a regular human will notice. I guess we will see. For now I'm touching it. Stick with the old school stuff.