From 936fd4b6da6eeb923ca4cd57aa6aab77cfb22254 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 18 Aug 2026 23:26:51 +0200 Subject: [PATCH] fix(plugins): avoid eager React Native spread during client evaluation Spreading ReactNative at module scope evaluated getters for legacy or unlinked modules (such as PushNotificationIOS), which called new NativeEventEmitter(null) and crashed native startup. Pass ReactNative directly to runtimeRequire instead. --- packages/app/src/plugins/evaluate.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/app/src/plugins/evaluate.ts b/packages/app/src/plugins/evaluate.ts index 82e521046..4ef4cf119 100644 --- a/packages/app/src/plugins/evaluate.ts +++ b/packages/app/src/plugins/evaluate.ts @@ -1,6 +1,6 @@ import * as React from "react"; import * as ReactJsxRuntime from "react/jsx-runtime"; -// eslint-disable-next-line no-restricted-imports -- the plugin runtime replaces raw TextInput with Paseo's editing primitive below. +// eslint-disable-next-line no-restricted-imports -- plugin client runtime injects host ReactNative. import * as ReactNative from "react-native"; // eslint-disable-next-line no-restricted-imports -- plugin bundles receive TanStack's real runtime, not Paseo's query wrappers. import * as ReactQuery from "@tanstack/react-query"; @@ -22,9 +22,6 @@ import { createPluginContext, type PluginRegistrationCollector } from "@paseo/pl import type { EvaluatedPlugin } from "./types"; import type { ComponentType } from "react"; import { resolvePluginIcon } from "./icons"; -import { EditingTextInput } from "@/components/ui/text-input"; - -const PluginReactNative = { ...ReactNative, TextInput: EditingTextInput }; const CONTRIBUTION_ID = /^[a-z][a-z0-9-]*$/; @@ -151,7 +148,7 @@ export function evaluatePluginClientBundle(id: string, bundle: string): Evaluate const runtimeRequire = (name: string): unknown => { if (name === "react") return React; if (name === "react/jsx-runtime") return ReactJsxRuntime; - if (name === "react-native") return PluginReactNative; + if (name === "react-native") return ReactNative; if (name === "@paseo/plugin") { return { defineAttachmentSource,