Skip to content

Unified Schema Registry: replace TS reflection + supplements + embedded widget templates #529

@ako

Description

@ako

Summary

Replace the current three-system metadata layer (TS-derived reflection data,
hand-maintained supplements.json, embedded widget templates) with a single
Schema Registry sourced empirically from mx dump-mpr (platform schemas)
and .mpk XML (widget schemas). Drives serialization, validation, inspection,
keyword dispatch, LSP, skills generation, and migration tooling end-to-end.

Full design: docs/11-proposals/UNIFIED_SCHEMA_REGISTRY.md

Supersedes #335 (kept for context).

Motivation

  • Confusion: Today DATAGRID always picks the native builder, regardless
    of project version. On Mendix 11+ users want the pluggable variant.
  • Stale data: TS reflection is frozen at 11.6; supplements.json is
    hand-maintained; embedded widget templates are one-version snapshots.
  • Lost expressiveness: Widgets with object-list properties (Accordion
    groups, PopupMenu items, AreaChart series) are non-functional via the
    current pluggable engine.
  • No version awareness: A script that writes valid BSON for 10.24 silently
    produces wrong BSON for 11.9.

Phases

  • Phase 1 — mxcli schema extract platform

    • Wraps mx dump-mpr against blank .mpr per Mendix version
    • Outputs {version}-platform.json (types, storage names, list encodings,
      ref kinds, defaults, System module)
    • Embed ~15 LTS/MTS versions; downloadable for the rest
    • Validate by structural diff vs current reference/mendixmodellib/reflection-data/
  • Phase 2 — mxcli schema extract widgets

    • Parse .mpk ZIP + {Widget}.xml into full property tree
    • Capture object-list sub-property trees
    • Cache at ~/.mxcli/widget-schemas/{widgetId}@{version}.json
    • Drop sdk/widgets/templates/, sdk/widgets/augment.go, .mxcli/widgets/*.def.json
  • Phase 3 — Registry runtime (mdl/backend/schema/)

    • Registry, TypeSchema, PropertySchema, WidgetSchema, KeywordMapping
    • Wire writer (completeness check) + reader (tolerant parse)
    • Drop supplements.json, reference/mendixmodellib/reflection-data/,
      sdk/mpr/system_module.go
    • CLI: mxcli schema list/show/diff
    • Catalog tables: schema_types, schema_properties, schema_keywords
  • Phase 4 — Native/pluggable dispatch + object lists

    • Replace hardcoded case \"datagrid\" etc. with Registry.LookupKeyword(kw, version)
    • Grammar/visitor/executor support for object-list child block syntax
      (group, item, series, marker from widget schema)
    • Migrate static keyword builders to thin wrappers over registry
  • Phase 5 — Workflow integration

    • mxcli init runs Phases 1+2 extraction
    • refresh catalog re-runs Phase 2 on .mpk changes
    • mxcli check validates property bindings, version compatibility, BSON drift
    • mxcli check --post-migration, mxcli upgrade pages, mxcli upgrade widgets
    • LSP wiring: completion, hover, diagnostics from registry
    • Skills regeneration from registry
    • mxcli syntax topics gain "see also: `schema show `" links

Acceptance criteria

  • The same MDL script produces native DATAGRID BSON on Mendix 10.24 and pluggable
    Datagrid BSON on 11.9, both opening cleanly in Studio Pro.
  • Accordion group, PopupMenu item, Maps marker all work via MDL.
  • mxcli check rejects writes that target properties unavailable in the project's
    Mendix version, with actionable hints.
  • mxcli widget upgrade <widget> auto-fixes additive-safe drift, flags everything else.
  • All sdk/mpr/ writer paths consume Registry; no subsystem reads reflection-data
    or supplements.json directly.

Non-goals

  • Replicating Studio Pro's project-upgrade transformations
  • Pinning a project to multiple Mendix versions simultaneously
  • Predicting changes for unreleased Mendix versions

Risks

  • mx dump-mpr JSON format stability across Mendix versions
  • Widget XML schema drift across versions
  • Performance of registry construction at every CLI invocation (mitigation: lazy load + binary cache)

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions