Bug/optimisation build/phase3 5 - #87
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the league-monteregie Vite/React app to improve runtime performance (route/component lazy loading) and deployment compatibility (asset paths via import.meta.env.BASE_URL), while also introducing tooling for bundle analysis.
Changes:
- Added route-based lazy loading in
src/App.jsx(withSuspensefallback) and component-level lazy loading inPlayerStats. - Updated dynamic favicon URLs to use
import.meta.env.BASE_URLfor better base-path compatibility. - Added
rollup-plugin-visualizerplus lockfile updates, and ignored generatedstats.html.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| golf.benoitmignault.ca/league-monteregie/vite.config.js | Keeps base path configuration; attempts to wire in bundle visualizer (currently commented/ambiguous). |
| golf.benoitmignault.ca/league-monteregie/src/css/index.css | Updates background image URL paths. |
| golf.benoitmignault.ca/league-monteregie/src/components/stats/PlayerStats.jsx | Adds lazy loading for some sub-components and updates favicon to BASE_URL. |
| golf.benoitmignault.ca/league-monteregie/src/components/HomePage.jsx | Updates favicon to BASE_URL. |
| golf.benoitmignault.ca/league-monteregie/src/components/admin/Login.jsx | Imports admin CSS and updates favicon to BASE_URL. |
| golf.benoitmignault.ca/league-monteregie/src/components/admin/Dashboard.jsx | Updates favicon to BASE_URL. |
| golf.benoitmignault.ca/league-monteregie/src/App.jsx | Adds lazy loading for route components and wraps routes in Suspense. |
| golf.benoitmignault.ca/league-monteregie/package.json | Adds rollup-plugin-visualizer to devDependencies. |
| golf.benoitmignault.ca/league-monteregie/package-lock.json | Locks new dependency tree for the visualizer and its transitive deps. |
| golf.benoitmignault.ca/league-monteregie/.gitignore | Ignores generated stats.html output. |
Files not reviewed (1)
- golf.benoitmignault.ca/league-monteregie/package-lock.json: Generated file
Comments suppressed due to low confidence (1)
golf.benoitmignault.ca/league-monteregie/vite.config.js:12
- Le plugin
rollup-plugin-visualizerest ajouté en dépendance, mais l’intégration dans Vite est commentée et la ligne actuelleplugins: [react(), /* ... ] */ ],est ambiguë (le]est dans le commentaire). Du coup, l’outil annoncé dans la description du PR n’est pas réellement activable proprement.
import { defineConfig } from 'vite'
// import { visualizer } from "rollup-plugin-visualizer";
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react(), /* visualizer({open: true, gzipSize: true})] */ ],
// Définir la base pour que les ressources soient correctement chargées
// même si l'application est servie à partir d'un sous-répertoire
// Surtout que en PROD : https://golf.benoitmignault.ca/league-monteregie
base: '/league-monteregie/'
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the
league-monteregieproject, focusing on performance optimization, development tooling, and code quality. The main highlights are the implementation of lazy loading for route-based components to enhance app performance, and the addition of therollup-plugin-visualizerfor bundle analysis. There are also minor updates to ensure better environment compatibility and to ignore generated stats files.Performance and Code Quality Improvements
PlayerStats,Login,Dashboard) inApp.jsxusingReact.lazyandSuspense, which will improve the application's initial load time by only loading code for the route being visited.HomePage.jsxto useimport.meta.env.BASE_URLfor better compatibility with different deployment environments.Development Tooling and Dependency Updates
rollup-plugin-visualizertodevDependenciesinpackage.jsonandpackage-lock.json, along with all required sub-dependencies, to support bundle analysis and visualization. [1] [2] [3].gitignorerule forstats.htmlto avoid committing generated bundle analysis reports.package-lock.jsonwith new dependencies required byrollup-plugin-visualizerand its ecosystem (such asopen,yargs,cliui, etc.), ensuring compatibility with recent Node.js versions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]