Giao diện
TeguNews
Công nghệ

How AI drove Shopify back to clean code

Turns out, agents just want the same things as humans: easily-readable code, explicit contracts, and helpful feedback

The Register2 phút đọc

How AI drove Shopify back to clean code

E-commerce platform Shopify wants to make reading source code a thing again. And it has an unlikely ally for its back-to-the-roots approach: AI agents. The company is launching a new storefront theme for its customers, aka “merchants,” that it claims is completely understandable by anyone with even a smidgen of HTML knowledge.

It is designed to be simpler for both people and machines to digest and hack against. Shopify hasn’t named this new theme yet, but is unveiling it in developer forums as the probable successor to Horizon, its current JSON-heavy base theme, which customers use to customize their own Shopify pages. The new code is mostly HTML, interpolated by the company’s own block-based Liquid templating language, which is also fairly easy on the eyes.

When merchants peek into the templates directory of this new theme, they will see plain-text files of easy-to-parse code, not long strings of inscrutable JSON. This theme has 93% fewer lines of code than Horizon. The company’s increasingly popular AI service is driving this rearchitecture redesign.

“Every leading model already understands HTML. It is expressive, local, and token-efficient,” wrote Ben Sehl, Shopify product director for storefronts, in a missive on X. And Shopify’s Liquid template language meshes perfectly with HTML.

From merchants to merchandisers In his post, Sehl recalled a decade ago, when he was a merchant himself, and Shopify only offered a basic template. It was easy for Sehl, then a novice web coder, to modify with a third-party starter kit. Over time, Shopify enriched the templating, allowing users to become full-fledged designers.

The Online Store Editor gave them more control over how a page and its various “block” components would look like. Every button and knob could be customized. Flexibility begets complexity, however.

The user template instructions were converted to JSON. “That trade-off gave merchants far more control, but it came with a developer-experience cost: you could no lo

Nguồn: The Register

Đọc thêm từ Công nghệ