Live data from Hacker News

From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

shopify.engineering

31–40 of 109 posts

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#31

I'm begging you, just use a language that compiles to a single binary. It can self update in place, be easily installed on developer machines and CI pipelines without requiring a whole additional toolchain in every container. Google, Heroku, AWS, Shopify all do and it's an awful developer experience.

Rust is amazing for CLIs (Go potentially as well, too little experience with that personally!), but if you're already quite comfortable with JS & have existing investment in it for CLI or related code, then ´npx ...` while asking the user to install Node (or Bun) is an acceptable tradeoff in most cases. Updating via npm is also easy enough for users, though it's not self-updating of course, but basically no CLI will do that fully automatically for you. Not even Cloud SDK CLIs. And for good reason.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#32

Cool. But god, the Shopify CLI / developer experience has degraded so much in the past few years. With the newest iteration, they want a full app re-structure just to work with the CLI properly. It is absolutely brutal. Sure, before they had basically no tooling, but then they had some basic ones that everyone was basically happy with, and then they just decided to iterate too much. (saying this as a ~ 8 year long Pa…

How does something like this happen? Shopify should be absolutely on top of its game here, seeing as user experience seems to be one of their main priorities?

Nowadays it's not that hard to get UX/DX right if you are actually committed to it.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#33
post #3

Interesting. TIL about the Open CLI framework that they all seem to be moving to: https://oclif.io/

It's from Salesforce/Heroku. The documentation is definitely lacking, but it's battle-tested and under fairly active development.

I moved the Zapier CLI to oclif a few years ago over a bespoke version, since it handles a lot of the nitty-gritty of displaying text in terminals. It's a pretty nice setup and allowed us to focus on the important things.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#34

I just find working with Node to be gross. Look at this: https://github.com/Shopify/cli/blob/main/package.json but wait...this too: https://github.com/Shopify/cli/blob/main/packages/app/packag... https://github.com/Shopify/cli/blob/main/packages/cli-hydrog... https://github.com/Shopify/cli/blob/main/packages/cli/packag... https://github.com/Shopify/cli/blob/main/packages/create-app... etc, etc, etc VS https://github.…

The project looks extremely messy, so many packages inside packages. It feels like java, but less performant

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#35

Earlier quoted context omitted.

What's the mechanism for self-updating in place? Something more intelligent than just downloading and copying the file over itself? A running program itself is a copy of the file on disk, I think. So that sounds fine. But this still depends on getting permissions right though I think. Also, does a binary always know where it lives (across Win/Mac/Linux)?

Download-and-copy is the way. A single binary CLI can just copy over itself and exec into the new version. You can preserve the permissions of the original file. With scripting-language CLIs, you either have to deal with the module install process or use an external packaging solution.

This works pretty good, but we've ran into issues where the downloaded file isn't code signed and then this becomes a big issue. AFAIK, if this is a public CLI then homebrew will codesign for you, if you are distributing a private CLI then you need to solve the code signing issue yourself. Not many blog posts on how to handle this...

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#36
post #29

Cool. But god, the Shopify CLI / developer experience has degraded so much in the past few years. With the newest iteration, they want a full app re-structure just to work with the CLI properly. It is absolutely brutal. Sure, before they had basically no tooling, but then they had some basic ones that everyone was basically happy with, and then they just decided to iterate too much. (saying this as a ~ 8 year long Pa…

One of the things I find fascinating is that in the days where it was Liquid templates, and Vercel etc. were barely a twinkle in people's eyes, Shopify had a huge value add - that you or an app development consultancy could iterate on customizing interfaces here and there, and deploy changes from the CLI or directly on the Shopify platform, without needing to worry about deployment, payment processing, etc. But so mu…

My partner runs a medium sized ecommerce store on Shopify and her priority is having a system that is simple and stress-free.

And whilst she appreciates all of the Shopify Apps they are secondary to the fundamental process of taking, processing and shipping orders.

The key to the whole ecosystem are non-technical users like her not the app developers.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#37
post #29

Earlier quoted context omitted.

One of the things I find fascinating is that in the days where it was Liquid templates, and Vercel etc. were barely a twinkle in people's eyes, Shopify had a huge value add - that you or an app development consultancy could iterate on customizing interfaces here and there, and deploy changes from the CLI or directly on the Shopify platform, without needing to worry about deployment, payment processing, etc. But so mu…

My partner runs a medium sized ecommerce store on Shopify and her priority is having a system that is simple and stress-free. And whilst she appreciates all of the Shopify Apps they are secondary to the fundamental process of taking, processing and shipping orders. The key to the whole ecosystem are non-technical users like her not the app developers.

And people who think they will be the next big store :)

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#38

I just find working with Node to be gross. Look at this: https://github.com/Shopify/cli/blob/main/package.json but wait...this too: https://github.com/Shopify/cli/blob/main/packages/app/packag... https://github.com/Shopify/cli/blob/main/packages/cli-hydrog... https://github.com/Shopify/cli/blob/main/packages/cli/packag... https://github.com/Shopify/cli/blob/main/packages/create-app... etc, etc, etc VS https://github.…

One reason is because ruby has a large standard library. Also people just pick what they know - there are more js devs than ruby devs. Also neither ruby nor node are a good choice for a cli, so it is kind of a moo point.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#39

Cool. But god, the Shopify CLI / developer experience has degraded so much in the past few years. With the newest iteration, they want a full app re-structure just to work with the CLI properly. It is absolutely brutal. Sure, before they had basically no tooling, but then they had some basic ones that everyone was basically happy with, and then they just decided to iterate too much. (saying this as a ~ 8 year long Pa…

My read on this is they just wanted to cut out Ruby and do everything in Node. That's fine as a decision, but rest of the article feels like just trying to justify it after the fact. Like someone at the top decided, now lets pretend it's a good decision.

As you mentioned, if they're not OK with CLI, they could refactor in Ruby. The whole "embracing functional programming" and MVC architecture (i think Rails when i hear MVC) as reasons to go to Node, and not Ruby, is nuts.

If they were worried about dependencies, they'd use Rust or Go as they mentioned.

Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience

#40

Cool. But god, the Shopify CLI / developer experience has degraded so much in the past few years. With the newest iteration, they want a full app re-structure just to work with the CLI properly. It is absolutely brutal. Sure, before they had basically no tooling, but then they had some basic ones that everyone was basically happy with, and then they just decided to iterate too much. (saying this as a ~ 8 year long Pa…

Agreed. Every year or two Shopify reinvents the wheel. Ruby => Go => Rust => Node => Wasm?

It will happen again. I believe they have terrible tech leads / managers who push/approve wrong things. They also grew exponentially during the pandemic, so that grew their manager's incompetence exponentially as well.

Post reply on HN