Repository navigation
fix(shaders): keep the shader when the rounded type it swaps to is not registered - #92
Merged
Merged
Conversation
…t registered `_syncShaderType` swaps a node's rounded shader type when a border width moves to or from 0. On renderer 2.x `createShader` returns null for an unregistered type, so a `roundedWithShadow` node gaining a `$focus` border lost its shader when the app had not registered `roundedWithBorderWithShadow`; the next write then rebuilt a shader from that write's props alone, dropping the shadow. Keep the current shader and `_shaderFeatures` when `createShader` returns null (the renderer already warns naming the missing type). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chiefcll
added a commit
that referenced
this pull request
Nov 20, 2026
…rness from the 1.8 branch (#93) * docs: renderer 2.0 setup, Building for TVs, text measured before the frame From the 1.8 branch (46ba87e, 1ff8d59, a0808a0, 1e344f0, 7d2d71c and the stream T layout.md entries): - render.md and basics.md: no render or font engine to set; load an SDF font per family and register shader types; renderEngine, fontEngines and stage.shManager listed as removed in renderer 2.0. - deploy/build.md (new, in the sidebar): terser `reduce_funcs: false`. - layout.md: flex text is measured with `measure()` before the frame; points at MIGRATION-1.8.md. - virtual.md: factorScale has no effect since 1.7. - useHold.md: the release handler is `onEnterRelease`. - effects.md: a `shader` tuple's type must be registered. 1.8 said Solid registers `rounded`, which it does not: it names registerShaderType and registerDefaultShaders instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: MIGRATION-1.8.md, from 1.7.x to 1.8 What #89-#92 changed for apps, adapted from the 1.8 branch's MIGRATION-1.7.md: one flex engine and the flex fixes B5-B12, text sized before the frame and laid out eagerly, one reactive flush per focus change, States changes and B2, diffed state application and per-object style caching, the Row/Column transition cache, B19 draw order, B20, and the terser build setting. Left out, as 1.7.x already shipped them: the renderer 2.0 breaks, the renderEngine/fontEngines/shManager absorption, B1, B3, B4, B13-B17, B21 and the Virtual/VirtualGrid layout changes. Each entry keeps what changes and the upgrade step; the measurements stay in docs/perf/log.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(perf), bench: the 1.8 rewrite's design, measurements and harness From the 1.8 branch: - docs/perf: the methodology (README), the log, the Phase 0 profiles and summaries, the Checkpoint 2 series summary, the route timings, the survey verification and the text-flex alternatives study. The raw per-run JSON records are left out, as .gitignore already says; their summaries are committed. - docs/superpowers: the design, the Phase 2 plan, the Checkpoint 2 report and the renderer proposals (the rewrite brief is already on main). - bench: the demo-app route timing and bundle scripts (bench/demo), the renderer v2 arm, and the harness fixes. - .gitignore: bench/.results-tmp and .superpowers. The log notes that this work was named 1.7 on the branch and shipped as 1.8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
ElementNode._syncShaderTypeswaps a node's rounded shader type (ROUNDED_SHADER_TYPES) when a border width moves to or from 0 (#73). On@solidtv/renderer2.x,createShaderreturnsnull(with a warning) for a type that isn't registered.So when an app registers only some types (the demo registers
rounded,roundedWithBorder,roundedWithShadow,linearGradient), aroundedWithShadownode that gains a border (e.g. a$focusborder) swaps to the unregisteredroundedWithBorderWithShadow.this.lng.shaderbecomesnull, and the next write rebuilds a shader from that write's props alone. The shadow is lost; in the WebGL test the node ends up on a plainRoundedshader.Fix
When
createShaderreturnsnull,_syncShaderTypenow keeps the current shader and leaves_shaderFeaturesunchanged. The node keeps its radius and shadow but draws no border, which matches the app's registrations.There's no Solid-side warning: the renderer already logs
Shader type roundedWithBorderWithShadow is not registeredon each attempt, which names the type.Test
tests/webgl/border-shader.test.tsxnow registers onlyrounded,roundedWithBorderandroundedWithShadow(the file's existing tests need only the first two). A new test toggles a$focusborder twice on aroundedWithShadownode and checks that the shader object stays the same, with its radius and shadow props intact. It fails onmain(the shader is replaced by aRoundedone) and passes with the fix.This fix lives in Solid itself. #91 instead worked around the same failure in its test by registering
roundedWithBorderWithShadow. Both PRs edit the shader code inelementNode.ts, so expect a small conflict with whichever merges second.Verification
npm run tsc: passnpm run lint: pass (existing warnings only)npm test: 751 passed, 1 skippednpm run test:webgl: 39 passed🤖 Generated with Claude Code