Skip to content

chore: declare '*.css' side-effect imports (TS7 compat) - #41261

Merged
ggazzo merged 1 commit into
developfrom
chore/ts7-css-declarations
Jul 21, 2026
Merged

chore: declare '*.css' side-effect imports (TS7 compat)#41261
ggazzo merged 1 commit into
developfrom
chore/ts7-css-declarations

Conversation

@ggazzo

@ggazzo ggazzo commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Adds an ambient declare module '*.css' to the packages that side-effect-import CSS but don't yet declare it: gazzodown, fuselage-ui-kit, storybook-config, ui-client, pdf-worker.

Why

TypeScript 7's native compiler errors (TS2882) on side-effect imports like import './x.css' when there's no module declaration for the extension. This mirrors the declaration already present in apps/meteor/client/definitions/css.d.ts.

No-op on the current TypeScript 5.x toolchain (typecheck stays green); this is forward-compat groundwork for the TS7 migration.

Draft — part of a set of small, independent TS7-readiness PRs.

Review in cubic

Task: ARCH-2232

Summary by CodeRabbit

  • Bug Fixes
    • Resolved TypeScript errors caused by side-effect CSS imports.
    • Improved compatibility with the latest TypeScript behavior across UI-related packages.

TypeScript 7 errors (TS2882) on side-effect `import './x.css'` without a
module declaration. Add the same ambient declaration already used in
apps/meteor to gazzodown, fuselage-ui-kit, storybook-config, ui-client and
pdf-worker. No-op on the current toolchain.
@dionisio-bot

dionisio-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 8.8.0, but it targets 8.7.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1568cdd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6304de2f-fa7a-48e8-bf15-b6cccbe474b7

📥 Commits

Reviewing files that changed from the base of the PR and between 5894a29 and 1568cdd.

📒 Files selected for processing (5)
  • ee/packages/pdf-worker/src/css.d.ts
  • packages/fuselage-ui-kit/src/css.d.ts
  • packages/gazzodown/src/css.d.ts
  • packages/storybook-config/src/css.d.ts
  • packages/ui-client/src/css.d.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: Hacktron Security Check
⚠️ CI failures not shown inline (4)

GitHub Actions: CI / 0_✅ Tests Done.txt: chore: declare '*.css' side-effect imports (TS7 compat)

Conclusion: failure

View job details

##[group]Run if [[ 'success' != 'success' ]]; then
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'failure' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'success' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho finished�[0m
 shell: /usr/bin/bash -e {0}
 env:
   TOOL_NODE_FLAGS: --max_old_space_size=4096
 ##[endgroup]
 ##[error]Process completed with exit code 1.

GitHub Actions: CI / 15_📦 Track Image Sizes.txt: chore: declare '*.css' side-effect imports (TS7 compat)

Conclusion: failure

View job details

##[group]Run current_total=$(jq -r '.total' current-sizes.json)
 �[36;1mcurrent_total=$(jq -r '.total' current-sizes.json)�[0m
 �[36;1m�[0m
 �[36;1mif [[ ! -f baseline-sizes.json ]]; then�[0m
 �[36;1m  echo "No baseline available"�[0m
 �[36;1m  echo "size-diff=0" >> $GITHUB_OUTPUT�[0m
 �[36;1m  echo "size-diff-percent=0" >> $GITHUB_OUTPUT�[0m
 �[36;1m  echo "comment-triggered=false" >> $GITHUB_OUTPUT�[0m
 �[36;1m�[0m
 �[36;1m  cat > report.md << 'EOF'�[0m
 �[36;1m# 📦 Docker Image Size Report�[0m
 �[36;1m�[0m
 �[36;1m**Status:** First measurement - no baseline for comparison�[0m
 �[36;1m�[0m
 �[36;1m**Total Size:** $(numfmt --to=iec-i --suffix=B $current_total)�[0m
 �[36;1mEOF�[0m
 �[36;1m  exit 0�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mbaseline_total=$(jq -r '.total' baseline-sizes.json)�[0m
 �[36;1mdiff=$((current_total - baseline_total))�[0m
 �[36;1m�[0m
 �[36;1mif [[ $baseline_total -gt 0 ]]; then�[0m
 �[36;1m  percent=$(awk "BEGIN {printf \"%.2f\", ($diff / $baseline_total) * 100}")�[0m
 �[36;1melse�[0m
 �[36;1m  percent=0�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho "size-diff=$diff" >> $GITHUB_OUTPUT�[0m
 �[36;1mecho "size-diff-percent=$percent" >> $GITHUB_OUTPUT�[0m
 �[36;1m�[0m
 �[36;1m# Only comment when size is bigger than baseline; optionally require per-image thresholds�[0m
 �[36;1mTHRESHOLDS="$SIZE_THRESHOLDS"�[0m
 �[36;1mFAIL_THRESHOLDS="$FAIL_THRESHOLDS"�[0m
 �[36;1mcomment_triggered=false�[0m
 �[36;1mfail_triggered=false�[0m
 �[36;1mif [[ $diff -gt 0 ]]; then�[0m
 �[36;1m  if [[ -z "$THRESHOLDS" ]] || [[ "$THRESHOLDS" == "{}" ]]; then�[0m
 �[36;1m    comment_triggered=true�[0m
 �[36;1m  fi�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mcolor="gray"�[0m
 �[36;1mif (( $(awk "BEGIN {print ($percent > 0.01)}") )); then�[0m
 �[36;1m  color="red"�[0m
 �[36;1melif (( $(awk "BEGIN {print ($percent < -0.01)}") )); then�[0m
 �[36;1m  color="green"�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1m# Generate report�[0m
 �[36;1mif [[ $diff -gt 0 ]]; then�[0m
 �[36;1m  emoji=...

GitHub Actions: CI / 13_🔨 Test UI (CE) _ MongoDB 8.0 (4_4).txt: chore: declare '*.css' side-effect imports (TS7 compat)

Conclusion: failure

View job details

##[group]Run set -o xtrace
 �[36;1mset -o xtrace�[0m
 �[36;1m�[0m
 �[36;1myarn prepare�[0m
 �[36;1myarn test:e2e --shard="$E2E_SHARD/$E2E_TOTAL_SHARD"�[0m
 shell: /usr/bin/bash -e {0}
 env:
   MONGO_URL: mongodb://localhost:27017/rocketchat?replicaSet=rs0&directConnection=true
   TOOL_NODE_FLAGS: --max_old_space_size=4096
   LOWERCASE_REPOSITORY: rocketchat
   DOCKER_TAG: pr-41261-amd64
   DOCKER_TAG_SUFFIX_ROCKETCHAT:
   MONGODB_VERSION: 8.0
   COVERAGE_DIR: /tmp/coverage/ui
   COVERAGE_FILE_NAME: ui-4.json
   COVERAGE_REPORTER:
   NODE_VERSION: 22.22.3
   DENO_VERSION: 2.3.1
   MONGOMS_DOWNLOAD_DIR: /home/runner/work/_temp/mongodb-memory-server
   MONGOMS_PREFER_GLOBAL_PATH: false
   TURBOGHA_PORT: 41230
   TURBO_API: http://localhost:41230
   TURBO_***REDACTED***
   TURBO_TEAM: turbogha
   E2E_COVERAGE:
   IS_EE:
   REPORTER_ROCKETCHAT_***REDACTED***
   REPORTER_ROCKETCHAT_URL: ***
   REPORTER_JIRA_ROCKETCHAT_***REDACTED***
   REPORTER_ROCKETCHAT_REPORT: true
   REPORTER_ROCKETCHAT_RUN: 64000
   REPORTER_ROCKETCHAT_BRANCH: refs/pull/41261/merge
   REPORTER_ROCKETCHAT_DRAFT: true
   REPORTER_ROCKETCHAT_HEAD_SHA: 1568cddb74cf79435b0fcde29a9a2f96a61c75ff
   REPORTER_ROCKETCHAT_AUTHOR: ggazzo
   REPORTER_ROCKETCHAT_RUN_URL: https://github.com/RocketChat/Rocket.Chat/actions/runs/28977036191
   REPORTER_ROCKETCHAT_PR: 41261
   QASE_API_***REDACTED***
   QASE_REPORT:
   CI: true
   PLAYWRIGHT_RETRIES: 0
   E2E_SHARD: 4
   E2E_TOTAL_SHARD: 4
 ##[endgroup]
 + yarn prepare
 + yarn test:e2e --shard=4/4
 GitCommitInfo: timeout of 3000ms exceeded while running "git fetch origin 5894a29f904942ade57517f66a60bfd7f1248556"
 Running 185 tests using 1 worker, shard 4 of 4
   -  1 tests/e2e/read-receipts-deactivated-users.spec.ts:60:6 › read-receipts-deactivated-users › should correctly handle read receipts as users are deactivated
 [INFO] qase: Test should correctly handle read receipts as users are deactivated skipped
   -  2 tests/e2e/read-receipts-thread.spec.ts:42:6 › read-r...

GitHub Actions: CI / 31_🔨 Test Unit _ Unit Tests.txt: chore: declare '*.css' side-effect imports (TS7 compat)

Conclusion: failure

View job details

cT7nKU1CCadpLhTJiIrgrrPzil1G5DQ4xnLs3Q2tu2dILSDiW5OYw/ywu2yCMicTjMq4MLL5SXDQJj6WoJzZ54HosbvsDzOXvsdC9gI1CjhPL2uRuvC8XLrzn3vL2UgXnifzD1VrLTtdZ+aSADveqtlzYlRWtqoUFBbNw8o+YVHdhbZGR0beMoAyRbHi5EMpxpad3L+NyztUIT/Uh/IjQ/C2SQZ6jB0GKPBOPxFLN56FNhTGrffLFR++TVoBu0Iquc7kajWkNit3bVbZvbx+oFcVW2PcjQ/+i2jpJjbgtUFUKrTKxGMAXTWoDzIQQ35zNzGAy268IM4Ymp5JmsVEnBOEUkbF9yx6fzkO6xZhpsHf0muklnW0kA+Tlore/TUrBWh1/RwWlQeZlxM5NyWoRM5onQmr/k/4BmObtL1Hpmbk8oMG29z89xtE9y/4=
   NODE_VERSION: 22.22.3
   DENO_VERSION: 2.3.1
   MONGOMS_DOWNLOAD_DIR: /home/runner/work/_temp/mongodb-memory-server
   MONGOMS_PREFER_GLOBAL_PATH: false
   TURBOGHA_PORT: 41230
   TURBO_API: http://localhost:41230
   TURBO_***REDACTED***
   TURBO_TEAM: turbogha
 ##[endgroup]
 ##[group]Run missing_deps=""
 �[36;1mmissing_deps=""�[0m
 �[36;1m�[0m
 �[36;1m# Check for always-required commands�[0m
 �[36;1mfor cmd in bash git curl; do�[0m
 �[36;1m  if ! command -v "$cmd" >/dev/null 2>&1; then�[0m
 �[36;1m    missing_deps="$missing_deps $cmd"�[0m
 �[36;1m  fi�[0m
 �[36;1mdone�[0m
 �[36;1m�[0m
 �[36;1m# Check for gpg only if validation is not being skipped�[0m
 �[36;1mif [ "$INPUT_SKIP_VALIDATION" != "true" ]; then�[0m
 �[36;1m  if ! command -v gpg >/dev/null 2>&1; then�[0m
 �[36;1m    missing_deps="$missing_deps gpg"�[0m
 �[36;1m  fi�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1m# Report missing required dependencies�[0m
 �[36;1mif [ -n "$missing_deps" ]; then�[0m
 �[36;1m  echo "Error: The following required dependencies are missing:$missing_deps"�[0m
 �[36;1m  echo "Please install these dependencies before using this action."�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho "All required system dependencies are available."�[0m
 shell: /usr/bin/sh -e {0}
 env:
   MONGO_URL: mongodb://localhost:27017/rocketchat?replicaSet=rs0&directConnection=true
   TOOL_NODE_FLAGS: --max_old_space_size=4096
   ENTERPRISE_LICENSE: MK+bpK5NveUuNlWGaQXGoy+8b74Luet82M3ZGcBB8b5P9Y+m67NEtpW64dc1d5lEWi6d0nFjCjtCMneVD7bKxodz/Cml8URKEo5P7cQb/...
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/ui-client/src/css.d.ts
  • packages/gazzodown/src/css.d.ts
  • packages/fuselage-ui-kit/src/css.d.ts
  • ee/packages/pdf-worker/src/css.d.ts
  • packages/storybook-config/src/css.d.ts
🧠 Learnings (3)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/ui-client/src/css.d.ts
  • packages/gazzodown/src/css.d.ts
  • packages/fuselage-ui-kit/src/css.d.ts
  • ee/packages/pdf-worker/src/css.d.ts
  • packages/storybook-config/src/css.d.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/ui-client/src/css.d.ts
  • packages/gazzodown/src/css.d.ts
  • packages/fuselage-ui-kit/src/css.d.ts
  • ee/packages/pdf-worker/src/css.d.ts
  • packages/storybook-config/src/css.d.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • packages/ui-client/src/css.d.ts
  • packages/gazzodown/src/css.d.ts
  • packages/fuselage-ui-kit/src/css.d.ts
  • ee/packages/pdf-worker/src/css.d.ts
  • packages/storybook-config/src/css.d.ts
🔇 Additional comments (5)
ee/packages/pdf-worker/src/css.d.ts (1)

1-4: LGTM!

packages/fuselage-ui-kit/src/css.d.ts (1)

1-4: LGTM!

packages/gazzodown/src/css.d.ts (1)

1-4: LGTM!

packages/storybook-config/src/css.d.ts (1)

1-4: LGTM!

packages/ui-client/src/css.d.ts (1)

1-4: LGTM!


Walkthrough

Adds TypeScript ambient declarations for *.css imports in five packages, exporting undefined to support side-effect CSS imports under TS7.

Changes

CSS Type Declarations

Layer / File(s) Summary
Ambient CSS module declarations
ee/packages/pdf-worker/src/css.d.ts, packages/{fuselage-ui-kit,gazzodown,storybook-config,ui-client}/src/css.d.ts
Adds declare module '*.css' with export = undefined in each package.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding CSS side-effect import declarations for TypeScript 7 compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • ARCH-2232: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ggazzo ggazzo added this to the 8.7.0 milestone Jul 8, 2026
@ggazzo

ggazzo commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

/jira ARCH-2200

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.08%. Comparing base (5894a29) to head (1568cdd).
⚠️ Report is 113 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41261      +/-   ##
===========================================
- Coverage    69.11%   69.08%   -0.04%     
===========================================
  Files         3660     3660              
  Lines       143543   143543              
  Branches     25735    25745      +10     
===========================================
- Hits         99216    99164      -52     
- Misses       40020    40072      +52     
  Partials      4307     4307              
Flag Coverage Δ
e2e 59.38% <ø> (-0.03%) ⬇️
e2e-api 50.32% <ø> (+<0.01%) ⬆️
unit 69.97% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ggazzo
ggazzo marked this pull request as ready for review July 10, 2026 14:07

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Re-trigger cubic

@ggazzo ggazzo modified the milestones: 8.7.0, 8.8.0 Jul 21, 2026
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Jul 21, 2026
@tassoevan
tassoevan added this pull request to the merge queue Jul 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 21, 2026
@ggazzo
ggazzo merged commit 04d4322 into develop Jul 21, 2026
158 of 164 checks passed
@ggazzo
ggazzo deleted the chore/ts7-css-declarations branch July 21, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants