Deprecate theme app extension

Hi there

I was wondering, is there a way to deprecate some theme app extension blocks?

Over the years I’ve replaced some old blocks with new ones. The old ones should no longer be used so I’ve added ‘DEPRECATED” to the block settings but some customers don’t read and still end up adding these blocks. Is there a way to deprecate blocks without affecting these customers? E.g. if you have the old block, you still see it, but new customers won’t and if you remove the block, you can only add the non deprecated blocks.

1 Like

I really wish there was a way to do this, it would make our life 100% easier.

It seems the only way is to use app owned metafields, but the schema only works if the value is true:

{% schema %}
 {
   "name": "Conditional App block",
   "target": "section",
   "stylesheet": "app.css",
   "javascript": "app.js",
   "available_if": "{{ app.metafields.conditional.block1 }}",
   "settings": [
      {
        "label": "Colour",
        "id": "colour",
        "type": "color",
        "default": "#000000"
      }
   ]
 }
{% endschema %}

If it there was something like available_unless it would solve this problem, but I don’t think they will ever implement that feature.

I recommend using app-owned metafields to display a deprecation message in the theme editor before using available_if. When available_if removes existing app blocks from themes, it can confuse merchants if their blocks disappear without warning.

That being said, better native support for deprecating older app blocks would be an ideal app developer and merchant experience. I’ll put this down as a feature request so we can look into this. Thank you both for the insight!