refactor(rendering)!: v0.15 Welle 1 — Text ctor → (text, options) (3c)#165
Merged
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Welle 1 — Slice 3c (API-Konsistenz, breaking)
Collapses the 4-positional
Textctor(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 aTextStyleinstance as the 2nd arg are removed. Migrate layout/flag keys into the single options object; assign a pre-builtTextStyleviatext.style = …after construction.Spec-Korrekturen (gegen 02-api-konsistenz §3c)
GameOverScene/GameScene/AudioReactiveScenesind 2-Arg → keine Migration (Spec nannte GameOverScene als 3-Arg).new TextStyle(...).clone()-Templates → plainTextStyleOptions) +webgpu-backend.test/text.test. Alle migriert.fill:/wordWrap:-Falschnamen dort sind vorbestehend, separat).Migration
Text.ts(TextOptions + ctor),public.ts(Export)coreSerializers,PerformanceLayer/PointerStackLayer/RenderPassInspectorLayer.js-mirrors (examples:sync)text.mdxregeneriert; type-inventory-Snapshot +=TextOptionsVerifikation (lokal, CI-Parität)
typecheck✓ ·typecheck:examples✓ ·lint:strict+lint✓ (0 errors) ·format:check✓ ·docs:api:checkin sync ✓ ·test:core✓ (2403 Tests). Browser-Tests + Pakete (durch 3c unberührt) via CI.