Skip to content

Conversation

@tassoevan
Copy link
Contributor

@tassoevan tassoevan commented Dec 5, 2025

Proposed changes (including videos or screenshots)

It normalizes ESLint and Storybook configuration for @rocket.chat/fuselage-ui-kit.

Issue(s)

ARCH-1906

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Simplified build infrastructure by removing Babel and adopting TypeScript compiler for builds.
    • Streamlined ESLint configuration, removing redundant settings.
    • Unified distribution output paths and updated build scripts.

✏️ Tip: You can customize this high-level summary in your review settings.

@tassoevan tassoevan added this to the 7.14.0 milestone Dec 5, 2025
@tassoevan tassoevan requested review from a team as code owners December 5, 2025 19:35
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 5, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

⚠️ No Changeset found

Latest commit: b9374b1

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
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Walkthrough

Removes Babel build tooling from the fuselage-ui-kit package and migrates to TypeScript compiler as the primary build tool. Consolidates separate CommonJS and ESM build configurations into a unified TypeScript build configuration. Simplifies ESLint setup and updates imports to type-only where appropriate.

Changes

Cohort / File(s) Summary
Babel configuration removal
packages/fuselage-ui-kit/.babelrc.json
Deleted Babel configuration file that defined presets for environment, React (runtime: automatic), and TypeScript.
ESLint configuration simplification
packages/fuselage-ui-kit/.eslintrc.json
Simplified ESLint configuration to extend only base configs (@rocket.chat/eslint-config, @rocket.chat/eslint-config/react, plugin:storybook/recommended); removed parser, plugins, rules, settings, and overrides.
Build pipeline and entry point migration
packages/fuselage-ui-kit/package.json
Updated main entry point from dist/cjs/index.js to dist/index.js; updated types from dist/esm/index.d.ts to dist/index.d.ts; removed module field. Replaced separate build:cjs and build:esm scripts with unified build:tsc using tsconfig.build.json. Removed Babel core and preset devDependencies. Updated dev script to use TypeScript watch mode with tsconfig.build.json.
TypeScript configuration consolidation
packages/fuselage-ui-kit/tsconfig.build.json
Added new build configuration extending base tsconfig.json; specifies module as ESNext, rootDir as ./src, outDir as ./dist; includes src directory and excludes node_modules, dist, and test/story files.
Legacy TypeScript configurations
packages/fuselage-ui-kit/tsconfig.cjs.json, packages/fuselage-ui-kit/tsconfig.esm.json
Deleted separate CommonJS and ES module TypeScript build configurations; consolidated into tsconfig.build.json.
TypeScript base configuration
packages/fuselage-ui-kit/tsconfig.json
Formatting and indentation adjustments; no functional changes to configuration.
Type-only imports
packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx, packages/fuselage-ui-kit/src/elements/IconElement.tsx
Converted runtime imports to type-only imports for UiKit and BlockProps to eliminate runtime dependencies.
Livechat build dependency update
packages/livechat/package.json
Added @babel/preset-react version ~7.27.1 as a devDependency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Areas to verify:

  • Confirm tsconfig.build.json output structure matches previous dual-build artifacts
  • Verify package.json entry points (main, types) correctly resolve after build
  • Ensure TypeScript compilation with new config produces expected output in ./dist
  • Check that type-only imports don't introduce compilation errors or missing runtime dependencies

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo

Poem

🐰 Babel's gone, TypeScript's here,
Config files now crystal clear.
Build scripts lean, no split in two,
One path forward, shiny new!
ESNext module, clean and bright,
This refactor feels so right!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Almost all changes relate to build configuration simplification except for one unrelated addition of @babel/preset-react to livechat package. Remove the @babel/preset-react devDependency addition to packages/livechat/package.json as it is unrelated to the fuselage-ui-kit build configuration review.
Linked Issues check ❓ Inconclusive The linked issue ARCH-1906 provides only the title without specific coding requirements, making detailed compliance assessment impossible. Add detailed coding requirements and acceptance criteria to the linked issue ARCH-1906 to enable proper compliance verification.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the PR: reviewing and normalizing the build configuration for fuselage-ui-kit package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fuselage-ui-kit-build-configuration

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a361af8 and b9374b1.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • packages/fuselage-ui-kit/.babelrc.json (0 hunks)
  • packages/fuselage-ui-kit/.eslintrc.json (1 hunks)
  • packages/fuselage-ui-kit/package.json (1 hunks)
  • packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx (1 hunks)
  • packages/fuselage-ui-kit/src/elements/IconElement.tsx (1 hunks)
  • packages/fuselage-ui-kit/tsconfig.build.json (1 hunks)
  • packages/fuselage-ui-kit/tsconfig.cjs.json (0 hunks)
  • packages/fuselage-ui-kit/tsconfig.esm.json (0 hunks)
  • packages/fuselage-ui-kit/tsconfig.json (1 hunks)
  • packages/livechat/package.json (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/fuselage-ui-kit/tsconfig.cjs.json
  • packages/fuselage-ui-kit/tsconfig.esm.json
  • packages/fuselage-ui-kit/.babelrc.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/fuselage-ui-kit/.eslintrc.json
  • packages/fuselage-ui-kit/tsconfig.json
  • packages/fuselage-ui-kit/src/elements/IconElement.tsx
  • packages/fuselage-ui-kit/package.json
  • packages/livechat/package.json
  • packages/fuselage-ui-kit/tsconfig.build.json
  • packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/fuselage-ui-kit/tsconfig.build.json (1)

1-10: Tighten Storybook/test exclusion and confirm noEmit semantics

Two small points to double‑check here:

  1. The Storybook config also uses a ../src/**/stories.tsx pattern. With the current exclude: ["src/**/*.stories.tsx", …], files named exactly stories.tsx (without .stories. in the basename) will still be compiled into dist. If those are Storybook‑only entrypoints, consider also excluding them to keep the build clean:
-  "exclude": ["node_modules", "dist", "src/**/*.stories.tsx", ".storybook/**/*", "./src/**/*.spec.ts", "./src/**/*.spec.tsx"]
+  "exclude": [
+    "node_modules",
+    "dist",
+    "src/**/*.stories.tsx",
+    "src/**/stories.tsx",
+    ".storybook/**/*",
+    "./src/**/*.spec.ts",
+    "./src/**/*.spec.tsx"
+  ]
  1. Since this extends ./tsconfig.json, please confirm the base config does not set "noEmit": true (or, if it does, explicitly override it here). Otherwise tsc -p tsconfig.build.json might succeed but emit no files.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 48953d2 and a361af8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • packages/fuselage-ui-kit/.babelrc.json (0 hunks)
  • packages/fuselage-ui-kit/.eslintrc.json (1 hunks)
  • packages/fuselage-ui-kit/.storybook/main.ts (1 hunks)
  • packages/fuselage-ui-kit/.storybook/webpackAddon.ts (0 hunks)
  • packages/fuselage-ui-kit/package.json (2 hunks)
  • packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx (1 hunks)
  • packages/fuselage-ui-kit/src/elements/IconElement.tsx (1 hunks)
  • packages/fuselage-ui-kit/tsconfig.build.json (1 hunks)
  • packages/fuselage-ui-kit/tsconfig.cjs.json (0 hunks)
  • packages/fuselage-ui-kit/tsconfig.esm.json (0 hunks)
  • packages/fuselage-ui-kit/tsconfig.json (1 hunks)
  • packages/livechat/package.json (1 hunks)
💤 Files with no reviewable changes (4)
  • packages/fuselage-ui-kit/.storybook/webpackAddon.ts
  • packages/fuselage-ui-kit/tsconfig.esm.json
  • packages/fuselage-ui-kit/.babelrc.json
  • packages/fuselage-ui-kit/tsconfig.cjs.json
🧰 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/fuselage-ui-kit/src/elements/IconElement.tsx
  • packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use `.spec.ts` extension for test files (e.g., `login.spec.ts`)

Applied to files:

  • packages/fuselage-ui-kit/tsconfig.build.json
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests

Applied to files:

  • packages/fuselage-ui-kit/tsconfig.build.json
  • packages/fuselage-ui-kit/tsconfig.json
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.

Applied to files:

  • packages/fuselage-ui-kit/src/elements/IconElement.tsx
  • packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (7)
packages/fuselage-ui-kit/tsconfig.json (1)

3-6: Formatting adjustment aligns with build configuration consolidation.

The rewrap and indentation adjustments here are purely stylistic with no semantic impact on the TypeScript configuration. The change supports the broader consolidation effort by standardizing this file's structure as legacy per-target configs are removed.

packages/fuselage-ui-kit/src/elements/IconElement.tsx (1)

2-2: LGTM! Correct type-only import conversions.

Both UiKit and BlockProps are exclusively used in type positions, making these type-only import conversions accurate and aligned with TypeScript best practices. This reduces runtime bundle size and clarifies compile-time-only dependencies.

Also applies to: 5-5

packages/fuselage-ui-kit/src/elements/IconButtonElement.tsx (1)

2-2: LGTM! Correct type-only import conversion.

The UiKit namespace is exclusively used in type position (line 8), making this type-only import conversion accurate and consistent with TypeScript best practices.

packages/livechat/package.json (1)

59-59: No issue identified: @babel/preset-react at ~7.27.1 aligns with the existing monorepo versioning strategy, where @babel/preset-typescript is already pinned to 7.27.1 in this same file. This is a consistent pattern across multiple packages (apps/meteor, ee/packages/presence, packages/core-services, etc.). Minor version differences between Babel 7.27.x and 7.28.x are compatible within the same major version.

Likely an incorrect or invalid review comment.

packages/fuselage-ui-kit/.storybook/main.ts (1)

8-13: SWC compiler addon wiring looks consistent

Using getAbsolutePath('@storybook/addon-webpack5-compiler-swc') in the addons array is consistent with how the other addons are resolved and matches an SWC‑based Storybook setup; no issues from this change.

packages/fuselage-ui-kit/.eslintrc.json (1)

1-4: Simplified ESLint setup aligns with shared configs

Relying on @rocket.chat/eslint-config, @rocket.chat/eslint-config/react, and plugin:storybook/recommended with the current ignore patterns looks good and keeps this package consistent with the shared linting strategy.

packages/fuselage-ui-kit/package.json (1)

20-21: Verify new single-build output and SWC addon compatibility

The unified build setup looks coherent, but a couple of things are worth confirming:

  1. Entry paths vs emitted files

    • main: "dist/index.js" and types: "dist/index.d.ts" now assume that tsc -p tsconfig.build.json emits those exact files.
    • Please run the build locally and confirm that:
      • dist/index.js and dist/index.d.ts exist, and
      • there are no remaining consumers (internal or external) that still rely on the old dist/cjs/index.js (or other CJS entrypoints).
  2. SWC compiler addon version

    • The added @storybook/addon-webpack5-compiler-swc@~3.0.0 should be compatible with the Storybook 8.6.x stack declared here.
    • It’s worth quickly checking the addon’s docs or release notes against the Storybook version you’re using to ensure there are no known incompatibilities.

Also applies to: 28-29, 32-32, 64-64

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 359MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB -649B
queue-worker-service 132MiB 132MiB -458B
ddp-streamer-service 126MiB 126MiB +676B
account-service 113MiB 113MiB -652B
stream-hub-service 111MiB 111MiB -687B
authorization-service 111MiB 111MiB -819B
presence-service 111MiB 111MiB -471B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/06 02:05 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 14 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37708
  • Baseline: develop
  • Timestamp: 2025-12-06 02:05:22 UTC
  • Historical data points: 14

Updated: Sat, 06 Dec 2025 02:05:22 GMT

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.77%. Comparing base (d0be8ad) to head (b9374b1).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37708      +/-   ##
===========================================
- Coverage    67.78%   67.77%   -0.01%     
===========================================
  Files         3449     3449              
  Lines       113987   113987              
  Branches     20956    20956              
===========================================
- Hits         77262    77258       -4     
  Misses       34610    34610              
- Partials      2115     2119       +4     
Flag Coverage Δ
e2e 57.23% <ø> (+<0.01%) ⬆️
e2e-api 42.15% <ø> (-0.04%) ⬇️

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.

@tassoevan tassoevan force-pushed the chore/fuselage-ui-kit-build-configuration branch from a361af8 to b9374b1 Compare December 6, 2025 01:49
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Dec 8, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 8, 2025
@ggazzo ggazzo merged commit f99a203 into develop Dec 8, 2025
90 of 93 checks passed
@ggazzo ggazzo deleted the chore/fuselage-ui-kit-build-configuration branch December 8, 2025 11:39
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 stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants