Shopify / shopify_app

A Rails Engine for building Shopify Apps
MIT License
1.76k stars 684 forks source link

Add documenation about how to migrate to the latest app structure & approach #1895

Open jagthedrummer opened 1 month ago

jagthedrummer commented 1 month ago

Overview/summary

The new node base CLI expects a radically different app structure and overall approach than the ruby CLI used to use. I can't find any documentation about how to transition an existing app (with theme extensions) to the new structure and approach.

(This is another area where it feels like Shopify is, at best, just not considering how to help existing partners keep up, and at worst, is being actively hostile towards existing partners.)

lizkenyon commented 1 month ago

Hi there 👋

Could you clarify what versions of which packages, and the CLI you are currently using and what you are hoping to migrate to.

We do have this set of documentation for migration to CLI 3.0 and greater, though not sure if this is what you are looking for.

jagthedrummer commented 1 month ago

@lizkenyon I guess I kind of have two issues/questions.

Issue 1:

I'm trying to deploy a new version of a theme-app-extension and am looking for the absolute shortest path to be able to do that. Up until fairly recently I was able to continue using the ruby CLI to do this (despite seeing some deprecation warnings).

I have a standard Rails project in the standard Rails project format (not the newly-invented Shopify format of things being in a web sub-directory within the project) and my extension is in a theme-app-extension sub-directory inside my project (right next to app, config, etc...). With the Ruby CLI I'm still able to deploy the extension to my development store by doing shopify extension push. And I'm even able to push to my production app, but I'm not able to version and deploy it.

After pushing to my production app I'm shown the URL for the page where I should be able to cut the new release, but when I go there I'm not given an option to actually release it. Instead I just see a complaint that I have to upgrade the CLI. (Given that pushing it to Shopify actually works this again feels pretty hostile that I'm not allowed to release even though the API for pushing is still working.)

CleanShot 2024-08-08 at 12 25 17

So the question here is: What's the shortest path to being able to release a new version of a theme-app-extension?

Issue 2:

The new CLI not only expects a new project structure, but when provisioning a new app, also includes an entirely new approach to how the app works at a fundamental level. Previously a new app would assume that if you're using Ruby that you actually want to use Ruby. Now it seems like it assumes that you want to use React. And given the seeming lack of support around the Ruby gems it feels like at some point React is going to be mandated instead of recommended.

So the questions here are: Is React going to be mandated at some point in the future or will we still be able to use server rendered pages along with Turbo/Stimulus? If React is not going to be mandated, will the Turbo/Stimulus approach be fully supported as a first-class option or will it be something that just kinda sorta works if you know how to decipher the differences between the two approaches? In either case, if I wanted to migrate my app to the new React-based approach (I'd really rather not), what's the recommended path for doing that?

The questions in Issue 2 are related to this issue on the ruby template repo that hasn't received any response from the Shopify team in the 6 months that it's been open. (The bot marking it as stale because nobody from Shopify has bothered to reply is yet another thing that feels pretty hostile.) https://github.com/Shopify/shopify-app-template-ruby/issues/122

I'm sorry if any of this seems like I'm being hostile, it's just very frustrating that so many things have been changing out from under us without adequate guidance from Shopify on how to make the changes that are being forced on us just to keep our apps working as they have been for years.

lizkenyon commented 1 month ago

Hey @jagthedrummer

Issue 1

Unfortunately at this time the path forward will be to move to a supported CLI version. This migration was first announced in 2022, and this version has been unsupported for a year.

Good news: The CLI project structure is configurable! While the CLI expects a certain project structure by default, you can configure the CLI to know where to look for files if you are following a different structure.

For example in the shopify.app.toml file you can set the path to your extension directories if it is different than /extensions

If you have other issues with the CLI migration, I would recommend creating an issue with the CLI repository. As they will be the experts on the different configurations available.

Issue 2

At this time there is no plan to mandate that apps use a react frontend.

If you are not currently using React for your frontend, and you don't want to migrate, we don't want to force you to migrate.

Regarding https://github.com/Shopify/shopify-app-template-ruby/issues/122, to be honest we have definitely missed the discussion on that ticket. There have been internal discussion about the future of the ruby template, and what a ruby template without React would look like I am going to reflag that ticket with the team so we can respond there with the information that we have.

mrpunkin commented 2 weeks ago

I'd like to just toss my hat into the ring to echo some of the concerns that @jagthedrummer has raised, primarily about those of us still building on Ruby/Rails feeling like we are getting left in the dust without clear paths forward.