Modernization: retire react-slick & axios, adopt Tailwind brand tokens#1264
Conversation
✅ Deploy Preview for adoptium-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
adoptium-net-next | 94e0a70 | Commit Preview URL Branch Preview URL |
Aug 08 2026, 05:41 AM |
…tic tokens Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
…ck/slick-carousel Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
…/axios-mock-adapter Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1264 +/- ##
==========================================
+ Coverage 80.60% 80.64% +0.04%
==========================================
Files 203 203
Lines 3691 3678 -13
Branches 965 964 -1
==========================================
- Hits 2975 2966 -9
Misses 389 389
+ Partials 327 323 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR advances the modernization tracker by removing deprecated dependencies (react-slick, axios) and aligning UI styling with Tailwind v4 brand tokens, while updating tests and snapshots to match the new implementations.
Changes:
- Replaced the
react-slicklogo carousel with Swiper, and removed now-deadreact-slick/slick-carouseltest mocks. - Migrated remaining axios GET usage to native
fetch(Eclipse news/events + GitHub contributors), and updated tests to mockglobalThis.fetch. - Replaced raw hex Tailwind arbitrary values with semantic brand tokens (
pink,purple,blue,grey) across multiple components and snapshots.
Show a summary per file
| File | Description |
|---|---|
| vitest-setup.tsx | Removes react-slick mocks; keeps/uses existing Swiper mocks for snapshots. |
| src/utils/news.ts | Hardens EF news merge by defaulting efNews.news to []. |
| src/utils/eclipse.ts | Replaces axios with fetch for Eclipse newsroom news API. |
| src/utils/tests/eclipse.test.ts | Updates Eclipse news tests to mock globalThis.fetch instead of axios. |
| src/services/adoptiumApi.ts | Updates docs to reflect fetch-only usage (no axios mention). |
| src/hooks/useAdoptiumContributorsApi.ts | Replaces axios GitHub calls with fetch, including Link header parsing via headers.get. |
| src/hooks/fetchLatestEvents.ts | Replaces axios with fetch and hardens against malformed events payloads. |
| src/hooks/tests/fetchTemurinReleases.test.ts | Replaces axios-mock-adapter usage with globalThis.fetch spies. |
| src/hooks/tests/fetchMarketplace.test.ts | Replaces axios-mock-adapter usage with globalThis.fetch spies. |
| src/hooks/tests/fetchLatestEvents.test.ts | Updates events tests to mock globalThis.fetch and assert URL formation. |
| src/components/WorkingGroup/Projects/index.tsx | Replaces background hex class with bg-blue token. |
| src/components/UiVirtualScroll/UiVirtualContent.tsx | Replaces text-[#ff1365] with text-pink. |
| src/components/TemurinFeatures/BentoGrid.tsx | Replaces multiple hex background classes with bg-blue/bg-purple/bg-pink. |
| src/components/Sustainers/SavingsCalculator/index.tsx | Replaces text-[#c4bfce] with text-grey. |
| src/components/Sustainers/Program/index.tsx | Replaces text-[#c4bfce] with text-grey. |
| src/components/Sustainers/KeyInitiatives/index.tsx | Replaces text-[#c4bfce] with text-grey. |
| src/components/NavBar/index.tsx | Replaces multiple text-[#ff1365] occurrences with text-pink. |
| src/components/Logos/Carousel/index.tsx | Migrates carousel implementation from react-slick to Swiper with autoplay/breakpoints. |
| src/components/HeroSection/index.tsx | Replaces hero background and accent hex classes with tokens (bg-purple, bg-pink, text-pink). |
| src/components/HeroSection/DownloadButton.tsx | Replaces button/hover hex classes with tokens (bg-purple, hover:ring-pink/50, etc.). |
| src/components/Contributors/home.tsx | Replaces gradient from-[#ff1365] with from-pink. |
| src/components/Content/SyntaxHighlighter/index.tsx | Replaces hover accent hex classes with pink token variants. |
| src/components/BannerMiddle/index.tsx | Replaces banner background and CTA hex classes with purple/pink tokens. |
| src/components/Banner/Middle/index.tsx | Same token replacements as BannerMiddle duplicate path. |
| src/app/[locale]/temurin/tests/snapshots/page.test.tsx.snap | Snapshot updates for token classes + Swiper markup. |
| src/app/[locale]/sustainers/page.tsx | Replaces text-[#c4bfce] with text-grey. |
| src/app/[locale]/sustainers/tests/snapshots/page.test.tsx.snap | Snapshot updates for token replacements. |
| src/app/[locale]/page.tsx | Replaces root page background bg-[#14003c] with bg-purple. |
| src/app/[locale]/members/tests/snapshots/page.test.tsx.snap | Snapshot updates for token replacements; removes stray header line. |
| src/app/[locale]/download/client.tsx | Replaces multiple hex classes with semantic tokens in download page client UI. |
| src/app/[locale]/download/tests/snapshots/page.test.tsx.snap | Snapshot updates for download page token replacements. |
| src/app/[locale]/tests/snapshots/page.test.tsx.snap | Snapshot updates for homepage token replacements + Swiper markup. |
| package.json | Removes axios, axios-mock-adapter, react-slick, slick-carousel, and related types. |
| package-lock.json | Lockfile removals corresponding to dropped dependencies. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
src/hooks/tests/fetchTemurinReleases.test.ts:12
vi.clearAllMocks()does not restore theglobalThis.fetchspy back to the original implementation. Because these tests usevi.spyOn(globalThis, "fetch"), the spy can leak into other test files. Prefervi.restoreAllMocks()(orfetchSpy.mockRestore()) inafterEach.
afterEach(() => {
vi.clearAllMocks();
});
- Files reviewed: 33/34 changed files
- Comments generated: 3
- Review effort level: Lite
| const response = await fetch(url.toString()) | ||
| if (!response.ok) { | ||
| return { news: [], pager: null } | ||
| }) | ||
| } | ||
| return await response.json() |
| describe("getAllPkgsForVersion", () => { | ||
| it("returns valid JSON", async () => { | ||
| mock.onGet().reply(200, mockResponse); | ||
| vi.spyOn(globalThis, "fetch").mockResolvedValue({ ok: true, json: async () => mockResponse } as Response); |
…omponents Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
… prism-themes, @types/prismjs Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
|
@copilot fix the code comments. |
…AllMocks in fetch tests Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Fixed in 43dc6f2: added |
|
@copilot fix the css linter. It also looks like more css was removed than I expected? The code boxes no longer look correctly spaced |
…ckground lost with prism theme removal Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Fixed in 94e0a70:
|
Works through the modernization tracker (issue #1249), addressing 3 of 5 actionable areas. The remaining two (
prismjs-to-sugar-high,next-intl-server-translations) are larger, higher-risk refactors deferred to their own PRs.react-slick-replace(deprecated)Logos/Carouselfrom the unmaintainedreact-slickto Swiper (already a dependency) using theAutoplaymodule, translating the old max-widthresponsiveconfig to Swiper's min-widthbreakpoints.react-slick,slick-carousel,@types/react-slick; removed their now-dead mocks fromvitest-setup.tsx.tailwind-4-brand-tokens(idiom)Replaced raw hex arbitrary classes with the semantic
@themetokens across 16 files, per.github/copilot-instructions.md. Opacity modifiers preserved (e.g.shadow-[#ff1365]/20→shadow-pink/20).#ff1365pink#14003cpurple#0d002ablue#c4bfcegreyaxios-to-fetch(feature)axiosGET calls with nativefetchinfetchLatestEvents,eclipse(news), anduseAdoptiumContributorsApi(Link header viaresponse.headers.get); droppedaxiosandaxios-mock-adapter.axiosbut production usesopenapi-fetch, so those mocks were inert — swapped forglobalThis.fetchspies.global.fetchtest mock resolves{}, whichaxios's XHR path never hit):Snapshots and Co-Pilot attribution headers updated for all touched files.
package-lock.jsonchanges are removals only.