Skip to content

Conversation

@wackerow
Copy link
Member

Extends page-developer-apps branch

Summary

  • Move randomization of highlighted apps and category previews from page-level unstable_cache to data-layer (trigger.dev task)
  • Add DeveloperToolsDataEnvelope type with appsById lookup + pre-computed selections
  • Remove unstable_cache wrappers from utils.ts
  • Update page components to use pre-computed selections with O(1) lookups

Problem

The previous implementation used unstable_cache at the page level, but unstable_cache creates cache keys from both the keyParts array and function
arguments. Passing the full apps array or searchParams as arguments created unique cache entries for each request, defeating the cache entirely.

Solution

Pre-compute all randomized selections in the trigger.dev task (daily refresh):

  • mainPageHighlights - 3 apps for landing page
  • categoryHighlights - 3 apps per category page (7 categories)
  • categoryPreviews - 5 apps per category card on landing page

Store as an envelope with appsById Record for O(1) modal lookups.

Audit Results

Area Status
Best practices ✅ O(1) lookups, pre-computation, strong types, deterministic seeded RNG
Star count filtering ✅ Preserved - sorts by max stargazers, takes top 9, then shuffles
unstable_cache removed ✅ Only remains in generic data layer, removed from apps code
searchParams issues ✅ Resolved - selections pre-computed, searchParams only used for O(1) lookups

Test plan

  • Verify highlights section shows 3 apps on main page
  • Verify highlights section shows 3 apps on each category page
  • Verify category cards show 5 preview apps each
  • Verify app modal opens correctly via ?appId= param
  • Verify tag filtering works via ?tag= param
  • Confirm no hydration mismatches

🤖 Generated with Claude Code

Move randomization of highlighted apps and category previews from page-level unstable_cache to data-layer (trigger.dev task).

Changes:
- Add DeveloperToolsDataEnvelope type with appsById lookup + selections
- Pre-compute selections (mainPageHighlights, categoryHighlights, categoryPreviews) in trigger.dev task
- Remove unstable_cache wrappers from utils.ts, revert unused `every` time util addition
- Update page components to use pre-computed selections with O(1) lookups
- Transform mock data to envelope format

This fixes cache invalidation issues caused by unstable_cache creating unique keys from function arguments (searchParams). Selections now persist daily and are
consistent for all users.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 85d255d
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/69792b00385c4b000895005f
😎 Deploy Preview https://deploy-preview-17180.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 55 (🔴 down 1 from production)
Accessibility: 94 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants