-
Notifications
You must be signed in to change notification settings - Fork 1
불필요한 Three.js 라이브러리 삭제 및 리소스 삭제 #115
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
WalkthroughThis change removes all React Three.js-related dependencies and deletes the TeamHeroSection 3D hero section and its supporting components. The Vite configuration is updated to remove compression plugins and add a bundle visualizer, with a new dynamic chunking strategy. Some sections in the Home page are now lazy-loaded, and minor adjustments are made to imports and logging. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant Home
participant AboutSection
participant KnowledgeSection
participant PopularTopicSection
participant LoadingSpinner
User->>App: Route to "/"
App->>Home: Render Home component
Home->>LoadingSpinner: Show while loading sections
Home->>AboutSection: Lazy load
Home->>KnowledgeSection: Lazy load
Home->>PopularTopicSection: Lazy load
AboutSection-->>Home: Section loaded
KnowledgeSection-->>Home: Section loaded
PopularTopicSection-->>Home: Section loaded
Home->>User: Render all sections
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 2
🧹 Nitpick comments (1)
src/App.jsx (1)
13-13: Remove commented code.Since the Home component is now directly imported, the commented lazy import should be removed to keep the code clean.
-// const Home = lazy(() => import('@pages/Home.jsx'));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
package.json(2 hunks)src/App.jsx(1 hunks)src/features/home/PopularTopic/PopularTopicItem.jsx(1 hunks)src/features/team/hero/TeamHeroSection.jsx(0 hunks)src/features/team/hero/ThreeScene.jsx(0 hunks)src/features/team/hero/Underlay.jsx(0 hunks)src/features/team/hero/index.js(0 hunks)src/features/team/index.js(0 hunks)src/pages/Home.jsx(1 hunks)vite.config.js(3 hunks)
💤 Files with no reviewable changes (5)
- src/features/team/index.js
- src/features/team/hero/index.js
- src/features/team/hero/TeamHeroSection.jsx
- src/features/team/hero/Underlay.jsx
- src/features/team/hero/ThreeScene.jsx
🔇 Additional comments (7)
package.json (2)
14-31: Excellent dependency cleanup!The removal of React Three.js ecosystem dependencies (
@react-three/drei,@react-three/fiber,@react-three/postprocessing,@react-three/rapier, andthree) aligns perfectly with the PR objective. The addition ofrollup-plugin-visualizerto devDependencies is a smart move for bundle analysis after the cleanup.
52-52: Good addition of bundle visualizer.Adding
rollup-plugin-visualizerwill help monitor bundle sizes and ensure the Three.js removal has the expected impact on build output.vite.config.js (3)
10-10: Good addition for bundle analysis.Adding the visualizer plugin will help monitor the impact of removing Three.js dependencies on bundle size.
30-33: Visualizer configuration looks good.The configuration to automatically open the report and save it to
./dist/report.htmlwill provide immediate feedback on bundle composition.
69-91: Smart chunking strategy for better caching.The new manual chunks configuration groups related libraries logically:
- Animation libraries (gsap, framer-motion) together
- UI libraries (emotion, sweetalert2, lottie-react) separately
- Generic vendor chunk for other node_modules
This should improve caching efficiency as related functionality is bundled together.
src/pages/Home.jsx (2)
1-8: Excellent lazy loading implementation.The selective lazy loading of sections that are likely below the fold (AboutSection, KnowledgeSection, PopularTopicSection) while keeping HeroSection immediately available is a smart performance optimization.
14-18: Well-structured Suspense implementation.Using LoadingSpinner as the fallback provides good UX while the lazy-loaded sections are being fetched and rendered.
| `; | ||
|
|
||
| const PopularTopicItem = ({ title, image, index, className }) => { | ||
| console.log(image); |
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.
Remove debug console.log statement.
Debug console.log statements should not be left in production code as they can clutter the browser console and potentially impact performance.
- console.log(image);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| console.log(image); |
🤖 Prompt for AI Agents
In src/features/home/PopularTopic/PopularTopicItem.jsx at line 77, remove the
debug console.log statement that outputs the image variable to prevent
cluttering the browser console and avoid potential performance issues in
production code.
| // viteCompression({ | ||
| // algorithm: 'gzip', | ||
| // ext: '.gz', | ||
| // }), | ||
| // viteCompression({ | ||
| // algorithm: 'brotliCompress', | ||
| // ext: '.br', | ||
| // }), |
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.
🛠️ Refactor suggestion
Consider the impact of removing compression.
Commenting out the gzip and brotli compression plugins will increase the size of assets served to users. This might negatively impact load times, especially for users on slower connections.
Consider keeping at least gzip compression enabled:
- // viteCompression({
- // algorithm: 'gzip',
- // ext: '.gz',
- // }),
+ viteCompression({
+ algorithm: 'gzip',
+ ext: '.gz',
+ }),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // viteCompression({ | |
| // algorithm: 'gzip', | |
| // ext: '.gz', | |
| // }), | |
| // viteCompression({ | |
| // algorithm: 'brotliCompress', | |
| // ext: '.br', | |
| // }), | |
| viteCompression({ | |
| algorithm: 'gzip', | |
| ext: '.gz', | |
| }), | |
| // viteCompression({ | |
| // algorithm: 'brotliCompress', | |
| // ext: '.br', | |
| // }), |
🤖 Prompt for AI Agents
In vite.config.js around lines 40 to 47, the gzip and brotli compression plugins
are commented out, which disables asset compression and can increase load times.
To fix this, uncomment the gzip compression plugin configuration to enable gzip
compression for assets, improving load performance for users on slower
connections. Optionally, keep brotli compression enabled as well for better
compression where supported.
E2E Test & Lighthouse Report
|
Summary by CodeRabbit
New Features
Refactor
Chores
Bug Fixes