Skip to content

fix: stabilize CSS bundles across platforms - #2

Merged
LeemanCheung merged 2 commits into
mainfrom
fix/cross-platform-css-bundles
Sep 2, 2026
Merged

fix: stabilize CSS bundles across platforms#2
LeemanCheung merged 2 commits into
mainfrom
fix/cross-platform-css-bundles

Conversation

@LeemanCheung

@LeemanCheung LeemanCheung commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • use an explicit dsh-token-usage_[local] CSS Module namespace instead of Lightning CSS's platform-sensitive path hash
  • keep a fixed POSIX virtual location for path-aware transforms and normalize CSS source line endings
  • add regression coverage for the canonical path contract, plugin-scoped names, and exact generated class names
  • rebuild the committed browser bundle from the corrected configuration

Root cause

The existing configuration normalized checkout-relative paths but still used Lightning CSS's built-in [hash]. Historical CI showed that Windows-generated committed bundles used different CSS Module prefixes from an Ubuntu rebuild. The first revision of this PR proved that even identical POSIX input strings are interpreted with host-specific path semantics inside Lightning CSS, so path normalization alone was insufficient. The final fix removes path hashing from class names and uses the plugin ID as a deterministic collision namespace.

The CI correctly retained git diff --exit-code -- lib; no quality gate was disabled. Typecheck, tests, package validation, and same-run deterministic builds were already passing before the final cross-platform check.

Verification

  • npm run typecheck — passed
  • npm test — 23 files, 135 tests passed
  • targeted build-config regression — 4 tests passed
  • two consecutive npm run build runs produced identical SHA-256 values for lib/index.js, lib/client.js, and lib/client.js.map
  • npm pack --dry-run --json — 41 files validated
  • git diff --check — passed

The remaining acceptance check is the pull request's Ubuntu CI rebuild matching the bundle generated on Windows.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T03:07:10.001344Z 9445740 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LeemanCheung
LeemanCheung merged commit 4943e02 into main Sep 2, 2026
1 check passed
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.

1 participant