[WEB-4417] chore: optimize package imports instead of transpile#7292
[WEB-4417] chore: optimize package imports instead of transpile#7292sriramveeraghanta merged 1 commit intopreviewfrom
Conversation
WalkthroughThe Next.js configuration files across three directories were updated by removing the Changes
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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.
},
There was a problem hiding this comment.
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
transpilePackagestoexperimental.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
📒 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 confirmedNext.js 14.2.30 (found in
space/package.json) supports theexperimental.optimizePackageImportsfeature. You can proceed with this migration.• No code changes required.
• Ensure your CI/integration tests cover any edge cases now thattranspilePackageshas been removed.web/next.config.js (1)
34-44: Add missing “@plane/utils” to optimizePackageImports
- The
web/next.config.jsfile’sexperimental.optimizePackageImportsarray only includes 10@plane/*packages, but bothspace/next.config.jsandadmin/next.config.jslist"@plane/utils"as well.- Please add
"@plane/utils"to theweb/next.config.jsarray so all three configs remain consistent.Suggested diff (in
web/next.config.jsaround 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".
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit