Skip to content

[WEB-4417] chore: optimize package imports instead of transpile#7292

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
optimize-package-imports
Jul 1, 2025
Merged

[WEB-4417] chore: optimize package imports instead of transpile#7292
sriramveeraghanta merged 1 commit intopreviewfrom
optimize-package-imports

Conversation

@lifeiscontent
Copy link
Copy Markdown
Collaborator

@lifeiscontent lifeiscontent commented Jun 30, 2025

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • Chores
    • Updated application configuration to use an experimental optimization for package imports, replacing the previous package transpilation setting. No other changes were made to application behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jun 30, 2025

Walkthrough

The Next.js configuration files across three directories were updated by removing the transpilePackages option and introducing an experimental.optimizePackageImports array containing the same package names. This change shifts package handling from transpilation to experimental import optimization, with no other configuration or logic changes.

Changes

File(s) Change Summary
admin/next.config.js Replaced transpilePackages with experimental.optimizePackageImports for package import handling.
space/next.config.js Replaced transpilePackages with experimental.optimizePackageImports for package import handling.
web/next.config.js Replaced transpilePackages with experimental.optimizePackageImports for package import handling.

Poem

In the warren of configs, a hop and a leap,
Transpile became optimize, no secrets to keep.
Experimental tunnels now guide our way,
Packages imported in a swifter ballet.
With every build, the future draws near—
A rabbit’s cheer for changes clear! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates Next.js configuration files to optimize package imports by replacing the transpilePackages property with the new experimental.optimizePackageImports configuration.

  • web/next.config.js: Removed the existing transpilePackages block.
  • space/next.config.js: Replaced transpilePackages with experimental.optimizePackageImports.
  • admin/next.config.js: Updated the configuration to use experimental.optimizePackageImports.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
web/next.config.js Removed transpilePackages property without adding the new experimental field.
space/next.config.js Replaced transpilePackages with experimental.optimizePackageImports.
admin/next.config.js Updated configuration to use experimental.optimizePackageImports.
Comments suppressed due to low confidence (1)

web/next.config.js:46

  • The web configuration file removes the transpilePackages property but does not add the corresponding experimental.optimizePackageImports property as seen in the admin and space configurations. Please confirm if this is intentional or if the new configuration should be applied here as well to maintain consistency.
  },

@lifeiscontent lifeiscontent marked this pull request as ready for review June 30, 2025 18:34
Copy link
Copy Markdown
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)
admin/next.config.js (1)

12-26: LGTM! Consider documenting the migration rationale.

The experimental configuration is correctly implemented and consistent with the other Next.js config files. The package list matches across all configurations.

Consider adding a comment explaining the migration from transpilePackages to experimental.optimizePackageImports:

  basePath: process.env.NEXT_PUBLIC_ADMIN_BASE_PATH || "",
+ // Migrated from transpilePackages to optimizePackageImports for better tree-shaking
  experimental: {
    optimizePackageImports: [

This would help future maintainers understand the reasoning behind using the experimental feature.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f6923f and cb7a92c.

📒 Files selected for processing (3)
  • admin/next.config.js (1 hunks)
  • space/next.config.js (1 hunks)
  • web/next.config.js (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/archive.tsx:11-14
Timestamp: 2024-11-28T07:02:54.664Z
Learning: When components are still located in `core`, it's appropriate for files to import them using `@/components/...`, and the migration to the new import paths is not necessary in such cases.
admin/next.config.js (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
space/next.config.js (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
web/next.config.js (3)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
🔇 Additional comments (2)
space/next.config.js (1)

26-40: Next.js version compatibility confirmed

Next.js 14.2.30 (found in space/package.json) supports the experimental.optimizePackageImports feature. You can proceed with this migration.

• No code changes required.
• Ensure your CI/integration tests cover any edge cases now that transpilePackages has been removed.

web/next.config.js (1)

34-44: Add missing “@plane/utils” to optimizePackageImports

  • The web/next.config.js file’s experimental.optimizePackageImports array only includes 10 @plane/* packages, but both space/next.config.js and admin/next.config.js list "@plane/utils" as well.
  • Please add "@plane/utils" to the web/next.config.js array so all three configs remain consistent.

Suggested diff (in web/next.config.js around lines 34–44):

   experimental: {
     optimizePackageImports: [
       "@plane/constants",
       "@plane/editor",
       "@plane/hooks",
       "@plane/i18n",
       "@plane/logger",
       "@plane/propel",
       "@plane/services",
       "@plane/shared-state",
       "@plane/types",
       "@plane/ui",
+      "@plane/utils",
     ],
   },
⛔ Skipped due to learnings
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".

@sriramveeraghanta sriramveeraghanta changed the title chore: optimize package imports instead of transpile [WEB-4417] chore: optimize package imports instead of transpile Jul 1, 2025
@makeplane
Copy link
Copy Markdown

makeplane bot commented Jul 1, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@sriramveeraghanta sriramveeraghanta merged commit b03844e into preview Jul 1, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the optimize-package-imports branch July 1, 2025 07:24
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