Commit 637565e
committed
feat: add modelsdk — auto-generated, type-safe model SDK with BSON roundtrip
Add a new `modelsdk/` package that provides a fundamentally better
architecture for reading and writing Mendix MPR files compared to the
existing hand-written `sdk/` layer.
This is an additive, non-breaking change — no existing code is modified.
The new package coexists with `sdk/` to enable gradual migration.
Key improvements over current sdk/:
- 1,500+ auto-generated types across 53 Mendix domains (vs ~480 hand-written)
- Type registry with automatic init() registration (vs manual dispatch)
- Dirty tracking via bitmap + container chain propagation
- BSON roundtrip preservation — unknown fields survive read/write cycles
- Lazy decode via InitFromRaw() — zero cost for unaccessed fields
- Three-branch encoder: self-dirty / child-dirty / clean pass-through
- Property abstraction: Primitive[T], Part[T], PartList[T], Enum[T], ByNameRef[T]
- Per-property version metadata (introduced/deleted/public)
- Reference registry for cross-domain relationship tracking
Packages added:
- modelsdk/codec — BSON encoder/decoder with type registry
- modelsdk/element — Element interface with dirty tracking
- modelsdk/property — Generic property types with lazy init
- modelsdk/gen/ — 53 auto-generated domain packages
- modelsdk/mpr — MPR v1/v2 reader/writer
- modelsdk/widgets — Widget template handling
- modelsdk/meta — System module metadata
- modelsdk/version — Version compatibility info
- cmd/modelsdk-codegen — Code generator from TS SDK reflection data
- internal/codegen/dtsparser — TypeScript SDK parser
- internal/codegen/emitter — Go code generation templates1 parent d871691 commit 637565e
327 files changed
Lines changed: 198921 additions & 0 deletions
File tree
- cmd/modelsdk-codegen
- internal/codegen
- dtsparser
- emitter
- modelsdk
- codec
- element
- gen
- appservices
- authentication
- businessevents
- changedatacapture
- client
- codeactions
- connectorkit
- constants
- customblobdocuments
- customicons
- customwidgets
- databaseconnector
- datasets
- datatransformers
- datatypes
- documenttemplates
- domainmodels
- enumerations
- exceldataimporter
- exportmappings
- expressions
- images
- importmappings
- integrationoverview
- javaactions
- javascriptactions
- jsonstructures
- kafka
- mappings
- messagedefinitions
- metamodelversion
- microflows
- mlmappings
- nanoflows
- nativepages
- odatapublish
- pages
- projects
- queues
- regularexpressions
- reports
- rest
- scheduledevents
- security
- services
- settings
- texts
- url
- webservices
- workflows
- xmlschemas
- meta
- mpr
- testdata
- enumerations
- microflows
- pages
- workflows
- version
- property
- version
- widgets
- definitions
- mpk
- templates
- mendix-11.6
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments