This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build TypeScript source
npm run build
# Lint with Biome
npm run lint
# Format with Biome
npm run format
# Run unit tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage report
npm run test:coverageThe sample app in samples/DynamicSplashSampleApp/ is for manual/integration testing.
This is a React Native library that provides a native-first dynamic splash screen displayed between OS launch and app readiness. The key architectural principle is "next-launch determinism": assets are fetched and cached during the current session but displayed on the next app launch.
JavaScript Layer (src/):
- Fetches splash configuration via
configProvider - Downloads and caches images to local filesystem
- Stores metadata in native storage (UserDefaults/SharedPreferences)
- Does NOT display the splash - only prepares assets for next launch
Native Layer (ios/, android/src/):
- Reads stored metadata at app startup
- Displays overlay window before React Native initializes
- Handles timing constraints (
minDurationMs,maxDurationMs) - Manages fade/scale animations and GIF/APNG playback
- Native
show()called in AppDelegate/MainActivity readsUserDefaults/SharedPreferences - If metadata status is
READYand within time window, displays cached image - JS
mount()fetches new config, downloads assets, updates metadata - Next app launch uses newly cached assets
src/index.ts- Public API (createDynamicSplash,DynamicSplash.hide/isVisible)src/core/DynamicSplashManager.ts- Manager instance coordinating storage and syncsrc/services/sync.ts- Background update logic, weighted config selectionsrc/types.ts- TypeScript interfaces (SplashConfig,StoredMeta,InitOptions)src/expo-plugin.ts- Expo config plugin auto-injecting native codeios/DynamicSplashNative.swift- iOS native module (UIWindow overlay, GIF via ImageIO)android/.../DynamicSplashNativeModule.java- Android native module (Dialog overlay)
Default metadata key: DYNAMIC_SPLASH_META_V1 (configurable via storageKey option)
iOS: UserDefaults.standard
Android: SharedPreferences with name DYNAMIC_SPLASH_STORAGE
The library includes an Expo config plugin (app.plugin.js -> src/expo-plugin.ts) that auto-injects DynamicSplashNative.show() into AppDelegate (Swift/ObjC) and MainActivity (Kotlin/Java). Requires a development build (not Expo Go).