Adopt @screenly-labs/signage-kit for degraded mode - #15
Merged
Conversation
Replace the inlined degraded-mode plumbing (support floor, CSS down-level recipe, JS bundler, inline gate, replaceChildren shim, html.legacy kill-switch) with the shared package (github:Screenly-Labs/signage-kit#2026.7.0). Build output verified equivalent: kill-switch present, 0 @layer, 0 :lang(), es2017. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the app’s “degraded mode” implementation (legacy/slow-device gate, CSS kill-switch, JS polyfills, and build plumbing) to the shared @screenly-labs/signage-kit, aligning this worker with the fleet-wide degraded-mode behavior while keeping the rendered output equivalent.
Changes:
- Replace the inlined degraded-mode
<script>gate with the sharedGATEHTML snippet from@screenly-labs/signage-kit. - Swap local asset build steps (JS bundling + CSS processing) to
signage-kit’s build helpers. - Remove app-local degraded-mode CSS kill-switch rules and the local
replaceChildrenpolyfill file in favor of shared implementations.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/Layout.tsx | Uses @screenly-labs/signage-kit/gate to inject the shared degraded-mode gate before the stylesheet. |
| build.ts | Replaces in-repo JS/CSS build plumbing with signage-kit’s bundleJs and processCss helpers. |
| assets/static/js/main.ts | Switches the first-import polyfills side effect to @screenly-labs/signage-kit/polyfills. |
| assets/static/js/polyfills.ts | Removes the local replaceChildren shim now provided by the shared kit. |
| assets/static/styles/main.css | Removes the app-local html.legacy kill-switch block, documenting that the shared build step prepends it. |
| package.json | Adds @screenly-labs/signage-kit dependency (GitHub ref) and removes the top-level browserslist config field. |
| bun.lock | Locks the newly added @screenly-labs/signage-kit dependency resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fleet-wide adoption: this Cloudflare Worker app now consumes
@screenly-labs/signage-kit(github:Screenly-Labs/signage-kit#2026.7.0) instead of its inlined degraded-mode plumbing (support floor, CSS down-level recipe, JS bundler, inline gate, replaceChildren shim, html.legacy kill-switch).Behaviour is unchanged and build output verified equivalent: kill-switch present, 0
@layer, 0:lang(, client JS es2017. typecheck + lint + tests pass. Committed CSS source is the readable form (build minifies in place);main.jsstays a gitignored artifact.