refactor(types): tighten type safety, dedupe HfTransitionMeta, prune dead LUT export#366
refactor(types): tighten type safety, dedupe HfTransitionMeta, prune dead LUT export#366vanceingalls merged 2 commits intomainfrom
Conversation
b54f075 to
46510f3
Compare
a54acd2 to
ebe1483
Compare
46510f3 to
4cfb72e
Compare
jrusso1020
left a comment
There was a problem hiding this comment.
Clean dedupe + hygiene. HfTransitionMeta was genuinely declared twice in the same file (the second declaration a duplicate of the first) — Typescript accepted it because the shapes matched but any future drift would have been a silent landmine. Pruning getSrgbToHdrLut from the package exports is fine — the LUT tables are still used internally via the two cached instances. The for..of entries() refactor in renderOrchestrator reads equivalently and avoids the non-null assertion.
One substantive note worth calling out: the comment you added on the shader-transitions local HfTransitionMeta ("Locally redeclared because @hyperframes/shader-transitions ships as a standalone CDN bundle and must not depend on @hyperframes/engine") is load-bearing. That kind of "this is the shape contract between two packages that deliberately don't share types" gotcha is exactly the thing that rots silently unless it's documented in code. Glad it's pinned in the diff.
Approved.
— Rames Jusso
640cc95 to
57d7248
Compare
04e4040 to
b03abc3
Compare
|
Thanks. The local-redeclare comment on |
b03abc3 to
632e75f
Compare
b40c8cb to
bb9f830
Compare
3734a6c to
e9cfefd
Compare
bb9f830 to
c1d6281
Compare
c1d6281 to
edea17b
Compare
e9cfefd to
8c73295
Compare
edea17b to
fb5966b
Compare
8c73295 to
8d3b778
Compare
fb5966b to
903dea1
Compare
8d3b778 to
3495f7a
Compare
903dea1 to
949e87b
Compare
7334041 to
6b49885
Compare
5a76392 to
d315596
Compare
6b49885 to
35b9f0a
Compare
d315596 to
390db46
Compare
35b9f0a to
bfbc709
Compare
390db46 to
49c7c80
Compare
…dead LUT export Four focused cleanups across engine, producer, and shader-transitions. * renderOrchestrator: replace `layers[layerIdx]!` non-null assertion with `for (const [layerIdx, layer] of layers.entries())` so both index and element come from the iterator and the assertion goes away. * engine/types.ts: remove duplicate `HfTransitionMeta` interface that arrived as a rebase artifact; the original definition above it is the one with documentation. The orphaned doc comment now correctly precedes `HfProtocol`. * shader-transitions/hyper-shader.ts: keep the local `HfTransitionMeta` declaration (the package ships as a standalone CDN bundle and must not depend on @hyperframes/engine) but add a sync comment pointing at the source-of-truth definition in engine/src/types.ts. * alphaBlit.ts + engine/index.ts: drop `export` from `getSrgbToHdrLut` and remove its re-export. It was only ever called by the internal `blitRgba8OverRgb48le`; the public surface was dead code. Verified with `bun run --filter @hyperframes/engine typecheck`, `bun run --filter @hyperframes/producer typecheck`, `bun run --filter @hyperframes/shader-transitions typecheck`, and `bun run --filter @hyperframes/engine test` (308 pass).
bfbc709 to
d7c1050
Compare
49c7c80 to
a9f4fad
Compare
Merge activity
|

Summary
Four small, mechanical type-safety cleanups across
engine,producer, andshader-transitions. Zero behavior change — pure pre-cleanup so the rest of the stack ships against a tighter baseline.Why
Chunk 6ofplans/hdr-followups.md. Several non-null assertions and a duplicate interface had accumulated as rebase artifacts and leftover work-in-progress; lands first because it touches files later chunks edit and removes friction during review.What changed
renderOrchestrator.ts: replacelayers[layerIdx]!with afor (const [layerIdx, layer] of layers.entries())so both index and element come from the iterator.engine/types.ts: drop the duplicateHfTransitionMetainterface (rebase artifact); the original definition above it is the documented one. The orphaned doc comment now precedesHfProtocol.shader-transitions/hyper-shader.ts: keep the localHfTransitionMetadeclaration (the package ships as a standalone CDN bundle and must not depend on@hyperframes/engine), but add a sync comment pointing at the source of truth inengine/src/types.ts.alphaBlit.ts+engine/index.ts: dropexportfromgetSrgbToHdrLutand remove its re-export. It was only ever called by the internalblitRgba8OverRgb48le; the public surface was dead code.Test plan
bun run --filter @hyperframes/engine typecheckbun run --filter @hyperframes/producer typecheckbun run --filter @hyperframes/shader-transitions typecheckbun run --filter @hyperframes/engine test— 308/308 pass (no test changes; assertions removed in code only).Stack
Chunk 6 of
plans/hdr-followups.md. Mechanical cleanup landed early per the suggested merge order.