I don't understand going from Ruby to JS. Go or Rust sure, but Node for CLI? What is gained by doing that lateral move?
Developers who'll work right out of school, is my guess. Rails is great for the people who used it during that generation, and still is, I'm told. JS offers cheaper and more plentiful talent, and doesn't require as big of a mind shift as rust. If they become more JS centric, given the overlap in JS and Rust ideology, I could absolutely see them involving Rust soon after.
From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
71–80 of 109 posts
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#72I don't understand going from Ruby to JS. Go or Rust sure, but Node for CLI? What is gained by doing that lateral move?
Tooling is much better, for starters. And they plan to use TS, not JS, did you even read the article?
The entire Node ecosystem is commonly described as a dumpster fire.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#73Cool. 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 he…
Just how complex is your command line app if you need to have multiple transitive versions of the same library?
Coming from the same company that is so heavily invested in Ruby that they contributed to a new JIT for it (YJIT), built a static type checking layer (sorbet) for it, and built a module system that prevents you sharing code between those modules (packwerk), etc.
Unrelated but it is reminding me of my attempt to integrate with Zapier. Zapier doesn't document an API anywhere, you have to use its 'CLI app'. The CLI app of course just calls undocumented HTTP APIs behind the scenes.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#74Earlier quoted context omitted.
Honest question: Why is it a bad pattern? And what are some better alternatives from other ecosystems?
The singleton pattern generally tends to be hard to write tests for. Singletons are basically a global object with static methods. The dependency injection pattern fits better. DI is basically passing around objects which conform to an interface. This way you can mock out those objects more easily.
Ruby has enough sharp knives that many patterns are pointless, or trivial enough that they're idioms instead, or that the downsides of the pattern are drastically limited.
(example: command pattern vs lambdas; delegate vs blocks)
Having singletons can make sense, if the abstraction has to be leaky...
(examples of abstractions that must be leaky: AWS vs GCP) (examples of abstractions that can be tight: Segment vs Rudderstack)
...because then you're never really in a position where you need multiple objects, or to swap out the implementing object, during production runtime. So you don't benefit much from DI on prod.
And in Ruby, when you're in the tests, there's a handful of nice and handy shenanigans you can pull to remove the downside / AKA make it trivial to mock the object.
--
AKA Ruby is flexible enough that you need DI like a contortionist needs a backscratcher.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#75Earlier quoted context omitted.
> Like someone at the top decided, now lets pretend it's a good decision. It might not even be a top thing, if they migrated internal eng from Ruby to node internally I would not be surprised if this was dev-driven either
Interesting how Shopify went from the most pro-ruby company to what looks like unreasonably rapid divestment from it. Wonder what's going on.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#76Earlier quoted context omitted.
> Like someone at the top decided, now lets pretend it's a good decision. It might not even be a top thing, if they migrated internal eng from Ruby to node internally I would not be surprised if this was dev-driven either
Interesting how Shopify went from the most pro-ruby company to what looks like unreasonably rapid divestment from it. Wonder what's going on.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#77Cool. 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…
finally, i do think it will change again because the structure for theme app extensions have changed and now i'm not even sure if my project will work if i update that section.
the migration documents are very bad and they remove old documents. for example, it used to be that you need to add a folder called `theme-app-extensions` and it's very different, and there is no migration docs for that. they just want you to use cli 3 out of the blue.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#78Earlier quoted context omitted.
Developers who'll work right out of school, is my guess. Rails is great for the people who used it during that generation, and still is, I'm told. JS offers cheaper and more plentiful talent, and doesn't require as big of a mind shift as rust. If they become more JS centric, given the overlap in JS and Rust ideology, I could absolutely see them involving Rust soon after.
If that's true that a company as big and established as Shopify can't afford to attract, onboard, and train ruby devs, it really feels like the beginning of the end for ruby.
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#79I 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.…
Re: From Ruby to Node: Overhauling Shopify’s CLI for a better developer experience
#80So who's left, basically Github?
They seem to be more involved with contributing to Ruby than any other company, contributing an incredible amount, including yjit and object shapes and more.