Shopify / shopify-app-template-ruby

114 stars 41 forks source link

Rails 8, Hotwire, Stimulus, no react #122

Open Alagaesia93 opened 9 months ago

Alagaesia93 commented 9 months ago

Hello Shopify!

With the upcoming release of Rails 8, I think the default rails template for a Shopify app could deeply change. This is more a topic for discussions, but there is no discussions tab so here I am.

In particular

Benefits

I am very interested in building something like this, I have already seen a few resources online (i.e. https://github.com/kirillplatonov/shopify-hotwire-sample) from @kirillplatonov.

Is it interesting for Shopify as well? I'm asking because I can see an outdated Ruby version on this repo, for example, and official documentation mentioning only Remix templates.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

Alagaesia93 commented 7 months ago

Not stale :)

bifo90 commented 6 months ago

Yep! I absolutely agree with you. Let's keep a Ruby App template updated 💪

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

jagthedrummer commented 4 months ago

Not stale. Please disable the bot. It's hostile and give the impression that you don't actually want to hear from developers.

lizkenyon commented 3 months ago

Hi there 👋

First of all, I have put up a PR to remove stalebot from this repository. That should have been done months ago when we removed it from other repositories, but some repos were missed, including this one. And sorry for not jumping into this discussion sooner.

We do want to hear the feedback from out community, and thank you for starting this discussion.

Secondly, there has been internal discussions about the future of the ruby template, and what it could look like without React. Including chatting with folks like @kirillplatonov, about their experiences with their template. At this time we don't have anything to announce, but this is a topic the team has been thinking about.

One of the more immediate things we are looking to do is putting together a guide of how to modify the current template without the react frontend.

paulomarg commented 3 months ago

Hey folks, thanks for raising this discussion! As @lizkenyon mentioned, this is something we have been thinking about, and we've added a Wiki page on unplugging the React frontend from the current template. Please let us know if you have any issues with it, or if we missed anything!

I think the OP makes a lot of good points, and we'll make sure to take that feedback into consideration going forward.

In the meantime, I also wanted to get a sense of how the community prefers to set up their UI styles. When not using React:

jagthedrummer commented 3 months ago

I'm using the Polaris CSS, and I currently link to it on unpkg. (I just noticed that I'm several versions behind, so I don't know if that's even a possibility anymore. On a quick skim of the "Getting started" bits in the Polaris docs I didn't spot any obvious resources about just importing the CSS and using it to style HTML directly.)

I pull it into my apps via a gem that I made to help manage both the CSS and the markup.

https://github.com/jagthedrummer/polaris_view_helpers

I don't use any of the React stuff.

dhmacs commented 3 months ago

I'm primarily a React dev (being using React since 2015) and I've only learned Rails a couple years ago.

I'd love to see the Shopify Rails template embrace Rails 8 + Hotwire, in fact at my company we've built one in-house because Rails + React template is complicating things that are quite simple in vanilla Rails.

We're currently using Polaris View Components, but it'd be great have an Hotwire solution backed by Shopify team. It could be styled erb markup + Stimulus controllers to be added where needed

remy727 commented 1 month ago

Hello @paulomarg, there is a typo in Wiki page

Wrong

Create a new home view in web/views/home/index.html.erb:

Correct

Create a new home view in web/app/views/home/index.html.erb:

How can I create PR to update wiki page?

lizkenyon commented 1 month ago

Thanks for the ping @remy727 I have updated it.

remy727 commented 1 month ago

@lizkenyon @paulomarg, I unplugging the React frontend by following the steps in Wiki page.

But I can't preview the app. I ran the app using Ngrok tunnel but I always have ERR_NGROK_8012 error. I tried different ports and checked firewall but the same error. I tried original ruby template but it worked well. You can reproduce the issue on shopify-app-template-ruby-demo

Image

lizkenyon commented 1 month ago

Hi @remy727

Can you please create a new issue for this. Thanks!

remy727 commented 1 month ago

@lizkenyon, yes. I created #150