feat: optimize rules PDF delivery (compressed default + S3 override) - #34
feat: optimize rules PDF delivery (compressed default + S3 override)#34jerry-shimizutech wants to merge 1 commit into
Conversation
✅ Deploy Preview for marianas-open ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
@greptile please review |
|
Quick note: the 2/5 item about RulesPage defaulting to the uncompressed PDF is already resolved in the latest branch commit (current fallback points to , and matches).\n\nLeaving this here for reviewer context in case the summary was generated from an older diff snapshot.\n\n@greptile review |
Summary\nImproves Rules PDF delivery so users download a smaller file by default while preserving S3/CDN override support.\n\n## Changes\n- Added compressed rules PDF artifact:\n - \n- Updated default PDF URL fallback:\n - from \n - to \n- Kept env override behavior unchanged:\n - still takes precedence for S3/CDN-hosted file\n- Updated comments to match new compressed default\n\n## Why\n- Reduces download size for rules PDF out-of-the-box\n- Keeps a clean path for production S3/CDN cutover\n\n## Validation\n-
vite v7.3.1 building client environment for production...
transforming...
✓ 2254 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 1.99 kB │ gzip: 0.70 kB
dist/assets/index-GobLjBf2.css 73.43 kB │ gzip: 11.29 kB
dist/assets/chevron-up-DR3q6108.js 0.13 kB │ gzip: 0.14 kB
dist/assets/chevron-down-CZ_kxJMW.js 0.13 kB │ gzip: 0.14 kB
dist/assets/loader-circle-DKYsjYim.js 0.14 kB │ gzip: 0.16 kB
dist/assets/plus-COvI_NIR.js 0.15 kB │ gzip: 0.15 kB
dist/assets/clock-Bwv6PYTx.js 0.17 kB │ gzip: 0.17 kB
dist/assets/arrow-left-C7BspIMo.js 0.17 kB │ gzip: 0.16 kB
dist/assets/arrow-right-CpfEwnf7.js 0.17 kB │ gzip: 0.16 kB
dist/assets/search-DQdemMu4.js 0.17 kB │ gzip: 0.17 kB
dist/assets/circle-check-BI0AcD9P.js 0.17 kB │ gzip: 0.17 kB
dist/assets/play-Du7muPN0.js 0.19 kB │ gzip: 0.18 kB
dist/assets/funnel-DAi37b1U.js 0.25 kB │ gzip: 0.22 kB
dist/assets/external-link-C0Z1ANWz.js 0.25 kB │ gzip: 0.20 kB
dist/assets/dateLocale-BVwxDm0C.js 0.26 kB │ gzip: 0.21 kB
dist/assets/award-CXcysdip.js 0.27 kB │ gzip: 0.23 kB
dist/assets/image-B8XjvPYl.js 0.27 kB │ gzip: 0.22 kB
dist/assets/pencil-T-6MMBOL.js 0.28 kB │ gzip: 0.23 kB
dist/assets/users-0PkB_PAG.js 0.31 kB │ gzip: 0.22 kB
dist/assets/phone-vFn6qYtr.js 0.32 kB │ gzip: 0.23 kB
dist/assets/save-jpt4C4jT.js 0.33 kB │ gzip: 0.23 kB
dist/assets/trash-2-GuE4rEbc.js 0.33 kB │ gzip: 0.22 kB
dist/assets/layout-dashboard--ZjSLJv.js 0.35 kB │ gzip: 0.21 kB
dist/assets/file-text-TQ20wsOq.js 0.39 kB │ gzip: 0.26 kB
dist/assets/index-W-VewR33.js 0.40 kB │ gzip: 0.28 kB
dist/assets/ScrollReveal-vBqDlSTy.js 0.43 kB │ gzip: 0.31 kB
dist/assets/medal-B5GrHTrF.js 0.44 kB │ gzip: 0.29 kB
dist/assets/handshake-CLeMcZAL.js 0.45 kB │ gzip: 0.29 kB
dist/assets/map-pin-DapIh36v.js 0.46 kB │ gzip: 0.32 kB
dist/assets/star-CJtjR7uM.js 0.47 kB │ gzip: 0.30 kB
dist/assets/trophy-moTcAVWS.js 0.48 kB │ gzip: 0.28 kB
dist/assets/settings-ZrOsQJo8.js 0.48 kB │ gzip: 0.26 kB
dist/assets/useApi-B4uO5XYd.js 0.48 kB │ gzip: 0.25 kB
dist/assets/calendar-days-LbBLrKJA.js 0.50 kB │ gzip: 0.27 kB
dist/assets/useSiteImages-9w9boci0.js 0.54 kB │ gzip: 0.35 kB
dist/assets/useSiteContent-D6wOn-4q.js 0.60 kB │ gzip: 0.40 kB
dist/assets/NotFoundPage-L2m1n3TW.js 1.00 kB │ gzip: 0.53 kB
dist/assets/images-CO0xFN9Z.js 1.41 kB │ gzip: 0.73 kB
dist/assets/TermsPage-5KZiUPXO.js 1.46 kB │ gzip: 0.70 kB
dist/assets/ClerkProtectedContent-2hVSBIpN.js 1.66 kB │ gzip: 0.93 kB
dist/assets/ImageUpload-fUHf4yhN.js 2.56 kB │ gzip: 1.16 kB
dist/assets/AdminLayout-CnpN4ITi.js 2.77 kB │ gzip: 1.24 kB
dist/assets/AdminDashboard-Da36qTo9.js 3.85 kB │ gzip: 1.47 kB
dist/assets/CompetitorProfilePage-D8_HOFHn.js 5.23 kB │ gzip: 1.67 kB
dist/assets/AboutPage-BdPiqHAk.js 5.72 kB │ gzip: 1.72 kB
dist/assets/SponsorsAdmin-BXvmscSQ.js 8.20 kB │ gzip: 2.36 kB
dist/assets/SettingsAdmin-DhSQfXh1.js 8.25 kB │ gzip: 1.80 kB
dist/assets/ContentAdmin-DENJwIeH.js 8.78 kB │ gzip: 2.44 kB
dist/assets/PastEventsPage-BXGaFv3O.js 9.04 kB │ gzip: 2.90 kB
dist/assets/UsersAdmin-CA9p7YI8.js 9.15 kB │ gzip: 2.42 kB
dist/assets/CalendarPage-CtGsrEoA.js 10.43 kB │ gzip: 2.87 kB
dist/assets/CompetitorsPage-Sb_6qu3B.js 11.12 kB │ gzip: 3.04 kB
dist/assets/RulesPage-CT5gycDF.js 11.47 kB │ gzip: 3.42 kB
dist/assets/RankingsPage--Kwg07bp.js 11.48 kB │ gzip: 3.29 kB
dist/assets/WatchPage-CNMMf0R.js 11.65 kB │ gzip: 3.69 kB
dist/assets/ImagesAdmin-C-KpnwqL.js 12.74 kB │ gzip: 3.57 kB
dist/assets/VideosAdmin-C3tWzz7e.js 13.39 kB │ gzip: 3.13 kB
dist/assets/CompetitorsAdmin-BsJjONXL.js 14.98 kB │ gzip: 3.16 kB
dist/assets/EventsAdmin-XecPncJk.js 15.55 kB │ gzip: 3.77 kB
dist/assets/HomePage-CqEnslFz.js 23.15 kB │ gzip: 5.73 kB
dist/assets/QRShare-B0yt2BrR.js 23.92 kB │ gzip: 9.10 kB
dist/assets/EventDetailPage-Bsh-fhV2.js 32.64 kB │ gzip: 7.86 kB
dist/assets/index-XByIRGPY.js 647.40 kB │ gzip: 208.09 kB
✓ built in 1.32s ✅\n
Greptile Summary
This PR adds a compressed version of the SJJIF rulebook PDF (5.1 MB, down from 36 MB) to
web/public/files/. However, the default fallback URL inRulesPage.tsxwas not updated to point to the compressed file, so the stated goal of reducing download size out-of-the-box is not achieved.web/public/files/2018-sjjif-rulebook-compressed.pdf(5.1 MB compressed artifact)web/src/pages/RulesPage.tsx:28(still references the uncompressed 36 MB file).env.examplecomment on line 6 to reference the compressed defaultConfidence Score: 2/5
web/src/pages/RulesPage.tsx— the fallback URL on line 28 needs to be updated to reference the compressed PDF for the PR to achieve its stated purpose.Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[RulesPage loads] --> B{VITE_RULEBOOK_PDF_URL set?} B -->|Yes| C[Use env URL<br/>e.g. S3/CDN] B -->|No| D[Fallback to local file] D --> E["/files/2018-sjjif-rulebook.pdf<br/>(36 MB — uncompressed)"] E --> F["⚠️ Compressed file exists but<br/>is NOT referenced as fallback"] F --> G["2018-sjjif-rulebook-compressed.pdf<br/>(5.1 MB — unused)"] C --> H[User downloads PDF] E --> HComments Outside Diff (1)
web/public/files/2018-sjjif-rulebook-compressed.pdf, line 1 (link)Default fallback URL not updated
This PR adds the compressed PDF (5.1 MB vs 36 MB original), but the default fallback in
web/src/pages/RulesPage.tsx:28still points to the uncompressed file:To achieve the stated goal of serving a smaller file by default, the fallback should be updated to:
Similarly, the
.env.examplecomment on line 6 still references the uncompressed copy. Without this code change, the compressed PDF sits unused unless the env variable is explicitly configured — which defeats the "out-of-the-box" download-size reduction described in the PR.Prompt To Fix All With AI
Last reviewed commit: 9f4f4c5