Skip to content

Rewrite the remaining architecture, extension, reference and operations pages - #113

Open
DavidLambauer wants to merge 8 commits into
mainfrom
docs/rewrite-remaining-pages
Open

DavidLambauer wants to merge 8 commits into
mainfrom
docs/rewrite-remaining-pages

Conversation

@DavidLambauer

@DavidLambauer DavidLambauer commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

The last batch from the content audit: the 14 pages that were still the original AI text. Every page was checked against the Mage-OS 4.0.0 code. There is one commit per group.

This PR only changes page content. It keeps every slug, creates or deletes no pages, and doesn't touch the nav, so it merges independently of #108–#112.

Architecture and development basics

  • Architectural overview: the old page claimed Magento has annotation-based DI. The rewrite covers the layers, areas, DI through di.xml, the extension mechanisms and the request flow.
  • Component types: the real directory trees. web/ lives in view/<area>/web, and commands are defined in modules.
  • Getting started with development: four samples crashed and are fixed:
    • a _coreRegistry that Template doesn't have;
    • a missing import;
    • an undefined variable;
    • a theme without theme.xml.
  • Service contracts: adds the di.xml preference the old page left out.
  • Data interfaces and models: defines the constants the model uses (the old page referenced an undefined self::ID), and adds the resource model, collection and extension attributes.

Extensions, secure coding, references

  • Create and package an extension:
    • composer.json, registration.php and module.xml;
    • distribution with Composer, and how Mage-OS packages replace the magento/* names;
    • fixes the CLI, layout and "override by subclassing" samples.
  • Extension best practices: a checklist using declarative schema and patches instead of InstallSchema.php.
  • Secure development: a checklist for module code:
    • form keys, escaping, ACL and bound SQL;
    • allowlist input validation, CSP and encrypted config;
    • no superglobals.
  • Glossary: Mage-OS terms instead of PHP basics.
  • Coding standards: phpcs --standard=Magento2 from mage-os/magento-coding-standard instead of PSR12/ECGM2.

Troubleshooting, performance, scalability, tutorial

  • Troubleshooting: the failures people actually hit on 4.0:
    • the search engine;
    • the database version;
    • the document root;
    • permissions, without 777;
    • memory limits from the shipped ini files.
  • Performance: fixes the samples that broke things:
    • two caches sharing one Redis database;
    • a query on a customer_id column that doesn't exist;
    • arrays cached without serializing them.
  • Scalability:
    • a load balancer snippet that doesn't loop on redirects;
    • remote media storage;
    • a note that read/write DB splitting is Adobe Commerce-only.
  • Product links tutorial:
    • rebuilt as Vendor_CustomProductLink with frontend output, and no calls to methods that don't exist;
    • the cache bug that showed the first product's links on every product is fixed;
    • Save & Duplicate no longer crashes, and the copy keeps its accessories;
    • testing on a real store showed that the provider lost every accessory whenever a product was saved without its links, for example by a REST price update. It now caches the links on the product, like the core link types do, and the page explains why.

All XML samples validate against the 4.0.0 XSD files, and all PHP samples pass php -l on PHP 8.4.

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.

Follow-ups after #108–#112 merge

  • Update the nav labels that still say "Magento 2", for example "Developing extensions in Magento 2" and "Magento 2 coding standards". Changing them here would conflict with lines the other PRs touch.
  • Cross-link to the new pages (production-deployment, create-a-web-api-endpoint, the Hyvä section).

Merge order and notes for reviewers: #115.

🤖 Generated with Claude Code

DavidLambauer and others added 3 commits November 28, 2026 18:07
- Architectural overview: layers, the six areas, dependency injection
  through di.xml (there is no annotation-based DI, as the page
  claimed), the extension mechanisms and the request flow from
  pub/index.php to the response.
- Component types: the five component types registered with
  ComponentRegistrar and their real directory trees (web/ lives in
  view/<area>/web; commands are defined in modules).
- Getting started: fix the samples that crashed (a block reading a
  _coreRegistry that Template doesn't have, a missing import, an
  undefined $product, a theme without theme.xml).
- Service contracts: add the di.xml preference the page left out; it
  claimed that matching namespaces were enough.
- Data interfaces and models: define the constants the model uses (the
  old sample referenced an undefined self::ID) and add the resource
  model, collection and extension attributes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Create and package an extension: composer.json, registration.php,
  module.xml and distribution with Composer, including how Mage-OS
  packages replace the magento/* names. Fix the CLI sample (missing
  imports, execute(): int), the layout sample (product.info.price is a
  container) and "override by subclassing".
- Extension best practices: a checklist with the real register()
  signature, constructor injection only, and declarative schema with
  patches and the whitelist instead of InstallSchema.php.
- Secure development: a checklist for module code (form keys, escaping,
  ACL, bound SQL, input validation, CSP, encrypted config) instead of
  plain-PHP $_POST samples and a FilterManager filter that doesn't
  exist.
- Glossary: Mage-OS terms instead of PHP basics; the plugin example
  now uses afterGetName().
- Coding standards: phpcs --standard=Magento2 from
  mage-os/magento-coding-standard instead of PSR12 and ECGM2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he product links tutorial

- Troubleshooting: the failures people hit on Mage-OS 4.0 (search
  engine, database version, document root, permissions without 777,
  memory limits from the shipped ini files, static content deploy).
- Performance: production mode, OPcache, Varnish, Valkey/Redis,
  indexers and queues. Fix the samples that shared one Redis database
  between caches, queried a customer_id column that doesn't exist and
  cached arrays without serializing them.
- Scalability: several web nodes, shared or remote media storage, a
  load balancer snippet that doesn't cause a redirect loop, and the
  note that read/write database splitting is Adobe Commerce-only.
- Product links tutorial: rebuilt as Vendor_CustomProductLink with
  frontend output; it no longer calls methods that don't exist or
  shows the first product's links on every product.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidLambauer
DavidLambauer requested review from a team as code owners November 28, 2026 17:07
DavidLambauer and others added 2 commits November 29, 2026 00:17
…hem on Mage-OS 4.0.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng them on Mage-OS 4.0.0

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

Copy link
Copy Markdown

The content is accurate. Four reviews checked it against the 4.0.0 code and found one broken step and a few small errors. Read as an AI would read it, the larger problem is repetition. Module setup (registration.php, module.xml, composer.json) appears on 5 pages, with identical code on 3 of them.

  • Broken: chgrp -R www-data . fails unless the owner is in www-data.
  • Wrong: cache:flush no longer runs FLUSHDB in 4.0.0.
  • The scalability page's Varnish access list blocks purges from a cron node.
  • In the tutorial, getLinkType() works only because the type name and code match.
  • Also repeated: the same ItemInterface sample and the Valkey warning appear twice each.
  • Only 6 of the 14 pages name 4.0, and no page has version metadata.

DavidLambauer and others added 2 commits November 30, 2026 09:29
…ting them on Mage-OS 4.0.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on Mage-OS 4.0.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t does

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