Skip to content

Commit 26ea596

Browse files
committed
Merge main into worktree-docs-fr-006-sweep (SpringPayloadGenerator + Python doc polish)
2 parents 1542a52 + 9c38669 commit 26ea596

42 files changed

Lines changed: 3282 additions & 375 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,48 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
77

88
## [Unreleased]
99

10+
## [0.7.0-rc.8] — 2026-05-27
11+
12+
### Fixed
13+
- **Java: generic required-attr enforcement.** Pre-rc.8, Java required-attr
14+
validation was per-subtype (an explicit block per subtype that wanted it).
15+
rc.8 adds a generic pass mirroring TS / C# / Python: any node whose schema
16+
declares `required: true` attrs that are absent on the loaded node fires
17+
`ERR_MISSING_REQUIRED_ATTR`. The previously-explicit R1 (prompt) and R1b
18+
(toolcall) blocks in ValidationPhase collapse into the generic pass.
19+
Closes a latent contract gap surfaced during the rc.7 cross-port
20+
`template.toolcall` rollout.
21+
22+
### Changed
23+
- **Hardcoded type-count guards in TS / C# tests** are now derived from
24+
the schema constants. Previously `expect(allTypes).toHaveLength(70)` (TS)
25+
/ `Core_provider_registers_exactly_70_types` (C#) bumped manually on every
26+
new subtype; now they assert each base type's subtype list directly,
27+
catching drift only where it matters (in the relevant subtype family
28+
rather than a global integer).
29+
30+
## [0.7.0-rc.7] — 2026-05-27
31+
32+
### Added
33+
- **`template.toolcall` reaches Java + C# + Python cores** — the TS port
34+
shipped the subtype in rc.5/rc.6; this release brings the other three
35+
ports to parity per ADR-0011. Same vendor-agnostic attrs (`@toolName`
36+
required, `@payloadRef` required, plus governance `@owner`/`@since`).
37+
Same "no `@textRef` requirement" — toolcalls have no renderable body.
38+
Kotlin inherits the Java port. The provider-extension conformance
39+
fixtures (which moved to `template.briefing` in rc.5) continue to gate
40+
the provider-extension contract cross-port; the new core subtype gets
41+
its own coverage in each port's unit tests.
42+
- **`registry.extend()` on Python `TypeRegistry`** (`@metaobjectsdev/metadata`
43+
Python equivalent) — closes the cross-port parity gap surfaced during
44+
rc.3 implementation. Same signature semantics as the TS and C# versions:
45+
raises `ERR_PROVIDER_ATTR_CONFLICT` on duplicate attr; `ERR_UNKNOWN_SUBTYPE`
46+
if the target (type, subType) isn't registered.
47+
48+
### Fixed
49+
- No TS source changes vs rc.6; the version bump keeps the rc.N marker
50+
aligned across the four-port release surface.
51+
1052
## [0.7.0-rc.6] — 2026-05-27
1153

1254
### Fixed

bun.lock

Lines changed: 28 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/web/bunfig.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[test]
2+
# Preload JSDOM setup so component tests have a real `document` available the
3+
# moment `@testing-library/dom`'s `screen` module is first evaluated. The
4+
# per-package bunfig.toml files cover running `bun test` from inside an
5+
# individual package; this root-level config covers running it from
6+
# client/web/.
7+
#
8+
# We reuse the react package's setup file because it already pulls JSDOM from
9+
# its own node_modules (Bun's isolated install does not hoist jsdom up to
10+
# client/web/, so a root-level setup.ts could not import it directly).
11+
preload = ["./packages/react/test/setup.ts"]

client/web/packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metaobjectsdev/react",
3-
"version": "0.7.0-rc.6",
3+
"version": "0.7.0-rc.8",
44
"description": "React runtime for metaobjects: useEntityForm hook and CurrencyInput component.",
55
"type": "module",
66
"main": "./dist/index.js",
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { JSDOM } from "jsdom";
22

3-
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
4-
global.document = dom.window.document as any;
5-
global.window = dom.window as any;
3+
// Idempotent: if a global document has already been registered (e.g. by the
4+
// client/web root bunfig.toml preload), reuse it. Replacing globalThis.document
5+
// after `@testing-library/dom`'s `screen` module is evaluated leaves `screen`
6+
// bound to the previous, now-orphaned document.body — which makes every
7+
// `screen.*` query look at an empty body.
8+
if (typeof globalThis.document === "undefined") {
9+
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
10+
global.document = dom.window.document as any;
11+
global.window = dom.window as any;
12+
}

client/web/packages/runtime-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metaobjectsdev/runtime-web",
3-
"version": "0.7.0-rc.6",
3+
"version": "0.7.0-rc.8",
44
"description": "Pure framework-agnostic browser core for metaobjects: currency, filter URL serialization, fetcher contract types.",
55
"type": "module",
66
"main": "./dist/index.js",

client/web/packages/tanstack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metaobjectsdev/tanstack",
3-
"version": "0.7.0-rc.6",
3+
"version": "0.7.0-rc.8",
44
"description": "TanStack runtime for metaobjects: EntityFetcherProvider, EntityGrid, default cell renderers.",
55
"type": "module",
66
"main": "./dist/index.js",
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { JSDOM } from "jsdom";
22

3-
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
4-
global.document = dom.window.document as any;
5-
global.window = dom.window as any;
3+
// Idempotent: if a global document has already been registered (e.g. by the
4+
// client/web root bunfig.toml preload), reuse it. Replacing globalThis.document
5+
// after `@testing-library/dom`'s `screen` module is evaluated leaves `screen`
6+
// bound to the previous, now-orphaned document.body — which makes every
7+
// `screen.*` query look at an empty body.
8+
if (typeof globalThis.document === "undefined") {
9+
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
10+
global.document = dom.window.document as any;
11+
global.window = dom.window as any;
12+
}

docs/features/templates-and-payloads.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,25 +208,34 @@ const out: string = await render({
208208
### Java
209209

210210
`metaobjects-render` ships `Renderer` + `Provider` (Classpath, Filesystem,
211-
InMemory) + `Verify`. Payload-VO codegen is **not** shipped on the Java side — host
212-
code consumes the payload as a Java `Map<String,Object>` or a hand-coded value
213-
object.
211+
InMemory) + `Verify`. `SpringPayloadGenerator` (in `metaobjects-codegen-spring`)
212+
emits a Java 21 `record` payload per template, resolving all three origin
213+
subtypes (matches the Kotlin reference). Host code may also pass a
214+
`Map<String,Object>` to the renderer if it doesn't want the generated type.
214215

215216
```java
216217
import com.metaobjects.render.*;
217218
218219
Provider provider = new FilesystemProvider(Path.of("./prompts"));
219220
String out = Renderer.render(RenderRequest.builder()
220221
.ref("lobby/welcome")
221-
.payload(Map.of(
222-
"displayName", "Ada",
223-
"postCount", 12L,
224-
"posts", List.of(Map.of("title", "Hello"))))
222+
.payload(new WelcomePayload("Ada", 12L, List.of(new PostSummary("Hello"))))
225223
.provider(provider)
226224
.format("xml")
227225
.build());
228226
```
229227

228+
```java
229+
// generated/acme/blog/prompts/WelcomePromptPayload.java
230+
public record WelcomePromptPayload(
231+
String displayName,
232+
Long postCount,
233+
java.util.List<PostSummary> posts
234+
) {}
235+
236+
public record PostSummary(String title) {}
237+
```
238+
230239
### Kotlin
231240

232241
`metaobjects-metadata-ktx` wraps `Renderer` in an idiomatic Kotlin builder.

0 commit comments

Comments
 (0)