Skip to content

Load Island Explorer styles with the game - #1549

Merged
manudeli merged 2 commits into
mainfrom
perf/island-explorer-styles
Nov 22, 2026
Merged

manudeli merged 2 commits into
mainfrom
perf/island-explorer-styles

Conversation

@manudeli

@manudeli manudeli commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Generate Island Explorer's Tailwind utilities separately and import them from the existing lazy game entry. Keep the shared theme and scope the game utilities to the game container so they only apply there after client-side navigation.

The production build already keeps XState, Three.js, Troika, and the rendered game modules behind the /explore dynamic import. This change extends that boundary to the game's styles.

Bundle impact

Asset Before After
Shared CSS, minified 606,371 B 595,364 B
Shared CSS, gzip 78,279 B 77,110 B
Island Explorer CSS, gzip — 6,565 B

The game pays for its own stylesheet when opened. Its stylesheet includes some shared utilities, so the combined CSS for an uncached game visit grows by 5,396 B gzip.

Verification

  • Built both versions with pnpm build and inspected Vite's emitted chunks and the Start route manifest. Across 157 route entries, the game JS and CSS are absent from initial preloads and static imports. The /explore dynamic import loads them together.
  • Verified that all 87 utility selectors removed from shared CSS are present in the scoped game stylesheet and that it keeps the site's custom shadow values.
  • Formatting and the stylesheet boundary test pass. The direct unit run passed 729 tests, skipped six, and hit three local runtime failures involving Chrome startup and a blocked loopback listener.

Summary by CodeRabbit

  • Style
    • Updated styling support for the island game view and site UI, including dynamically styled backgrounds, hover states, category labels, dark themes, and documentation accents. Existing game loading, scene, and interface elements remain within the game’s viewport.
    • Updated the site’s stylesheet setup so game and visitor chat components are handled consistently by style scanning.

@changeset-bot

changeset-bot Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e12b39f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The root route now imports site.css, which configures Tailwind source scanning and inline utility sources. IslandExplorer imports a scoped stylesheet and wraps its existing viewport and overlays in an island-explorer container.

Changes: Tailwind CSS source and game styles

Layer / File(s) Summary
Site stylesheet source configuration
src/routes/__root.tsx, src/styles/site.css, src/styles/app.css
The root route imports site.css, which imports app.css, excludes component directories from source scanning, and defines inline utility sources. The previous exclusion and inline safelists were removed from app.css.
IslandExplorer scoped utilities
src/components/game/IslandExplorer.client.tsx, src/components/game/IslandExplorer.css
IslandExplorer imports a scoped stylesheet and wraps its existing viewport and overlays in an island-explorer container. The stylesheet configures utility generation for that container.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Suggested reviewers: tannerlinsley, sukvvon

Merge Risk: Minimal · up to e12b3

This change moves Island Explorer's utility styles into a stylesheet that loads with the game, which reduces the shared CSS size. No concrete problem was found, and the change looks safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Load Island Explorer styles with the game" matches the main change. The PR moves Island Explorer's Tailwind utilities into a separate stylesheet (IslandExplorer.css) that is imported with t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Load Island Explorer styles with the game" matches the main change. The PR moves Island Explorer's Tailwind utilities into a separate stylesheet (IslandExplorer.css) that is imported with the game component, and the shared site stylesheet is now split from it. The title is specific and describes the primary intent stated in the objectives and commit message.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 419713d4-7cc0-49eb-a6e3-07a12db699ba
Commits

Reviewing files that changed from the base of the PR and between a205832 and e12b39f.

Files selected for processing: 5

  • src/components/game/IslandExplorer.client.tsx
  • src/components/game/IslandExplorer.css
  • src/routes/__root.tsx
  • src/styles/app.css
  • src/styles/site.css
Files with no reviewable changes: 1

  • src/styles/app.css

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown
Asset Main PR merge build Change
JavaScript 19592.05 KiB 19592.14 KiB 🔴 +0.09 KiB (+0.00%)
JavaScript (gzip) 6448.57 KiB 6447.78 KiB 🟢 -0.79 KiB (-0.01%)
CSS 795.02 KiB 831.69 KiB 🔴 +36.67 KiB (+4.61%)
CSS (gzip) 121.69 KiB 126.96 KiB 🔴 +5.27 KiB (+4.33%)
Page Main (gzip) PR merge build (gzip) Change
/ 594.25 KiB 593.06 KiB 🟢 -1.19 KiB (-0.20%)
/libraries 536.93 KiB 535.74 KiB 🟢 -1.19 KiB (-0.22%)
/start/latest 561.73 KiB 560.53 KiB 🟢 -1.20 KiB (-0.21%)
/router/latest 562.03 KiB 560.83 KiB 🟢 -1.20 KiB (-0.21%)
/query/latest 560.48 KiB 559.28 KiB 🟢 -1.20 KiB (-0.21%)
/table/latest 593.28 KiB 592.08 KiB 🟢 -1.20 KiB (-0.20%)
/charts/latest 642.59 KiB 641.39 KiB 🟢 -1.21 KiB (-0.19%)
/ai/latest 587.41 KiB 586.20 KiB 🟢 -1.21 KiB (-0.21%)
Docs article 548.00 KiB 546.79 KiB 🟢 -1.21 KiB (-0.22%)
Framework docs article 548.00 KiB 546.79 KiB 🟢 -1.21 KiB (-0.22%)
/blog 541.14 KiB 539.94 KiB 🟢 -1.20 KiB (-0.22%)
/maintainers 540.22 KiB 539.04 KiB 🟢 -1.19 KiB (-0.22%)
/showcase 538.18 KiB 536.99 KiB 🟢 -1.19 KiB (-0.22%)
/chat 536.67 KiB 535.48 KiB 🟢 -1.19 KiB (-0.22%)
/chat/c/:conversationId 537.38 KiB 536.20 KiB 🟢 -1.18 KiB (-0.22%)

Page sizes sum the JS and CSS in the TanStack Start manifest for each route and its layouts. Shared files count once per page.

Compared with main at a205832. Gzip sizes are summed per file. Build run

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com e12b39f Commit Preview URL

Branch Preview URL
Nov 22 2026, 04:45 PM

@manudeli
manudeli merged commit 593cb4e into main Nov 22, 2026
11 checks passed
@manudeli
manudeli deleted the perf/island-explorer-styles branch November 22, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant