UNPKG

react-on-rails

Version:

react-on-rails JavaScript for react_on_rails Ruby gem

28 lines 1.79 kB
/** * @deprecated Use `capabilities/ssr.ts` instead. This file is kept for backward compatibility * with older versions of react-on-rails-pro that import from `react-on-rails/@internal/base/full`. */ // This is a thin compatibility shim: the SSR implementations live in `capabilities/ssr.ts` // (`createSSRCapability`). This file composes them onto the base client object, preserving // the historical `createBaseFullObject` surface old Pro consumers rely on. import { createBaseClientObject } from "./client.js"; import { createSSRCapability } from "../capabilities/ssr.js"; export function createBaseFullObject(registries, currentObject = null) { // Get or create client object (with caching logic) const clientObject = createBaseClientObject(registries, currentObject); // Delegate the SSR-specific functions to `createSSRCapability` (the canonical source). // Typed to ReactOnRailsFullSpecificFunctions so we add exactly the SSR surface, nothing more. const reactOnRailsFullSpecificFunctions = createSSRCapability(); // Type assertion is safe here because: // 1. We start with BaseClientObjectType (from createBaseClientObject) // 2. We add exactly the methods defined in ReactOnRailsFullSpecificFunctions // 3. BaseFullObjectType = BaseClientObjectType + ReactOnRailsFullSpecificFunctions // TypeScript can't track the mutation, but we ensure type safety by explicitly typing // the functions object above const fullObject = clientObject; // Assign SSR-specific functions to the full object using Object.assign // This pattern ensures we add exactly what's defined in the type, nothing more, nothing less Object.assign(fullObject, reactOnRailsFullSpecificFunctions); return fullObject; } //# sourceMappingURL=full.js.map