-
Notifications
You must be signed in to change notification settings - Fork 13k
chore(gazzodown): Review build configuration #37753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughBuild configuration refactor for gazzodown: removes Babel tooling (.babelrc.json, Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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/gazzodown/src/blocks/TaskListBlock.tsx (1)
13-27: Consider fixing theTaksListBlocktypo for clarityThe component identifier
TaksListBlockappears to be a misspelling of “TaskListBlock”. Since it’s only used as the local constant and default export, renaming it toTaskListBlockwould improve readability without affecting consumers.
📜 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.
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (28)
packages/gazzodown/.babelrc.json(0 hunks)packages/gazzodown/.eslintrc.json(1 hunks)packages/gazzodown/package.json(0 hunks)packages/gazzodown/src/Markup.stories.tsx(1 hunks)packages/gazzodown/src/Markup.tsx(1 hunks)packages/gazzodown/src/MarkupInteractionContext.ts(1 hunks)packages/gazzodown/src/PreviewMarkup.tsx(1 hunks)packages/gazzodown/src/blocks/TaskListBlock.tsx(1 hunks)packages/gazzodown/src/code/CodeBlock.tsx(1 hunks)packages/gazzodown/src/code/PreviewCodeBlock.tsx(1 hunks)packages/gazzodown/src/colors/ColorElement.tsx(1 hunks)packages/gazzodown/src/colors/PreviewColorElement.tsx(1 hunks)packages/gazzodown/src/elements/ImageElement.tsx(1 hunks)packages/gazzodown/src/elements/InlineElements.tsx(1 hunks)packages/gazzodown/src/elements/LinkSpan.tsx(1 hunks)packages/gazzodown/src/elements/PlainSpan.tsx(1 hunks)packages/gazzodown/src/elements/PreviewInlineElements.tsx(1 hunks)packages/gazzodown/src/emoji/Emoji.tsx(1 hunks)packages/gazzodown/src/emoji/EmojiElement.tsx(1 hunks)packages/gazzodown/src/emoji/EmojiRenderer.tsx(1 hunks)packages/gazzodown/src/katex/KatexBlock.tsx(1 hunks)packages/gazzodown/src/katex/KatexElement.tsx(1 hunks)packages/gazzodown/src/katex/KatexErrorBoundary.tsx(1 hunks)packages/gazzodown/src/mentions/ChannelMentionElement.tsx(1 hunks)packages/gazzodown/src/mentions/PreviewChannelMentionElement.tsx(1 hunks)packages/gazzodown/src/mentions/PreviewUserMentionElement.tsx(1 hunks)packages/gazzodown/src/mentions/UserMentionElement.tsx(1 hunks)packages/gazzodown/tsconfig.json(1 hunks)
💤 Files with no reviewable changes (2)
- packages/gazzodown/package.json
- packages/gazzodown/.babelrc.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/gazzodown/src/elements/InlineElements.tsxpackages/gazzodown/src/mentions/ChannelMentionElement.tsxpackages/gazzodown/src/elements/ImageElement.tsxpackages/gazzodown/src/Markup.tsxpackages/gazzodown/src/code/CodeBlock.tsxpackages/gazzodown/src/elements/PlainSpan.tsxpackages/gazzodown/src/emoji/EmojiRenderer.tsxpackages/gazzodown/src/katex/KatexBlock.tsxpackages/gazzodown/src/blocks/TaskListBlock.tsxpackages/gazzodown/src/Markup.stories.tsxpackages/gazzodown/src/code/PreviewCodeBlock.tsxpackages/gazzodown/src/emoji/EmojiElement.tsxpackages/gazzodown/src/mentions/PreviewUserMentionElement.tsxpackages/gazzodown/src/katex/KatexErrorBoundary.tsxpackages/gazzodown/src/mentions/PreviewChannelMentionElement.tsxpackages/gazzodown/src/MarkupInteractionContext.tspackages/gazzodown/src/emoji/Emoji.tsxpackages/gazzodown/src/colors/ColorElement.tsxpackages/gazzodown/src/katex/KatexElement.tsxpackages/gazzodown/src/PreviewMarkup.tsxpackages/gazzodown/src/colors/PreviewColorElement.tsxpackages/gazzodown/src/elements/LinkSpan.tsxpackages/gazzodown/src/mentions/UserMentionElement.tsxpackages/gazzodown/src/elements/PreviewInlineElements.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-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
packages/gazzodown/src/elements/InlineElements.tsxpackages/gazzodown/src/Markup.tsxpackages/gazzodown/src/Markup.stories.tsxpackages/gazzodown/src/elements/LinkSpan.tsxpackages/gazzodown/src/elements/PreviewInlineElements.tsx
📚 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/gazzodown/src/mentions/ChannelMentionElement.tsxpackages/gazzodown/src/mentions/UserMentionElement.tsx
📚 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/gazzodown/tsconfig.json
⏰ 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: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (26)
packages/gazzodown/src/Markup.stories.tsx (1)
4-5: Type-only split of@rocket.chat/message-parserimports is correct
Optionsis used purely as a type annotation, so switching toimport type { Options }while keepingparseas a value import is appropriate and preserves runtime behavior while reducing emitted JS surface.packages/gazzodown/src/blocks/TaskListBlock.tsx (1)
3-4: Type-only ReactElement import and separate useContext import look correctSplitting React’s type and runtime imports here is consistent with type-only import best practices and aligns with the PR’s build-config goals; no changes needed.
packages/gazzodown/tsconfig.json (1)
4-4: Verify that TypeScript compilation output is properly handled without explicitoutDir.Removing
"outDir": "./dist"changes TypeScript's output behavior. Without this setting, TypeScript will emit compiled JavaScript files to match the source directory structure. Confirm that this doesn't result in.jsand.d.tsfiles being written to the./srcdirectory, mixing compiled artifacts with source code. Verify the build process handles output correctly—either through an alternative build tool, a parent tsconfig configuration, or updated build scripts.packages/gazzodown/src/elements/InlineElements.tsx (1)
2-3: Type-only ReactElement import and separate lazy value import look correctSplitting the type and value imports here is consistent with TS best practices and doesn’t affect the component’s runtime behavior.
Please re-run type-checks/lint for
packages/gazzodownto confirm there are no regressions from the updated React import style.packages/gazzodown/src/elements/LinkSpan.tsx (1)
3-4: React type/value import split is safe and consistentUsing a type-only import for
ReactElementwhile keepinguseMemoas a value import keeps the runtime bundle clean and matches the rest of the PR’s pattern.Confirm ESLint/TS rules for type-only imports (e.g.,
importsNotUsedAsValues) pass cleanly after this import separation.packages/gazzodown/src/colors/ColorElement.tsx (1)
1-2: Type-only ReactElement import with memo value import is appropriateThe component’s memoization and return type remain intact; moving
ReactElementto a type-only import is a straightforward, non-breaking cleanup.Please ensure the updated import style still passes the React/TS lint rules configured for
packages/gazzodown.packages/gazzodown/src/code/PreviewCodeBlock.tsx (1)
2-3: ReactElement type-only import and useMemo value import maintain behaviorThis keeps
PreviewCodeBlock’s behavior identical while aligning with the project-wide type-only import pattern.After these import refactors, please re-run the gazzodown tests to verify no type or runtime issues slipped in.
packages/gazzodown/src/mentions/PreviewChannelMentionElement.tsx (1)
1-2: Type-only ReactElement import with memo is correct for this preview componentGiven the simple JSX and memoization, this import reshaping is low risk and consistent with the rest of the package.
Include this file when running your usual React/TS lint and type-check pipeline to confirm everything remains green.
packages/gazzodown/src/katex/KatexElement.tsx (1)
2-3: ReactElement type-only import with useMemo value import fits the katex componentThe change keeps the KatexElement API and behavior the same while making the React import more TS-friendly.
Given the
dangerouslySetInnerHTMLusage, please ensure existing tests around katex rendering still pass after the tooling changes.packages/gazzodown/src/elements/PlainSpan.tsx (1)
1-2: Type-only ReactElement import with value imports for hooks is appropriateThis matches the rest of the refactor and leaves the highlighting/marking behavior unchanged.
Please run the TS compiler for this module to confirm there are no regressions with the new type-only React import pattern.
packages/gazzodown/src/colors/PreviewColorElement.tsx (1)
1-2: ReactElement type-only import and memo value import are correctly splitThe preview component’s output and memoization are unchanged; the import refactor just improves TS/emit hygiene.
Include this file in your next lint/type-check run to validate the updated React import style under the current tsconfig.
packages/gazzodown/src/mentions/ChannelMentionElement.tsx (1)
3-4: LGTM!Correct use of type-only import for
ReactElement(used only as return type annotation) while keeping runtime imports (memo,useContext,useMemo) separate. This aligns with TypeScript best practices and the PR's build optimization goals.packages/gazzodown/src/katex/KatexErrorBoundary.tsx (1)
3-4: LGTM!
PropsWithChildrenandReactElementare correctly moved to type-only imports as they're used exclusively in type positions (type alias and return type annotation).useStateremains a runtime import.packages/gazzodown/src/MarkupInteractionContext.ts (1)
3-5: LGTM!Proper separation of type-only imports (
FormEvent,UIEvent,AriaButtonProps) from the runtimecreateContextfunction. All types are used exclusively in type annotations withinMarkupInteractionContextValue.packages/gazzodown/src/emoji/EmojiElement.tsx (1)
2-3: LGTM!Clean separation of the type-only
ReactElementimport from the runtimememoHOC.packages/gazzodown/src/emoji/EmojiRenderer.tsx (1)
4-5: LGTM!Correctly splits
ReactElementinto a type-only import while maintaining runtime imports foruseMemo,useContext, andmemo.packages/gazzodown/src/PreviewMarkup.tsx (1)
2-3: LGTM! Type-only import pattern correctly applied.The separation of
ReactElementinto a type-only import is a TypeScript best practice that improves build performance and bundle size by ensuring types are fully erased at compile time.packages/gazzodown/src/emoji/Emoji.tsx (1)
2-3: LGTM! Import refactoring follows best practices.The split between type-only and value imports is correctly implemented and aligns with the broader refactoring effort across the codebase.
packages/gazzodown/src/elements/PreviewInlineElements.tsx (1)
2-3: LGTM! Correct separation of type and runtime imports.
ReactElementis properly isolated as a type-only import whileFragmentremains a value import for runtime use, demonstrating proper understanding of TypeScript's import semantics.packages/gazzodown/src/katex/KatexBlock.tsx (1)
2-3: LGTM! Import refactoring correctly applied.The distinction between type-only (
ReactElement) and runtime (useMemo) imports is properly maintained, ensuring optimal build output.packages/gazzodown/src/Markup.tsx (1)
2-3: LGTM! Type-only import pattern correctly implemented.The refactoring properly separates
ReactElementas a type-only import while preservinglazyandmemoas runtime imports, aligning with TypeScript best practices.packages/gazzodown/src/elements/ImageElement.tsx (1)
2-3: LGTM! Import separation correctly applied.The type-only import for
ReactElementand the value import foruseMemoare correctly distinguished, following TypeScript conventions.packages/gazzodown/src/mentions/UserMentionElement.tsx (1)
3-4: LGTM! Import refactoring follows TypeScript best practices.The separation of
ReactElementinto a type-only import while maintaining runtime hooks (memo,useContext,useMemo) as value imports demonstrates proper TypeScript usage.packages/gazzodown/src/code/CodeBlock.tsx (1)
3-4: LGTM! Import refactoring correctly implemented.The type-only import for
ReactElementis properly separated from the runtime React APIs (Fragment,useContext,useLayoutEffect,useMemo,useRef), following TypeScript best practices and completing the consistent refactoring pattern across the gazzodown package.packages/gazzodown/src/mentions/PreviewUserMentionElement.tsx (1)
1-2: LGTM! Type-only import refactor improves clarity.The separation of type imports from runtime imports using
import typefollows TypeScript best practices and aligns with the PR's goal of improving build performance and code clarity.packages/gazzodown/.eslintrc.json (1)
2-3: This review comment is based on incorrect assumptions and should be removed.The
.eslintrc.jsonfile was newly created in this commit (not modified from a previous configuration), and properly extends shared ESLint configurations from@rocket.chat/eslint-configand@rocket.chat/eslint-config/react. The shared configs already include comprehensive rules, parser configuration, TypeScript support, and all necessary plugins. The configuration follows the same pattern used in other packages likepackages/appsand is correct as-is.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37753 +/- ##
===========================================
+ Coverage 67.71% 67.79% +0.08%
===========================================
Files 3449 3449
Lines 113927 113918 -9
Branches 20915 20915
===========================================
+ Hits 77143 77235 +92
+ Misses 34661 34556 -105
- Partials 2123 2127 +4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
This pull request focuses on codebase cleanup and configuration simplification for the
gazzodownpackage. The main changes include removing Babel configuration and related dependencies, streamlining ESLint configuration, and refactoring imports to use TypeScript'simport typefor improved type-only imports. These updates help reduce build complexity and improve code clarity.Configuration cleanup and simplification:
.babelrc.jsonand all Babel-related dependencies frompackage.json, eliminating Babel from the build process. [1] [2] [3].eslintrc.jsonby reducing custom rules and overrides, now extending only the core Rocket.Chat and Storybook ESLint configs.Codebase refactoring for type-only imports:
import typefor importing types such asReactElement,FormEvent,UIEvent, and others, separating type imports from runtime imports for better clarity and performance. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]These changes collectively improve maintainability, build performance, and code readability.
Issue(s)
ARCH-1909
Steps to test or reproduce
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.