Live data from Hacker News

What I wish I knew before building a Shopify App

ma.ttias.ch

121–130 of 175 posts

Re: What I wish I knew before building a Shopify App

#121
post #66

Earlier quoted context omitted.

Python is a great language for other reasons. Forcing you to indent isn't one of those reasons.

The statement wasn't on greatness. The statement was on "never good." I think the programming community largely agrees that indenting is good. If something is forcing you to do something that is good, then it definitely doesn't fall into the category of "never good." I can't think of a single time in the nearly 10 years of using Python daily that made me want it to operate differently w.r.t. indenting.

When you're testing fragments of code by copying from one place to another to run, such as just pasting directly into a shell, indenting is an unnecessary hassle.

Re: What I wish I knew before building a Shopify App

#122
>Integration with the shop frontend is difficult if you're not making a theme

As someone on the opposite end of this problem (I'm in custom theme development), the client wanting to install a new app is an immediate source of frustration for reasons almost completely out of your or their control.

If your app just gives us a manual install option, that's usually the best solution for me. I can make judgments as a developer as how best to incorporate your app into my theme. Furthermore, because I'm doing it manually, I get to follow all of my version control and testing practices. You see, Shopify actually promotes some very terrible development practices (not your fault). I have to avoid that by working in development themes, storing all my code in a self-hosted Git repository elsewhere, tagging all my production deploys, and using Git to tell me what files have been changed so I can be ultra-conservative in my deploys. Why do I need to do that? Well...

Some apps have automatic installers, which try to guess what theme you're using and then install files as they wish to the current production theme. Not only is that dangerous (what if the app breaks something?), even if the app does install correctly; it usually doesn't hit the developer themes and any developer working out of the Git tree is now working with stale files. I have to pull theme exports and compare changes to reverse-engineer what was added so that we don't wind up accidentally uninstalling half the app when we change a product template or something.

Part of the problem is that Shopify is specifically designed to be both "easy to use" and give it's merchants a high level of control over their storefront. This precludes a lot of otherwise obvious solutions to this problem, for various reasons:

1. You can't use Git as a deployment mechanism because it has a terrible UX and most new merchants aren't going to figure out how to use it. Even with a non-terrible UX you still need to educate users about it's various failure modes, including merge conflicts and the like. 2. It would be nice to have standard extension points between app and theme developers, but that winds up tying the hands of both a little. Part of the problem is that any level of extensibility also either takes things out of the hands of theme developers, or requires new users understand how to implement the component. I was hoping something like the new section system (which I haven't gotten a chance to play around yet) would fix this for app developers.

If Shopify was willing to go a little bit up-market (and, given how they've become the favorite platform of Facebook scammers, they should) they could fix these problems by offering ways for theme and app developers to agree on specific extension points. This kind of ruins the whole "just edit this template to get a thing on your theme" aspect of it, but Shopify's really outgrowing what it started with IMHO.

(By the way, there's a special circle of hell reserved for page builder apps that store everything in the current production theme. I recently had to deal with a client whose shop no longer allowed them to clone their main template as it was full of literally hundreds of templates and assets from this one app. After literal hours of manual garbage collection, I was able to get it to the point where a theme clone merely took 20 minutes rather than failing outright.)

Re: What I wish I knew before building a Shopify App

#123
post #86

Earlier quoted context omitted.

One thing with Shopify that drives the high abandonment rate is that shipping rates are usually not calculated until the second page of checkout. On many stores the only way to get a shipping estimate is to add something to a cart and get to the second page of checkout.

This is huge - and annoying. I like to avoid Amazon when I can, but if I can't figure out what shipping is going to cost until the cart is almost finished being checked out, I'll bounce.

In small business stores most users checkout as guests, so the website only has enough info to provide a shipping estimate after they have your address.

Re: What I wish I knew before building a Shopify App

#124

I'm reading a good number of the comments and while I understand it's not a sample without bias, I have to ask: How did Shopify get to be the beast that it is? Why doesn't someone else step up and into what looks like a massive opportunity, especially since Covid have push so many transactions online? I have worked with Shopify customizing themes and adding custom functionality. It good when it great and you're withi…

There are a lot of options in e-commerce, all of them with thousands of shops: WooCommerce, Magento, Jumpseller, Bigcommerce, Prestashop, Wix WooCommerce etc...

Re: What I wish I knew before building a Shopify App

#125

I've been building Shopify apps for around 5 years now, and have 4 apps with around 15k users. I feel the pain this author feels with some additional notes.. Our apps are built in PHP using the polaris.css for styling components. We have some embedded apps currently (before Shopify began requiring the session token). Personally, the embedded experience is only good for simpler apps. If your app is more complex with l…

Would you mind sharing how profitable your apps are? Do you think that a Shopify app is a good side-hustle for an experienced engineer?

Re: What I wish I knew before building a Shopify App

#126

I built a print-on-demand system that integrates into Shopify stores. To vent a little... * I can concur that their API is unreliable. About 1 in 5 of my CI runs fail with mysterious 500 errors. It's infuriating. * The support channels are a wasteland. Do not expect help. * The documentation is super thin. At first glance it looks decent - there's the objects, there's the fields those objects have. But it's missing a…

The inconsistency thing is likely just different teams/people working on the API.

I’d bet very few people who work there know all the APIs that exist.

Re: What I wish I knew before building a Shopify App

#127
post #76

Earlier quoted context omitted.

> `import shopify` makes an API request. Especially for a company that prides itself on great API design, this is head scratching. ‘shopify.Init()’ seems like such an obvious solution

The fact that you can have side effects on imports, and that a lot of libraries relied on side effects on import, was one of my biggest sources of frustration with Python

Is there any real way around that? The import keyword might as well be renamed to exec.

Re: What I wish I knew before building a Shopify App

#128
post #98

Earlier quoted context omitted.

Handroll marshalling for every payload, handle the auth sequence, check arguments, endpoint semantics, sort out sparse versus full entity patching mismatch, build in retry that matches status codes, and do this for every endpoint. If you're moving fast, you don't have time for this. Especially if it isn't your core competency / core product.

> sort out sparse versus full entity patching mismatch I thought we are talking about Shopify... where people browse and search products, buy products, make a transaction, and review past orders/invoices/transactions. Where does PATCH fit?

Shopping cart is an obvious one.

Re: What I wish I knew before building a Shopify App

#129
post #95

We've just started developing a Shopify integration and used their Python API library because we're building it into an existing large Django codebase, and I've been shocked at the quality of the API library. We're now aiming to rewrite the bits we need. - `import shopify` makes an API request. If their API rate limits you, your server will probably crash. This happened to us in production. - That API request gets a…

I don't really understand why developers use SDKs/libraries at all when the RESTful APIs are easy enough to consume directly.

One word answer: Types.

If you dont use a language with strong type safety the benefits are less.

For instance the OpenAPI3 (Swagger-NG) standard. It allows the typing/schema'ing of the JSON bodies. It also provides a bunch of generators[1] that can be used to generate client libs. And when the languages of the client libs permit it, those libs come with lots of type safety and greatly reduce boilerplate.

1: https://openapi-generator.tech/docs/generators/

Re: What I wish I knew before building a Shopify App

#130
post #76

Earlier quoted context omitted.

The fact that you can have side effects on imports, and that a lot of libraries relied on side effects on import, was one of my biggest sources of frustration with Python

What other packages have you seen abusing import side effects? Shopify is the first one I've seen, so I don't think it's quite as common as you are implying, but I'm curious to know what other bad behavior you have found

Sometimes libraries do a switcheroo where they run interpreted code on startup to locate the "real" implementation in a shared object, and then load that and replace themselves with it. I'm not sure this is really idomatic, but here's an example of what it looks like from OpenCV:

https://github.com/opencv/opencv/blob/master/modules/python/...

Post reply on HN