The main goal of this repository is to document three prior submissions from the second year:
create a README.md file for each of these projects:
create a README.md for your profile:
create a portfolio page that lists the 3 projects with the following format:
Ensure the following tools are installed on your system:
Clone the repository and navigate to the project folder:
git clone https://github.com/FP22FD/FP22FD-portfolio.git
cd FP22FD-portfolio
Install the required dependencies
npm install
Start Development Server
npm run dev
Generate a production-ready build
npm run build
Install the gh-pages package
npm install gh-pages --save-dev
Add the following scripts to package.json
:
{
"homepage": "https://fp22fd.github.io/FP22FD-portfolio/",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
}
}
Deploy using:
npm run predeploy
npn run deploy
This portfolio website includes Hotjar integration to enhance user experience tracking and analysis.
Hotjar allows us to:
Hotjar
React component.hjid
(Hotjar ID) to connect it to the account.Hotjar.tsx
file in src/components
.5259025
with the unique ID provided by your Hotjar account.h._hjSettings = { hjid: YOUR_HOTJAR_ID, hjsv: 6 };
1️⃣ Uso do Vite Bundle Visualizer
The npx vite-bundle-visualizer
command is used to visualize the size and contents of the bundles produced during the build process.
It helps identify which packages take up the most space, allowing optimization of the application load time by splitting bundles or removing unnecessary dependencies.
The npx vite-bundle-visualizer
command is a tool that generates a graphical visualization of the size and contents of the bundles produced by Vite during the build process. It is useful for identifying which packages are taking up the most space, allowing for optimization of the application load time, either by splitting the bundles or removing unnecessary dependencies.
npx vite-bundle-visualizer
2️⃣ Uso de Suspense e lazy
This allows certain components to be loaded on demand rather than at initial load.
Result: Less code in the initial bundle, faster loading, and better performance.
In the application, Suspense
and lazy
are used in the router to load components on demand instead of loading them at the initial page load.
This helps to improve performance by reducing the initial bundle size.
3️⃣ Placing images and icons in the public folder
Static files like images and icons are served directly by the server, without being processed by the bundler.
Result: Better caching, shorter build times, and smaller final bundle size.
4️⃣ Importing only the necessary parts of a large package Instead of importing an entire heavy package, you choose only the small module you need.
The react-world-flags
package has been replaced with svg-country-flags
in this project.
Unlike the previous package, svg-country-flags
allows for a more modular approach where you can import only the specific flag(s) you need, reducing the bundle size.
Instead of importing the entire package, you can import specific flags individually to keep your bundle optimized. Follow these steps:
npm install svg-country-flags