@@ -40,7 +40,7 @@ export type SpringboardRegistry = {
4040 * | `web` | `'web'`, `'browser'`, `'client'`, `'user-agent'` |
4141 * | `tauri` | `'tauri'`, `'browser'`, `'client'`, `'user-agent'` |
4242 * | `browser` | `'browser'`, `'web'`, `'tauri'`, `'client'`, `'user-agent'` (meta-target) |
43- * | `react-native-web ` | `'react-native-web '`, `'browser'`, `'client'` |
43+ * | `react-native-webview ` | `'react-native-webview '`, `'browser'`, `'client'` |
4444 * | `react-native` | `'react-native'`, `'user-agent'` |
4545 *
4646 * **Async Support:** Callbacks can be sync or async. Use `await` if the callback returns a Promise:
@@ -87,7 +87,7 @@ export type SpringboardRegistry = {
8787 runOn : < T > (
8888 platform : SpringboardPlatform | SpringboardPlatformContext ,
8989 callback : ( ) => T
90- ) => T | null ;
90+ ) => T | undefined ;
9191
9292 /**
9393 * Check if the current runtime matches a platform or context at runtime.
@@ -107,7 +107,7 @@ export type SpringboardRegistry = {
107107 * | `cf-workers` | `'cf-workers'`, `'server'` |
108108 * | `web` | `'web'`, `'browser'`, `'client'`, `'user-agent'` |
109109 * | `tauri` | `'tauri'`, `'browser'`, `'client'`, `'user-agent'` |
110- * | `react-native-webview ` | `'browser'`, `'client'`
110+ * | `react-native-webviewview ` | `'browser'`, `'client'`
111111 * | `react-native` | `'react-native'`, `'user-agent'` |
112112 *
113113 * **Implementation:** Transformed by platform macros in build plugin to return
@@ -177,35 +177,22 @@ export const getRegisteredSplashScreen = (): React.ComponentType | null => {
177177} ;
178178
179179/**
180- * Runtime stub for `springboard.runOn()` - FOR DEVELOPMENT/FALLBACK ONLY.
181- *
182- * **Expected Behavior:**
183- * This function should NEVER be called in production builds. The esbuild plugin
184- * (`packages/springboard/cli/src/esbuild_plugins/esbuild_plugin_platform_inject.ts`)
185- * transforms all `runOn` calls at compile time:
180+ * Runtime stub for `springboard.runOn()`
186181 *
187182 * - **Platform matches:** `runOn('node', cb)` → `cb()` (immediate execution)
188- * - **Platform doesn't match:** `runOn('browser', cb)` → `null` (removed)
189- *
190- * **This stub:**
191- * - Exists for TypeScript type checking and IDE autocomplete
192- * - Provides fallback behavior in non-transformed environments (development, tests)
193- * - Simply executes the callback immediately (simulating "platform matches" behavior)
183+ * - **Platform doesn't match:** `runOn('browser', cb)` → `undefined` (removed)
194184 *
195185 * **Platform parameter:**
196186 * Accepts either platform names (`'node'`, `'browser'`, etc.) or contexts (`'server'`, `'client'`, etc.).
197- * The esbuild plugin (lines 97-118 of esbuild_plugin_platform_inject.ts) handles the platform
187+ * The esbuild plugin (esbuild_plugin_platform_inject.ts) handles the platform
198188 * matching logic based on the build target using a switch statement.
199189 *
200190 * @internal
201191 */
202192const runOn = < T > (
203- platform : SpringboardPlatform | SpringboardPlatformContext ,
193+ _platform : SpringboardPlatform | SpringboardPlatformContext ,
204194 callback : ( ) => T
205- ) : T | null => {
206- // Development/test fallback: execute callback immediately
207- // In production, this code is replaced by the esbuild plugin transformation
208- void platform ; // Unused in runtime stub
195+ ) : T | undefined => {
209196 return callback ( ) ;
210197} ;
211198
@@ -224,7 +211,7 @@ const SPRINGBOARD_PLATFORMS = {
224211 WEB : 'web' ,
225212 TAURI : 'tauri' ,
226213 REACT_NATIVE : 'react-native' ,
227- REACT_NATIVE_WEBVIEW : 'react-native-web ' ,
214+ REACT_NATIVE_WEBVIEW : 'react-native-webview ' ,
228215} as const ;
229216
230217export type SpringboardPlatform = typeof SPRINGBOARD_PLATFORMS [ keyof typeof SPRINGBOARD_PLATFORMS ] ;
@@ -244,7 +231,7 @@ export type SpringboardPlatform = typeof SPRINGBOARD_PLATFORMS[keyof typeof SPRI
244231 * | `web` | `'web'`, `'browser'`, `'client'`, `'user-agent'` |
245232 * | `tauri` | `'tauri'`, `'browser'`, `'client'`, `'user-agent'` |
246233 * | `browser` | `'browser'`, `'web'`, `'tauri'`, `'client'`, `'user-agent'` (meta-target) |
247- * | `react-native-web ` | `'react-native-web '`, `'browser'`, `'client'` |
234+ * | `react-native-webview ` | `'react-native-webview '`, `'browser'`, `'client'` |
248235 * | `react-native` | `'react-native'`, `'user-agent'` |
249236 */
250237const isPlatform = ( platform : SpringboardPlatform | SpringboardPlatformContext ) : boolean => {
0 commit comments