Adopt @screenly-labs/signage-kit for degraded mode - #10
Merged
Conversation
Replace world-clock's inlined degraded-mode plumbing with the shared package
(github:Screenly-Labs/signage-kit#v0.1.1):
- build.ts: use the kit's bundleJs({ format: 'esm' }) (world-clock loads the
bundle as a module) + processCss({ includeDegraded: true }) + injectGate,
dropping the local esbuild/Lightning-CSS/browserslist wiring.
- main.ts: import the shared polyfills shim; delete the local polyfills.ts.
- package.json: drop the local browserslist field; add the kit dependency.
The app-specific container-query (cqw) clock fallback stays in the app CSS.
Build output verified equivalent: 0 @layer, kill-switch present, 0 :lang(),
gate injected, @supports-not(container-type) fallback intact, JS 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 and build plumbing to the shared @screenly-labs/signage-kit package, removing the in-repo implementations while keeping app-specific styling behavior in place.
Changes:
- Replace the local
replaceChildrenshim with@screenly-labs/signage-kit/polyfills. - Switch the build pipeline to
@screenly-labs/signage-kit/buildfor JS bundling, CSS processing (including degraded kill-switch prepend), and HTML gate injection. - Remove the inlined degraded-mode gate from
index.htmland the generic kill-switch block from the app CSS, leaving only the app-specific legacy “resting state” rule.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/polyfills.ts | Removes the app-local replaceChildren polyfill implementation. |
| src/main.ts | Imports the shared signage-kit polyfills side-effect module instead of local polyfills. |
| package.json | Adds @screenly-labs/signage-kit dependency and removes the app’s browserslist field. |
| bun.lock | Locks the new signage-kit GitHub dependency. |
| index.html | Removes the inline degraded-mode gate and documents build-time injection. |
| build.ts | Uses signage-kit helpers for bundling, CSS processing, and gate injection into HTML. |
| assets/styles/main.css | Removes the generic html.legacy kill-switch block; keeps app-specific legacy reveal rule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Point at signage-kit#v0.1.2, where injectGate throws instead of silently no-oping when the stylesheet anchor is missing. - build.ts: wrap the injectGate call in the same try/catch as the JS/CSS steps so a failed injection reports a consistent error and fails the build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The kit switched from 0.1.x SemVer to CalVer; repoint the dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Adopts the shared @screenly-labs/signage-kit (pinned at CalVer
#2026.7.0) in place of this app's inlined degraded-mode plumbing — the browser-support floor, the CSS down-level recipe (cascade-layer flatten + Lightning CSS), the esbuild bundler, the inline degraded-mode gate, thereplaceChildrenshim, and thehtml.legacykill-switch now all live in the package.No behaviour change intended: build output verified equivalent (0
@layer, kill-switch present, 0:lang(), gate injected, JS lowered to es2017) and dual-mode screenshots checked. App-specific design (palette, fonts, layout, and anyhtml.legacyresting-state rules) stays in the app.Part of the fleet-wide signage-kit adoption; birthday/moon/world-clock land first as the proven archetypes (static Tailwind / Worker raw-CSS / static ESM).
🤖 Generated with Claude Code