On This Page
When One Heavy Dependency Penalizes Every Route
Tartila ships structured Tilawati reading stages, customizable Tito & Tila mascot screens (TilaMascot and KamarTilaPage), Lobi Mabar multiplayer arenas, an Ustadz dashboard, and 6 production 2D mini-games (Quiz Hub, Harakat Slasher, Tilawati Memory, Ayat Scramble, Hijaiyah 2048, and Hijaiyah Pop). Bundling Phaser directly inside the entry shell would force children opening a daily reading module on budget Android phones to download full game engine code upfront.
Isolating 2D mini-game routes behind lazy route boundaries
Tito & Tila stay lightweight in expressive SVG + Framer Motion while Phaser & Canvas 2D mini-games load on demand.
Core PWA Shell + SVG Mascot Tito & Tila
Fast initial render for navigation, modular SVG mascot + Framer Motion, daily streak, and Zustand store.
[Lazy Import]
Harakat & Ayat 2D Arcade (4 Games)
Harakat Slasher, Ayat Scramble, Tilawati Memory, and Quiz Hub mount lazily per route via React.lazy.
[Lazy Import]
Hijaiyah 2D Games (2 Games)
Hijaiyah 2048 and Hijaiyah Pop run on lightweight 2D loops isolated from the entry app shell.
[Lazy Import]
Lab Irama & Hijaiyah Map
Rost rhythm trainer and interactive island map report scores back to the shared store.
Splitting SVG Companions From Heavy 2D Game Loops
Instead of pulling Phaser at boot time, we split visual interactivity across two distinct tiers:
- Instant shell mascots (SVG + Framer Motion):
TilaMascotrenders crisp vector layers backed by Zustand (persist) and Go Fiber SSOT mascot preferences (mascot_gender,equipped_accessory,avatar_variant,avatar_mood). No canvas engine download is required just to greet learners or change outfits. - Route-isolated game hubs (
React.lazy&Suspense): each of the 6 mini-games loads its canvas orPhaserbundle strictly when a student enters that specific game route.
import { lazy, Suspense } from "react";
const HarakatSlasherRoute = lazy(() => import("./games/HarakatSlasherRoute"));
export function MiniGameBoundary() {
return (
<Suspense fallback={<div className="p-6 text-sm">Memuat arena mini-game...</div>}>
<HarakatSlasherRoute />
</Suspense>
);
}Trade-Off Found Across 6 Mini-Games
Decoupling game routes kept initial app load fast across 116+ registered users, but per-game sprite sheets and Hijaiyah audio cues still became the secondary loading pause inside individual mini-games. Moving shared audio manifests and sprite preloading into a shared route loader solves that cleanly on subsequent releases without bloating the home shell.