Skip to content

Conversation

@zacharyblasczyk
Copy link
Member

@zacharyblasczyk zacharyblasczyk commented Mar 9, 2025

Stop unnecessary component re-renders

Summary by CodeRabbit

  • New Features

    • Introduced an experimental React compiler feature that may enhance the processing of components.
  • Chores

    • Updated several dependencies, including @next/bundle-analyzer and next, to their latest versions.
    • Added a new development dependency for React compilation.
    • Updated TypeScript to a newer version for potential improvements and bug fixes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2025

Walkthrough

The changes introduce an experimental React compiler in the web service by adding reactCompiler: true to the Next.js configuration. Additionally, the package.json file has been updated to include a new development dependency, babel-plugin-react-compiler, while also updating the versions of existing dependencies. The TypeScript configuration has been modified to specify included files more precisely, and the TypeScript version in the workspace configuration has been upgraded.

Changes

File(s) Change Summary
apps/.../next.config.js Added experimental React compiler setting (reactCompiler: true).
apps/.../package.json Updated versions of @next/bundle-analyzer and next, and added babel-plugin-react-compiler in devDependencies.
apps/.../tsconfig.json Modified "include" property to specify included TypeScript files more precisely.
pnpm-workspace.yaml Updated TypeScript version from ^5.6.3 to ^5.8.2.

Suggested reviewers

  • jsbroks

Poem

I'm a coding rabbit, hopping with delight,
Adding a flag to make our build take flight.
With a plugin in tow for React to compile,
My whiskers twitch as components reconcile.
In this burrow of code, every change feels just right!
🥕🐰


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e0df17 and 212b9a1.

📒 Files selected for processing (1)
  • apps/webservice/tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webservice/tsconfig.json
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Test
  • GitHub Check: Typecheck
  • GitHub Check: build (linux/amd64)
  • GitHub Check: build (linux/amd64)
  • GitHub Check: Lint
  • GitHub Check: build (linux/amd64)
  • GitHub Check: build (linux/amd64)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 727cfef and 6e0df17.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • apps/webservice/package.json (3 hunks)
  • apps/webservice/tsconfig.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webservice/package.json
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Lint
  • GitHub Check: Typecheck
  • GitHub Check: Test
  • GitHub Check: build (linux/amd64)
  • GitHub Check: Format
🔇 Additional comments (1)
pnpm-workspace.yaml (1)

13-13: Confirm Compatibility for TypeScript Upgrade
The TypeScript version update from “^5.6.3” to “^5.8.2” is aligned with the overall performance improvements expected with the experimental React compiler. Please ensure that all packages and build tools are compatible with the new TypeScript version to avoid unexpected type errors or compilation issues.

Comment on lines 14 to 15
"include": [".", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules", ".next/types"]
Copy link
Contributor

@coderabbitai coderabbitai bot Mar 9, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Revisit the Include/Exclude Patterns for .next/types
There is a potential conflict: line 14 explicitly includes files in “.next/types/**/*.ts”, yet line 15 excludes the entire “.next/types” directory. This may result in the included files being unintentionally omitted from compilation. Please verify that this configuration meets your intent—if certain type declarations inside “.next/types” must be compiled, consider adjusting the exclude pattern (or using an explicit “files” array) so that the desired files are not inadvertently dropped.


Review the TS Config Include/Exclude for .next/types

After inspecting the configuration in apps/webservice/tsconfig.json (lines 14–15), it’s clear that the intent to include files under .next/types/**/*.ts is being conflicted by the exclusion of the entire .next/types folder. If you intend to compile type declarations in that directory, please adjust the exclusion—either by removing .next/types from the exclude array or by narrowing down the exclusion pattern—so that the intended files aren’t inadvertently dropped.

• File: apps/webservice/tsconfig.json (lines 14–15)
• Issue: The inclusion of .next/types/**/*.ts is overridden by excluding .next/types entirely.
• Recommendation: Revise the exclude pattern to ensure the necessary type declarations in .next/types are compiled.

Copy link
Member Author

Choose a reason for hiding this comment

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

We use a standalone output, so we don't need this.

Does that makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

@zacharyblasczyk Yes, that makes perfect sense. With Next.js standalone output, you don't need to process the types in the .next/types directory since they're not relevant for your build. Thanks for the clarification!


✏️ Learnings added
Learnt from: zacharyblasczyk
PR: ctrlplanedev/ctrlplane#363
File: apps/webservice/tsconfig.json:14-15
Timestamp: 2025-03-09T08:56:53.472Z
Learning: In the ctrlplane project, they use Next.js standalone output mode, which means they intentionally exclude `.next/types` in their tsconfig.json despite including `.next/types/**/*.ts` in their include pattern.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@zacharyblasczyk
Copy link
Member Author

Tested.

@jsbroks jsbroks merged commit cfff1f9 into main Mar 12, 2025
9 checks passed
@jsbroks jsbroks deleted the zacharyb/fast-ui-react-compiler branch March 12, 2025 07:00
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.

3 participants