-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add new UI components including Navbar, Hero, BentoGrid, and Ka… #64
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
base: main
Are you sure you want to change the base?
Changes from all commits
03e866a
ff36095
807cb23
3bb4c5d
f53809a
7b84ab8
ec4b287
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| { | ||
| "ci": { | ||
| "collect": { | ||
| "startServerCommand": "npm run preview", | ||
| "url": [ | ||
| "http://localhost:4173/" | ||
| ], | ||
| "numberOfRuns": 3 | ||
| }, | ||
| "assert": { | ||
| "preset": "lighthouse:recommended", | ||
| "assertions": { | ||
| "categories:performance": [ | ||
| "error", | ||
| { | ||
| "minScore": 0.9 | ||
| } | ||
| ], | ||
| "categories:accessibility": [ | ||
| "warn", | ||
| { | ||
| "minScore": 0.9 | ||
| } | ||
| ], | ||
| "categories:best-practices": [ | ||
| "warn", | ||
| { | ||
| "minScore": 0.9 | ||
| } | ||
| ], | ||
| "categories:seo": [ | ||
| "warn", | ||
| { | ||
| "minScore": 0.9 | ||
| } | ||
| ], | ||
| "first-contentful-paint": [ | ||
| "warn", | ||
| { | ||
| "maxNumericValue": 2000 | ||
| } | ||
| ], | ||
| "largest-contentful-paint": [ | ||
| "error", | ||
| { | ||
| "maxNumericValue": 2500 | ||
| } | ||
| ], | ||
| "cumulative-layout-shift": [ | ||
| "error", | ||
| { | ||
| "maxNumericValue": 0.1 | ||
| } | ||
| ], | ||
| "total-blocking-time": [ | ||
| "warn", | ||
| { | ||
| "maxNumericValue": 200 | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "upload": { | ||
| "target": "temporary-public-storage" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Lighthouse CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| lighthouse: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Run Lighthouse CI | ||
| uses: treosh/lighthouse-ci-action@v11 | ||
| with: | ||
| uploadArtifacts: true | ||
| temporaryPublicStorage: true | ||
| configPath: ./.github/lighthouse/lighthouserc.json |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Missing clearTimeout on component unmount causes potential memory leak The scroll handler in Navbar.tsx doesn't clear the pending timeout when the component unmounts, which can cause a memory leak and React state update warnings. Click to expandIssueIn the scroll effect at useEffect(() => {
let timeoutId: NodeJS.Timeout;
const handleScroll = () => {
if (timeoutId) return;
timeoutId = setTimeout(() => {
setIsScrolled(window.scrollY > 50);
timeoutId = undefined!;
}, 100);
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);Actual vs Expected
ImpactThis can cause "Can't perform a React state update on an unmounted component" warnings and minor memory leaks during rapid navigation. (Refers to lines 37-48) Recommendation: Add Was this helpful? React with 👍 or 👎 to provide feedback. |
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.
Penggunaan
will-change-transformdi sini mungkin tidak memberikan manfaat performa yang diharapkan dan berpotensi menyebabkan penggunaan memori yang tidak perlu. Propertiwill-changesebaiknya diterapkan langsung pada elemen yang akan dianimasikan.Dalam kasus ini, animasi
transform(sepertiscalepada gambar atauypada kartu) terjadi pada elemen lain (elemenmotion.divinduk atauimgdi dalamnya). Sebaiknya hapuswill-change-transformdaridivini. Jika optimasi spesifik diperlukan, terapkan langsung pada elemen gambar yang memiliki transisiscale.