Skip to content

Split the frontend docs into shared, Luma and Hyvä sections - #110

Open
DavidLambauer wants to merge 6 commits into
mainfrom
docs/frontend-luma-hyva
Open

DavidLambauer wants to merge 6 commits into
mainfrom
docs/frontend-luma-hyva

Conversation

@DavidLambauer

@DavidLambauer DavidLambauer commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

The frontend docs only covered Luma, although the bin/magento install wizard (since Mage-OS 3.0) recommends Hyvä. Parts were invented, and some snippets broke the storefront when copied:

  • a second ko.applyBindings(), which throws "cannot apply bindings multiple times";
  • a requirejs-config.js that overrides baseUrl and shims jQuery;
  • lodash, which Magento doesn't ship (it ships underscore);
  • x-magento-init inside a Knockout template, where it never runs;
  • a <widget> layout element that no schema allows;
  • a styles.css that nothing loads.

New structure

  • Frontend Development (shared):
    • Choosing a frontend stack (new)
    • Theme development
    • Layouts, blocks and templates
    • Widgets
  • Hyvä (new):
    • Getting started with Hyvä
    • Alpine.js components
    • Compatibility modules
  • Luma: each page is marked as Luma-only.
    • Styling Luma themes with LESS: replaces the generic Sass tutorial.
    • JavaScript in Luma themes: requirejs is merged in.
    • UI components and Knockout: knockoutjs-integration is merged in.

requirejs.md and knockoutjs-integration.md are removed, and their content is merged as listed above.

Checking

  • Luma pages: checked against the Blank/Luma themes, Magento_Ui JavaScript, the Gruntfile and the XSD files of Mage-OS 4.0.0.
  • Hyvä pages:
    • checked against docs.hyva.io and the installer code in setup/src/MageOS/Installer;
    • they link to the Hyvä docs for depth instead of copying them;
    • the commercial products (Hyvä Checkout, Commerce, UI) are described neutrally.
  • Automated checks: all XML samples validate against the 4.0.0 XSD files, and all PHP samples pass php -l on PHP 8.4.

Worth an upstream look (not changed here)

The installer's Hyvä step:

  • saves the project key as the Composer username, while Hyvä's docs use token;
  • picks the theme with LIKE '%hyva%' LIMIT 1.

The getting-started page explains the manual setup.

The layout, view and widget XML reference pages are rebuilt separately in #109.

Tested on a running store

Every command and code sample on these pages was then run on a Mage-OS 4.0.0 store in Warden (PHP 8.4, MariaDB 11.8, OpenSearch 3.4, Valkey 8.1, Varnish 8.0, RabbitMQ 4.2), and the pages were corrected wherever the store behaved differently from what the code suggested. What needs several servers or outside services was checked in the code only. For the Hyvä pages, Hyvä 1.5.5 was installed from Hyvä's public GitHub repositories; the Hyvä Packagist steps were checked against docs.hyva.io only.

Merge mage-os/devdocs-website#74 first: this pull request removes pages, and until that change is live the website answers a request for a removed page with a 500. #151 adds the redirects to the pages that replace them.

Merge order and notes for reviewers: #115.

🤖 Generated with Claude Code

DavidLambauer and others added 2 commits November 28, 2026 16:45
The frontend pages were Luma-only, partly invented, and some snippets
broke the storefront when copied: a second ko.applyBindings() call,
a requirejs-config.js that overrides baseUrl and shims jQuery, lodash
(Magento ships underscore), x-magento-init inside a Knockout template,
a <widget> layout element that no schema allows, and a styles.css
that nothing loads.

Shared pages, for every theme:
- Theme development: theme files, parent themes, per-module overrides,
  view.xml, logo settings, and applying and deploying a theme.
- Layouts, blocks and templates: the <page> root, blocks vs
  containers, $escaper, and view models.
- Widgets: creating a widget and adding it to CMS content or layout.

Luma pages, each marked as Luma-only:
- Styling Luma themes with LESS (replaces the generic Sass tutorial).
- JavaScript in Luma themes, with the RequireJS page merged in:
  init methods, requirejs-config.js with mixins, jQuery widgets, CSP.
- UI components and Knockout, with the KnockoutJS page merged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docs covered only Luma, although the bin/magento install wizard
recommends Hyvä. Add:

- Choosing a frontend stack: Hyvä vs Luma, what the installer does,
  licensing (the Hyvä theme is open source since November 2025),
  extension compatibility and checkout options.
- Getting started with Hyvä: installing with the wizard or Composer,
  a child theme, the Tailwind build, and applying the theme.
- Alpine.js components: CSP-compatible components, passing data from
  PHP, view models, section data and events.
- Compatibility modules: what makes a module Luma-only, how
  compatibility modules and the Tailwind source registration work.

The pages link to the Hyvä docs for depth instead of copying them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DavidLambauer and others added 3 commits November 28, 2026 17:28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every sample was installed in a Mage-OS 4.0.0 store and checked in a
browser. Corrections:

- ui-components: the listing used entity_id, but the table's key is
  item_id, so the grid failed with an SQL error; saved grid views keep
  the old column layout.
- css-preprocessing: the import order was wrong, and a _theme.less or
  _variables.less that isn't a copy of Luma's breaks compilation and
  removes all storefront styles; browsers keep old CSS because static
  files are cached for a year.
- theme-development: the layout sample had no visible effect in a Luma
  child; setup:upgrade stops if the preview image is missing; --theme
  also deploys parent themes unless --no-parent is given.
- javascript-in-magento-2: data-mage-init also works in CMS content;
  inline scripts are only blocked on checkout, where $secureRenderer
  adds the nonce.
- widgets: the editor's button is Page Builder's Insert Widget; the
  products list returns 500 without conditions_encoded.
- layouts-blocks-and-templates: remove and display only work on
  referenceBlock and referenceContainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregor-RW

Copy link
Copy Markdown

Overall good, few details:

  • hyva-getting-started.md line 144: only registered modules join the Tailwind build.
  • choosing-a-frontend-stack.md line 32: the installer's field names differ from Hyvä's terms.
  • hyva-getting-started.md line 217: the strict CSP test fails with the full page cache on.
  • widgets.md line 166: that error appears only in developer mode.
  • theme-development.md line 182: a layout logo_alt overrides the admin alt text.
  • css-preprocessing.md line 180: Grunt's clean task misses the folder where the preprocessed LESS files go.
  • javascript-in-magento-2.md line 111: data-mage-init does run after contentUpdated.

One more detail - removed .md file generates 404 if I understand the system? So those need some kind of redirect.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants