Skip to content

Adopt @screenly-labs/signage-kit for degraded mode - #10

Merged
vpetersson merged 3 commits into
masterfrom
adopt-signage-kit
Jul 13, 2026
Merged

Adopt @screenly-labs/signage-kit for degraded mode#10
vpetersson merged 3 commits into
masterfrom
adopt-signage-kit

Conversation

@vpetersson

@vpetersson vpetersson commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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, the replaceChildren shim, and the html.legacy kill-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 any html.legacy resting-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

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 replaceChildren shim with @screenly-labs/signage-kit/polyfills.
  • Switch the build pipeline to @screenly-labs/signage-kit/build for JS bundling, CSS processing (including degraded kill-switch prepend), and HTML gate injection.
  • Remove the inlined degraded-mode gate from index.html and 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.

Comment thread build.ts
vpetersson and others added 2 commits July 13, 2026 15:28
- 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Comment thread package.json
@vpetersson
vpetersson merged commit 722eeea into master Jul 13, 2026
2 checks passed
@vpetersson
vpetersson deleted the adopt-signage-kit branch July 13, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants