Skip to content

refactor(rendering)!: v0.15 Welle 1 — Text ctor → (text, options) (3c)#165

Merged
Exoridus merged 1 commit into
mainfrom
feat/v0.15-w1-3c-text-ctor
Jun 23, 2026
Merged

refactor(rendering)!: v0.15 Welle 1 — Text ctor → (text, options) (3c)#165
Exoridus merged 1 commit into
mainfrom
feat/v0.15-w1-3c-text-ctor

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

Welle 1 — Slice 3c (API-Konsistenz, breaking)

Collapses the 4-positional Text ctor (text, style?, layout?, flags) into (text, options: TextOptions), the last remaining 4-positional public-API outlier.

TextOptions extends TextStyleOptions, LayoutOptions { colorGlyphs?; sdfRadius? } — the two source interfaces share no keys, so the existing 2-arg call sites (new Text('x', { fontSize })) stay source-compatible. Only 3rd/4th-positional callers migrate.

BREAKING: new Text(text, style, layout, flags) and passing a TextStyle instance as the 2nd arg are removed. Migrate layout/flag keys into the single options object; assign a pre-built TextStyle via text.style = … after construction.

Spec-Korrekturen (gegen 02-api-konsistenz §3c)

  • GameOverScene/GameScene/AudioReactiveScene sind 2-Arg → keine Migration (Spec nannte GameOverScene als 3-Arg).
  • TextStyle-Instanz im 2. Arg existiert doch (Spec: „0 Treffer"): 3 Debug-Layer (new TextStyle(...).clone()-Templates → plain TextStyleOptions) + webgpu-backend.test/text.test. Alle migriert.
  • Guide-Snippets sind alle 2-Arg → keine 3c-Migration (die fill:/wordWrap:-Falschnamen dort sind vorbestehend, separat).

Migration

  • Text.ts (TextOptions + ctor), public.ts (Export)
  • intern: coreSerializers, PerformanceLayer/PointerStackLayer/RenderPassInspectorLayer
  • examples (4) + committed .js-mirrors (examples:sync)
  • tests (text.test, webgl2-text-layout, webgpu-backend); text.mdx regeneriert; type-inventory-Snapshot += TextOptions

Verifikation (lokal, CI-Parität)

typecheck ✓ · typecheck:examples ✓ · lint:strict+lint ✓ (0 errors) · format:check ✓ · docs:api:check in sync ✓ · test:core ✓ (2403 Tests). Browser-Tests + Pakete (durch 3c unberührt) via CI.

…1 3c)

The 4-positional `Text` ctor (text, style?, layout?, flags) becomes
`(text, options: TextOptions)` where
`TextOptions extends TextStyleOptions, LayoutOptions { colorGlyphs?, sdfRadius? }`.
The two source interfaces share no keys, so the existing 2-arg call sites
(`new Text('x', { fontSize })`) stay source-compatible; only 3rd/4th-positional
callers migrate.

BREAKING: `new Text(text, style, layout, flags)` and passing a `TextStyle`
instance as the 2nd arg are removed. Migrate layout/flag keys into the single
options object; assign a pre-built TextStyle via `text.style = style` after
construction.

- Text.ts: TextOptions interface + new ctor; public.ts exports TextOptions.
- Internal callers migrated: coreSerializers (3rd/4th arg) and the three debug
  layers, which used `new TextStyle(...).clone()` templates -> plain
  TextStyleOptions objects (each Text builds its own style internally).
- Migrated examples (multiline-and-wrap, typewriter-text, dialog-system,
  asset-browser) + committed .js mirrors via examples:sync.
- Tests migrated (text.test, webgl2-text-layout, webgpu-backend); text.mdx
  regenerated; root-index type-inventory snapshot adds TextOptions.

Spec: .workspace/specs/v0.15-hardening/02-api-konsistenz.md (3c)
@Exoridus Exoridus enabled auto-merge (squash) June 23, 2026 15:49
@Exoridus Exoridus merged commit 999bb67 into main Jun 23, 2026
12 checks passed
@Exoridus Exoridus deleted the feat/v0.15-w1-3c-text-ctor branch June 23, 2026 15:54
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.

1 participant