@reckona/mreact-dom 0.0.187 → 0.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,MAAM,EACN,sBAAsB,EACtB,cAAc,IAAI,YAAY,EAC/B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD,iFAAiF;AACjF,OAAO,EACL,YAAY,EACZ,SAAS,EACT,MAAM,EACN,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,CAAC;AACF,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzE,4CAA4C;AAC5C,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,oEAAoE;AACpE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;CACd;AAED,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CACjE;AAED,+DAA+D;AAC/D,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAElE,iEAAiE;A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aAAa;IACb,gBAAgB;IAChB,uBAAuB;IACvB,WAAW;IACX,UAAU;IACV,OAAO;IACP,aAAa;IACb,OAAO;IACP,aAAa;CACL,CAAC;AAEX,eAAe,QAAQ,CAAC","sourcesContent":["import {\n createPortal,\n flushSync,\n render,\n unmountComponentAtNode,\n useActionState as useFormState,\n} from \"@reckona/mreact-compat\";\nimport { runWithEventPriority } from \"@reckona/mreact-compat/event-priority\";\nimport { createRoot, hydrateRoot } from \"./client.js\";\n\n/** Re-exports the React DOM rendering helpers exposed by the root entrypoint. */\nexport {\n createPortal,\n flushSync,\n render,\n unmountComponentAtNode,\n useFormState,\n createRoot,\n hydrateRoot,\n};\nexport type { HydrateRootOptions, Root, RootOptions } from \"./client.js\";\n\n/** React DOM-compatible package version. */\nexport const version = \"19.2.6\";\n\n/** Idle form status returned when no form submission is pending. */\nexport interface FormStatusNotPending {\n pending: false;\n data: null;\n method: null;\n action: null;\n}\n\n/** Pending form status returned while a submission is in progress. */\nexport interface FormStatusPending {\n pending: true;\n data: FormData;\n method: string;\n action: string | ((formData: FormData) => void | Promise<void>);\n}\n\n/** Current form submission state returned by useFormStatus. */\nexport type FormStatus = FormStatusPending | FormStatusNotPending;\n\n/** Options applied when inserting a preconnect resource hint. */\nexport interface PreconnectOptions {\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n}\n\n/** Allowed destination values for preload resource hints. */\nexport type PreloadAs =\n | \"audio\"\n | \"document\"\n | \"embed\"\n | \"fetch\"\n | \"font\"\n | \"image\"\n | \"object\"\n | \"track\"\n | \"script\"\n | \"style\"\n | \"video\"\n | \"worker\";\n\n/** Options applied when inserting a preload resource hint. */\nexport interface PreloadOptions {\n as: PreloadAs;\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n fetchPriority?: \"high\" | \"low\" | \"auto\";\n imageSizes?: string;\n imageSrcSet?: string;\n integrity?: string;\n type?: string;\n nonce?: string;\n referrerPolicy?: ReferrerPolicy;\n media?: string;\n}\n\n/** Options applied when inserting a modulepreload resource hint. */\nexport interface PreloadModuleOptions {\n as?: RequestDestination;\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n integrity?: string;\n nonce?: string;\n}\n\n/** Options applied when preinitializing a script or stylesheet resource. */\nexport interface PreinitOptions {\n as: \"script\" | \"style\";\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n fetchPriority?: \"high\" | \"low\" | \"auto\";\n precedence?: string;\n integrity?: string;\n nonce?: string;\n}\n\n/** Options applied when preinitializing a JavaScript module resource. */\nexport interface PreinitModuleOptions {\n as?: \"script\";\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n integrity?: string;\n nonce?: string;\n}\n\ntype LinkAttributes = Record<string, string | undefined>;\n\n/** Returns the current form submission status for the nearest form action. */\nexport function useFormStatus(): FormStatus {\n throw new Error(\n \"useFormStatus is not supported by @reckona/mreact-dom yet. Use useFormState/useActionState for local pending state instead.\",\n );\n}\n\n/** Resets a form element after a server action-style submission completes. */\nexport function requestFormReset(form: HTMLFormElement): void {\n form.reset();\n}\n\n/** Runs a callback at discrete event priority and returns its result. */\nexport function unstable_batchedUpdates<T>(callback: () => T): T;\nexport function unstable_batchedUpdates<TArgument, TResult>(\n callback: (argument: TArgument) => TResult,\n argument: TArgument,\n): TResult;\nexport function unstable_batchedUpdates<TArgument, TResult>(\n callback: ((argument: TArgument) => TResult) | (() => TResult),\n argument?: TArgument,\n): TResult {\n return runWithEventPriority(\"discrete\", () =>\n argument === undefined\n ? (callback as () => TResult)()\n : (callback as (argument: TArgument) => TResult)(argument)\n );\n}\n\n/** Inserts a dns-prefetch link for the provided host if it is not already present. */\nexport function prefetchDNS(href: string): void {\n upsertHeadLink(\"dns-prefetch\", href, {});\n}\n\n/** Inserts a preconnect link for the provided origin if it is not already present. */\nexport function preconnect(href: string, options: PreconnectOptions = {}): void {\n upsertHeadLink(\"preconnect\", href, {\n crossorigin: options.crossOrigin,\n });\n}\n\n/** Inserts a preload link for the provided resource if it is not already present. */\nexport function preload(href: string, options: PreloadOptions): void {\n upsertHeadLink(\"preload\", href, {\n as: options.as,\n crossorigin: options.crossOrigin,\n fetchpriority: options.fetchPriority,\n imagesrcset: options.imageSrcSet,\n imagesizes: options.imageSizes,\n integrity: options.integrity,\n media: options.media,\n nonce: options.nonce,\n referrerpolicy: options.referrerPolicy,\n type: options.type,\n });\n}\n\n/** Inserts a modulepreload link for the provided module if it is not already present. */\nexport function preloadModule(href: string, options: PreloadModuleOptions = {}): void {\n upsertHeadLink(\"modulepreload\", href, {\n as: options.as,\n crossorigin: options.crossOrigin,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n}\n\n/** Preinitializes a script or stylesheet resource in the document head. */\nexport function preinit(href: string, options: PreinitOptions): void {\n if (options.as === \"style\") {\n upsertHeadLink(\"stylesheet\", href, {\n \"data-precedence\": options.precedence,\n crossorigin: options.crossOrigin,\n fetchpriority: options.fetchPriority,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n return;\n }\n\n upsertHeadScript(href, {\n async: \"\",\n crossorigin: options.crossOrigin,\n fetchpriority: options.fetchPriority,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n}\n\n/** Preinitializes a JavaScript module resource in the document head. */\nexport function preinitModule(href: string, options: PreinitModuleOptions = {}): void {\n upsertHeadScript(href, {\n type: \"module\",\n async: \"\",\n crossorigin: options.crossOrigin,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n}\n\nfunction upsertHeadLink(\n rel: string,\n href: string,\n attributes: LinkAttributes,\n): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const selector = `link[rel=\"${escapeSelectorValue(rel)}\"][href=\"${escapeSelectorValue(href)}\"]`;\n if (document.head.querySelector(selector) !== null) {\n return;\n }\n\n const link = document.createElement(\"link\");\n link.setAttribute(\"rel\", rel);\n link.setAttribute(\"href\", href);\n applyAttributes(link, attributes);\n document.head.append(link);\n}\n\nfunction upsertHeadScript(\n src: string,\n attributes: LinkAttributes,\n): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const selector = `script[src=\"${escapeSelectorValue(src)}\"]`;\n if (document.head.querySelector(selector) !== null) {\n return;\n }\n\n const script = document.createElement(\"script\");\n if (attributes.type === \"module\") {\n script.setAttribute(\"type\", \"module\");\n script.setAttribute(\"src\", src);\n applyAttributes(script, { ...attributes, type: undefined });\n } else {\n script.setAttribute(\"src\", src);\n applyAttributes(script, attributes);\n }\n\n document.head.append(script);\n}\n\nfunction applyAttributes(element: Element, attributes: LinkAttributes): void {\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) {\n continue;\n }\n element.setAttribute(name, value);\n }\n}\n\nfunction escapeSelectorValue(value: string): string {\n return value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"');\n}\n\n/** React DOM-compatible default export object. */\nconst ReactDOM = {\n createPortal,\n flushSync,\n render,\n unmountComponentAtNode,\n useFormState,\n createRoot,\n hydrateRoot,\n version,\n useFormStatus,\n requestFormReset,\n unstable_batchedUpdates,\n prefetchDNS,\n preconnect,\n preload,\n preloadModule,\n preinit,\n preinitModule,\n} as const;\n\nexport default ReactDOM;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,MAAM,EACN,sBAAsB,EACtB,cAAc,IAAI,YAAY,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD,iFAAiF;AACjF,OAAO,EACL,YAAY,EACZ,SAAS,EACT,MAAM,EACN,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,CAAC;AAGF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAmFhC,8EAA8E;AAC9E,MAAM,UAAU,aAA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SAAM,CAAC;QACN,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAChC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,eAAe,CAAC,OAAgB,EAAE,UAA0B;IACnE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACvD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;QACD,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,kDAAkD;AAClD,MAAM,QAAQ,GAAG;IACf,YAAY;IACZ,SAAS;IACT,MAAM;IACN,sBAAsB;IACtB,YAAY;IACZ,UAAU;IACV,WAAW;IACX,OAAO;IACP,aAAa;IACb,gBAAgB;IAChB,uBAAuB;IACvB,WAAW;IACX,UAAU;IACV,OAAO;IACP,aAAa;IACb,OAAO;IACP,aAAa;CACL,CAAC;AAEX,eAAe,QAAQ,CAAC","sourcesContent":["import {\n createPortal,\n flushSync,\n render,\n unmountComponentAtNode,\n useActionState as useFormState,\n} from \"@reckona/mreact-compat\";\nimport { runWithEventPriority } from \"@reckona/mreact-compat/event-priority\";\nimport { createRoot, hydrateRoot } from \"./client.js\";\n\n/** Re-exports the React DOM rendering helpers exposed by the root entrypoint. */\nexport {\n createPortal,\n flushSync,\n render,\n unmountComponentAtNode,\n useFormState,\n createRoot,\n hydrateRoot,\n};\nexport type { HydrateRootOptions, Root, RootOptions } from \"./client.js\";\n\n/** React DOM-compatible package version. */\nexport const version = \"19.2.6\";\n\n/** Idle form status returned when no form submission is pending. */\nexport interface FormStatusNotPending {\n pending: false;\n data: null;\n method: null;\n action: null;\n}\n\n/** Pending form status returned while a submission is in progress. */\nexport interface FormStatusPending {\n pending: true;\n data: FormData;\n method: string;\n action: string | ((formData: FormData) => void | Promise<void>);\n}\n\n/** Current form submission state returned by useFormStatus. */\nexport type FormStatus = FormStatusPending | FormStatusNotPending;\n\n/** Options applied when inserting a preconnect resource hint. */\nexport interface PreconnectOptions {\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n}\n\n/** Allowed destination values for preload resource hints. */\nexport type PreloadAs =\n | \"audio\"\n | \"document\"\n | \"embed\"\n | \"fetch\"\n | \"font\"\n | \"image\"\n | \"object\"\n | \"track\"\n | \"script\"\n | \"style\"\n | \"video\"\n | \"worker\";\n\n/** Options applied when inserting a preload resource hint. */\nexport interface PreloadOptions {\n as: PreloadAs;\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n fetchPriority?: \"high\" | \"low\" | \"auto\";\n imageSizes?: string;\n imageSrcSet?: string;\n integrity?: string;\n type?: string;\n nonce?: string;\n referrerPolicy?: ReferrerPolicy;\n media?: string;\n}\n\n/** Options applied when inserting a modulepreload resource hint. */\nexport interface PreloadModuleOptions {\n as?: RequestDestination;\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n integrity?: string;\n nonce?: string;\n}\n\n/** Options applied when preinitializing a script or stylesheet resource. */\nexport interface PreinitOptions {\n as: \"script\" | \"style\";\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n fetchPriority?: \"high\" | \"low\" | \"auto\";\n precedence?: string;\n integrity?: string;\n nonce?: string;\n}\n\n/** Options applied when preinitializing a JavaScript module resource. */\nexport interface PreinitModuleOptions {\n as?: \"script\";\n crossOrigin?: \"anonymous\" | \"use-credentials\" | \"\";\n integrity?: string;\n nonce?: string;\n}\n\ntype LinkAttributes = Record<string, string | undefined>;\n\n/** Returns the current form submission status for the nearest form action. */\nexport function useFormStatus(): FormStatus {\n throw new Error(\n \"useFormStatus is not supported by @reckona/mreact-dom yet. Use useFormState/useActionState for local pending state instead.\",\n );\n}\n\n/** Resets a form element after a server action-style submission completes. */\nexport function requestFormReset(form: HTMLFormElement): void {\n form.reset();\n}\n\n/** Runs a callback at discrete event priority and returns its result. */\nexport function unstable_batchedUpdates<T>(callback: () => T): T;\nexport function unstable_batchedUpdates<TArgument, TResult>(\n callback: (argument: TArgument) => TResult,\n argument: TArgument,\n): TResult;\nexport function unstable_batchedUpdates<TArgument, TResult>(\n callback: ((argument: TArgument) => TResult) | (() => TResult),\n argument?: TArgument,\n): TResult {\n return runWithEventPriority(\"discrete\", () =>\n argument === undefined\n ? (callback as () => TResult)()\n : (callback as (argument: TArgument) => TResult)(argument)\n );\n}\n\n/** Inserts a dns-prefetch link for the provided host if it is not already present. */\nexport function prefetchDNS(href: string): void {\n upsertHeadLink(\"dns-prefetch\", href, {});\n}\n\n/** Inserts a preconnect link for the provided origin if it is not already present. */\nexport function preconnect(href: string, options: PreconnectOptions = {}): void {\n upsertHeadLink(\"preconnect\", href, {\n crossorigin: options.crossOrigin,\n });\n}\n\n/** Inserts a preload link for the provided resource if it is not already present. */\nexport function preload(href: string, options: PreloadOptions): void {\n upsertHeadLink(\"preload\", href, {\n as: options.as,\n crossorigin: options.crossOrigin,\n fetchpriority: options.fetchPriority,\n imagesrcset: options.imageSrcSet,\n imagesizes: options.imageSizes,\n integrity: options.integrity,\n media: options.media,\n nonce: options.nonce,\n referrerpolicy: options.referrerPolicy,\n type: options.type,\n });\n}\n\n/** Inserts a modulepreload link for the provided module if it is not already present. */\nexport function preloadModule(href: string, options: PreloadModuleOptions = {}): void {\n upsertHeadLink(\"modulepreload\", href, {\n as: options.as,\n crossorigin: options.crossOrigin,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n}\n\n/** Preinitializes a script or stylesheet resource in the document head. */\nexport function preinit(href: string, options: PreinitOptions): void {\n if (options.as === \"style\") {\n upsertHeadLink(\"stylesheet\", href, {\n \"data-precedence\": options.precedence,\n crossorigin: options.crossOrigin,\n fetchpriority: options.fetchPriority,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n return;\n }\n\n upsertHeadScript(href, {\n async: \"\",\n crossorigin: options.crossOrigin,\n fetchpriority: options.fetchPriority,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n}\n\n/** Preinitializes a JavaScript module resource in the document head. */\nexport function preinitModule(href: string, options: PreinitModuleOptions = {}): void {\n upsertHeadScript(href, {\n type: \"module\",\n async: \"\",\n crossorigin: options.crossOrigin,\n integrity: options.integrity,\n nonce: options.nonce,\n });\n}\n\nfunction upsertHeadLink(\n rel: string,\n href: string,\n attributes: LinkAttributes,\n): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const selector = `link[rel=\"${escapeSelectorValue(rel)}\"][href=\"${escapeSelectorValue(href)}\"]`;\n if (document.head.querySelector(selector) !== null) {\n return;\n }\n\n const link = document.createElement(\"link\");\n link.setAttribute(\"rel\", rel);\n link.setAttribute(\"href\", href);\n applyAttributes(link, attributes);\n document.head.append(link);\n}\n\nfunction upsertHeadScript(\n src: string,\n attributes: LinkAttributes,\n): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const selector = `script[src=\"${escapeSelectorValue(src)}\"]`;\n if (document.head.querySelector(selector) !== null) {\n return;\n }\n\n const script = document.createElement(\"script\");\n if (attributes.type === \"module\") {\n script.setAttribute(\"type\", \"module\");\n script.setAttribute(\"src\", src);\n applyAttributes(script, { ...attributes, type: undefined });\n } else {\n script.setAttribute(\"src\", src);\n applyAttributes(script, attributes);\n }\n\n document.head.append(script);\n}\n\nfunction applyAttributes(element: Element, attributes: LinkAttributes): void {\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) {\n continue;\n }\n element.setAttribute(name, value);\n }\n}\n\nfunction escapeSelectorValue(value: string): string {\n return value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"');\n}\n\n/** React DOM-compatible default export object. */\nconst ReactDOM = {\n createPortal,\n flushSync,\n render,\n unmountComponentAtNode,\n useFormState,\n createRoot,\n hydrateRoot,\n version,\n useFormStatus,\n requestFormReset,\n unstable_batchedUpdates,\n prefetchDNS,\n preconnect,\n preload,\n preloadModule,\n preinit,\n preinitModule,\n} as const;\n\nexport default ReactDOM;\n"]}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,oBAAoB,GAEvC,MAAM,wBAAwB,CAAC;AAEhC,wCAAwC;AACxC,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAyFhC,yDAAyD;AACzD,MAAM,UAAU,cAAc,CAAC,OAAwB,EAAE,QAAwB;IAC/E,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAAC,OAAwB,EAAE,OAAuB;IACpF,KAAK,OAAO,CAAC;IACb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAwB,EACxB,UAAyC,EAAE;IAE3C,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,IAAI,eAA2B,CAAC;IAChC,IAAI,cAAwC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrD,eAAe,GAAG,OAAO,CAAC;QAC1B,cAAc,GAAG,MAAM,CAAC;IAC1B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AAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,aAAa,CAAC,OAA+C;IACpE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;IACxD,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import {\n renderToString as renderCompatToString,\n type ReactCompatNode,\n} from \"@reckona/mreact-compat\";\n\n/** React DOM server package version. */\nexport const version = \"19.2.6\";\n\n/** Destination accepted by a pipeable server render stream. */\nexport interface PipeableStreamDestination {\n write(chunk: string | Uint8Array): unknown;\n end?(): unknown;\n destroy?(error?: unknown): unknown;\n}\n\n/** Minimal pipeable stream returned by Node-oriented server rendering. */\nexport interface PipeableStream {\n pipe<TDestination extends PipeableStreamDestination>(destination: TDestination): TDestination;\n abort(reason?: unknown): void;\n}\n\n/** External bootstrap script descriptor emitted after the rendered HTML. */\nexport interface BootstrapScriptDescriptor {\n src: string;\n integrity?: string;\n crossOrigin?: string;\n}\n\n/** Import map descriptor emitted as an inline bootstrap resource. */\nexport interface ReactImportMap {\n imports?: Record<string, string>;\n integrity?: Record<string, string>;\n scopes?: Record<string, Record<string, string>>;\n}\n\n/** Bootstrap scripts, modules, and import maps appended to server output. */\nexport interface RenderBootstrapOptions {\n nonce?: string;\n importMap?: ReactImportMap;\n bootstrapScriptContent?: string;\n bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;\n bootstrapModules?: Array<string | BootstrapScriptDescriptor>;\n}\n\n/** Shared server render options accepted by string rendering helpers. */\nexport interface ServerOptions {\n identifierPrefix?: string;\n}\n\n/** Options for rendering HTML to a pipeable stream. */\nexport interface RenderToPipeableStreamOptions {\n identifierPrefix?: string;\n namespaceURI?: string;\n nonce?: string;\n importMap?: ReactImportMap;\n bootstrapScriptContent?: string;\n bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;\n bootstrapModules?: Array<string | BootstrapScriptDescriptor>;\n headersLengthHint?: number;\n progressiveChunkSize?: number;\n onHeaders?(headers: Headers): void;\n onShellReady?(): void;\n onAllReady?(): void;\n onShellError?(error: unknown): void;\n onError?(error: unknown, errorInfo?: { componentStack: string }): string | void;\n formState?: unknown;\n}\n\n/** Options for rendering HTML to a WHATWG readable stream. */\nexport interface RenderToReadableStreamOptions {\n identifierPrefix?: string;\n namespaceURI?: string;\n nonce?: string;\n importMap?: ReactImportMap;\n bootstrapScriptContent?: string;\n bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;\n bootstrapModules?: Array<string | BootstrapScriptDescriptor>;\n headersLengthHint?: number;\n progressiveChunkSize?: number;\n signal?: AbortSignal;\n onHeaders?(headers: Headers): void;\n onError?(error: unknown, errorInfo?: { componentStack: string }): string | void;\n formState?: unknown;\n}\n\n/** Readable stream augmented with the allReady promise used by React DOM server. */\nexport interface ReactDOMServerReadableStream extends ReadableStream<Uint8Array> {\n allReady: Promise<void>;\n}\n\n/** Options accepted by resumable server rendering helpers. */\nexport type ResumeOptions = RenderToReadableStreamOptions & RenderToPipeableStreamOptions;\n/** Placeholder type for postponed render state. */\nexport type PostponedState = unknown;\n\n/** Renders a React-compatible node to an HTML string. */\nexport function renderToString(element: ReactCompatNode, _options?: ServerOptions): string {\n return renderCompatToString(() => element);\n}\n\n/** Renders a React-compatible node to static HTML without hydration metadata. */\nexport function renderToStaticMarkup(element: ReactCompatNode, options?: ServerOptions): string {\n void options;\n return renderToString(element);\n}\n\n/** Renders a React-compatible node to a WHATWG readable stream. */\nexport async function renderToReadableStream(\n element: ReactCompatNode,\n options: RenderToReadableStreamOptions = {},\n): Promise<ReactDOMServerReadableStream> {\n const encoder = new TextEncoder();\n const html = renderServerHtml(element, options);\n notifyHeaders(options);\n let resolveAllReady: () => void;\n let rejectAllReady: (error: unknown) => void;\n const allReady = new Promise<void>((resolve, reject) => {\n resolveAllReady = resolve;\n rejectAllReady = reject;\n });\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n if (options.signal?.aborted === true) {\n const reason = options.signal.reason;\n rejectAllReady(reason);\n controller.error(reason);\n return;\n }\n\n const abort = () => {\n const reason = options.signal?.reason;\n rejectAllReady(reason);\n controller.error(reason);\n };\n options.signal?.addEventListener(\"abort\", abort, { once: true });\n\n try {\n controller.enqueue(encoder.encode(html));\n controller.close();\n resolveAllReady();\n } catch (error) {\n options.onError?.(error, { componentStack: \"\" });\n rejectAllReady(error);\n controller.error(error);\n } finally {\n options.signal?.removeEventListener(\"abort\", abort);\n }\n },\n });\n\n return Object.assign(stream, { allReady });\n}\n\n/** Renders a React-compatible node to a Node-style pipeable stream. */\nexport function renderToPipeableStream(\n element: ReactCompatNode,\n options: RenderToPipeableStreamOptions = {},\n): PipeableStream {\n let aborted = false;\n let finished = false;\n\n return {\n pipe(destination) {\n queueMicrotask(() => {\n if (aborted) {\n return;\n }\n\n try {\n notifyHeaders(options);\n options.onShellReady?.();\n const html = renderServerHtml(element, options);\n options.onAllReady?.();\n destination.write(html);\n destination.end?.();\n finished = true;\n } catch (error) {\n options.onError?.(error, { componentStack: \"\" });\n options.onShellError?.(error);\n destination.destroy?.(error);\n }\n });\n\n return destination;\n },\n abort(reason) {\n if (finished) {\n return;\n }\n\n aborted = true;\n options.onError?.(reason ?? new Error(\"renderToPipeableStream was aborted.\"), {\n componentStack: \"\",\n });\n },\n };\n}\n\n/** Resumes postponed server rendering into a WHATWG readable stream. */\nexport async function resume(\n element: ReactCompatNode,\n _postponedState: PostponedState,\n options: ResumeOptions = {},\n): Promise<ReactDOMServerReadableStream> {\n return renderToReadableStream(element, options);\n}\n\n/** Resumes postponed server rendering into a Node-style pipeable stream. */\nexport async function resumeToPipeableStream(\n element: ReactCompatNode,\n _postponedState: PostponedState,\n options: ResumeOptions = {},\n): Promise<PipeableStream> {\n return renderToPipeableStream(element, options);\n}\n\nfunction renderServerHtml(element: ReactCompatNode, options: RenderBootstrapOptions): string {\n return `${renderToString(element)}${renderBootstrapResources(options)}`;\n}\n\nfunction renderBootstrapResources(options: RenderBootstrapOptions): string {\n const nonce = options.nonce === undefined ? \"\" : ` nonce=\"${escapeAttribute(options.nonce)}\"`;\n const importMap =\n options.importMap === undefined\n ? \"\"\n : `<script type=\"importmap\"${nonce}>${escapeScriptContent(JSON.stringify(options.importMap))}</script>`;\n const inlineScript =\n options.bootstrapScriptContent === undefined\n ? \"\"\n : `<script${nonce}>${escapeScriptContent(options.bootstrapScriptContent)}</script>`;\n const scripts = (options.bootstrapScripts ?? [])\n .map((script) => renderExternalScript(script, nonce, undefined))\n .join(\"\");\n const modules = (options.bootstrapModules ?? [])\n .map((script) => renderExternalScript(script, nonce, \"module\"))\n .join(\"\");\n\n return `${importMap}${inlineScript}${scripts}${modules}`;\n}\n\nfunction renderExternalScript(\n script: string | BootstrapScriptDescriptor,\n nonce: string,\n type: \"module\" | undefined,\n): string {\n const descriptor = typeof script === \"string\" ? { src: script } : script;\n const typeAttribute = type === undefined ? \"\" : ` type=\"${type}\"`;\n const src = ` src=\"${escapeAttribute(descriptor.src)}\"`;\n const integrity =\n descriptor.integrity === undefined ? \"\" : ` integrity=\"${escapeAttribute(descriptor.integrity)}\"`;\n const crossOrigin =\n descriptor.crossOrigin === undefined\n ? \"\"\n : ` crossorigin=\"${escapeAttribute(descriptor.crossOrigin)}\"`;\n\n return `<script${typeAttribute}${src}${nonce}${integrity}${crossOrigin}></script>`;\n}\n\nfunction escapeAttribute(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll('\"', \""\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\");\n}\n\nfunction escapeScriptContent(value: string): string {\n return value\n .replaceAll(\"<\", \"\\\\u003c\")\n .replaceAll(\"\\u2028\", \"\\\\u2028\")\n .replaceAll(\"\\u2029\", \"\\\\u2029\");\n}\n\nfunction notifyHeaders(options: { onHeaders?(headers: Headers): void }): void {\n if (options.onHeaders === undefined) {\n return;\n }\n\n const headers = new Headers();\n headers.set(\"content-type\", \"text/html; charset=utf-8\");\n options.onHeaders(headers);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,oBAAoB,GAEvC,MAAM,wBAAwB,CAAC;AAEhC,wCAAwC;AACxC,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAyFhC,yDAAyD;AACzD,MAAM,UAAU,cAAc,CAAC,OAAwB,EAAE,QAAwB;IAC/E,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAAC,OAAwB,EAAE,OAAuB;IACpF,KAAK,OAAO,CAAC;IACb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAwB,EACxB,OAAO,GAAkC,EAAE;IAE3C,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,aAAa,CAAC,OAAO,CAAC,CAAC;IACvB,IAAI,eAA2B,CAAC;IAChC,IAAI,cAAwC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrD,eAAe,GAAG,OAAO,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AAG,EAAE,QAAQ,CAAC;SACzB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,aAAa,CAAC,OAA+C;IACpE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;IACxD,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import {\n renderToString as renderCompatToString,\n type ReactCompatNode,\n} from \"@reckona/mreact-compat\";\n\n/** React DOM server package version. */\nexport const version = \"19.2.6\";\n\n/** Destination accepted by a pipeable server render stream. */\nexport interface PipeableStreamDestination {\n write(chunk: string | Uint8Array): unknown;\n end?(): unknown;\n destroy?(error?: unknown): unknown;\n}\n\n/** Minimal pipeable stream returned by Node-oriented server rendering. */\nexport interface PipeableStream {\n pipe<TDestination extends PipeableStreamDestination>(destination: TDestination): TDestination;\n abort(reason?: unknown): void;\n}\n\n/** External bootstrap script descriptor emitted after the rendered HTML. */\nexport interface BootstrapScriptDescriptor {\n src: string;\n integrity?: string;\n crossOrigin?: string;\n}\n\n/** Import map descriptor emitted as an inline bootstrap resource. */\nexport interface ReactImportMap {\n imports?: Record<string, string>;\n integrity?: Record<string, string>;\n scopes?: Record<string, Record<string, string>>;\n}\n\n/** Bootstrap scripts, modules, and import maps appended to server output. */\nexport interface RenderBootstrapOptions {\n nonce?: string;\n importMap?: ReactImportMap;\n bootstrapScriptContent?: string;\n bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;\n bootstrapModules?: Array<string | BootstrapScriptDescriptor>;\n}\n\n/** Shared server render options accepted by string rendering helpers. */\nexport interface ServerOptions {\n identifierPrefix?: string;\n}\n\n/** Options for rendering HTML to a pipeable stream. */\nexport interface RenderToPipeableStreamOptions {\n identifierPrefix?: string;\n namespaceURI?: string;\n nonce?: string;\n importMap?: ReactImportMap;\n bootstrapScriptContent?: string;\n bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;\n bootstrapModules?: Array<string | BootstrapScriptDescriptor>;\n headersLengthHint?: number;\n progressiveChunkSize?: number;\n onHeaders?(headers: Headers): void;\n onShellReady?(): void;\n onAllReady?(): void;\n onShellError?(error: unknown): void;\n onError?(error: unknown, errorInfo?: { componentStack: string }): string | void;\n formState?: unknown;\n}\n\n/** Options for rendering HTML to a WHATWG readable stream. */\nexport interface RenderToReadableStreamOptions {\n identifierPrefix?: string;\n namespaceURI?: string;\n nonce?: string;\n importMap?: ReactImportMap;\n bootstrapScriptContent?: string;\n bootstrapScripts?: Array<string | BootstrapScriptDescriptor>;\n bootstrapModules?: Array<string | BootstrapScriptDescriptor>;\n headersLengthHint?: number;\n progressiveChunkSize?: number;\n signal?: AbortSignal;\n onHeaders?(headers: Headers): void;\n onError?(error: unknown, errorInfo?: { componentStack: string }): string | void;\n formState?: unknown;\n}\n\n/** Readable stream augmented with the allReady promise used by React DOM server. */\nexport interface ReactDOMServerReadableStream extends ReadableStream<Uint8Array> {\n allReady: Promise<void>;\n}\n\n/** Options accepted by resumable server rendering helpers. */\nexport type ResumeOptions = RenderToReadableStreamOptions & RenderToPipeableStreamOptions;\n/** Placeholder type for postponed render state. */\nexport type PostponedState = unknown;\n\n/** Renders a React-compatible node to an HTML string. */\nexport function renderToString(element: ReactCompatNode, _options?: ServerOptions): string {\n return renderCompatToString(() => element);\n}\n\n/** Renders a React-compatible node to static HTML without hydration metadata. */\nexport function renderToStaticMarkup(element: ReactCompatNode, options?: ServerOptions): string {\n void options;\n return renderToString(element);\n}\n\n/** Renders a React-compatible node to a WHATWG readable stream. */\nexport async function renderToReadableStream(\n element: ReactCompatNode,\n options: RenderToReadableStreamOptions = {},\n): Promise<ReactDOMServerReadableStream> {\n const encoder = new TextEncoder();\n const html = renderServerHtml(element, options);\n notifyHeaders(options);\n let resolveAllReady: () => void;\n let rejectAllReady: (error: unknown) => void;\n const allReady = new Promise<void>((resolve, reject) => {\n resolveAllReady = resolve;\n rejectAllReady = reject;\n });\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n if (options.signal?.aborted === true) {\n const reason = options.signal.reason;\n rejectAllReady(reason);\n controller.error(reason);\n return;\n }\n\n const abort = () => {\n const reason = options.signal?.reason;\n rejectAllReady(reason);\n controller.error(reason);\n };\n options.signal?.addEventListener(\"abort\", abort, { once: true });\n\n try {\n controller.enqueue(encoder.encode(html));\n controller.close();\n resolveAllReady();\n } catch (error) {\n options.onError?.(error, { componentStack: \"\" });\n rejectAllReady(error);\n controller.error(error);\n } finally {\n options.signal?.removeEventListener(\"abort\", abort);\n }\n },\n });\n\n return Object.assign(stream, { allReady });\n}\n\n/** Renders a React-compatible node to a Node-style pipeable stream. */\nexport function renderToPipeableStream(\n element: ReactCompatNode,\n options: RenderToPipeableStreamOptions = {},\n): PipeableStream {\n let aborted = false;\n let finished = false;\n\n return {\n pipe(destination) {\n queueMicrotask(() => {\n if (aborted) {\n return;\n }\n\n try {\n notifyHeaders(options);\n options.onShellReady?.();\n const html = renderServerHtml(element, options);\n options.onAllReady?.();\n destination.write(html);\n destination.end?.();\n finished = true;\n } catch (error) {\n options.onError?.(error, { componentStack: \"\" });\n options.onShellError?.(error);\n destination.destroy?.(error);\n }\n });\n\n return destination;\n },\n abort(reason) {\n if (finished) {\n return;\n }\n\n aborted = true;\n options.onError?.(reason ?? new Error(\"renderToPipeableStream was aborted.\"), {\n componentStack: \"\",\n });\n },\n };\n}\n\n/** Resumes postponed server rendering into a WHATWG readable stream. */\nexport async function resume(\n element: ReactCompatNode,\n _postponedState: PostponedState,\n options: ResumeOptions = {},\n): Promise<ReactDOMServerReadableStream> {\n return renderToReadableStream(element, options);\n}\n\n/** Resumes postponed server rendering into a Node-style pipeable stream. */\nexport async function resumeToPipeableStream(\n element: ReactCompatNode,\n _postponedState: PostponedState,\n options: ResumeOptions = {},\n): Promise<PipeableStream> {\n return renderToPipeableStream(element, options);\n}\n\nfunction renderServerHtml(element: ReactCompatNode, options: RenderBootstrapOptions): string {\n return `${renderToString(element)}${renderBootstrapResources(options)}`;\n}\n\nfunction renderBootstrapResources(options: RenderBootstrapOptions): string {\n const nonce = options.nonce === undefined ? \"\" : ` nonce=\"${escapeAttribute(options.nonce)}\"`;\n const importMap =\n options.importMap === undefined\n ? \"\"\n : `<script type=\"importmap\"${nonce}>${escapeScriptContent(JSON.stringify(options.importMap))}</script>`;\n const inlineScript =\n options.bootstrapScriptContent === undefined\n ? \"\"\n : `<script${nonce}>${escapeScriptContent(options.bootstrapScriptContent)}</script>`;\n const scripts = (options.bootstrapScripts ?? [])\n .map((script) => renderExternalScript(script, nonce, undefined))\n .join(\"\");\n const modules = (options.bootstrapModules ?? [])\n .map((script) => renderExternalScript(script, nonce, \"module\"))\n .join(\"\");\n\n return `${importMap}${inlineScript}${scripts}${modules}`;\n}\n\nfunction renderExternalScript(\n script: string | BootstrapScriptDescriptor,\n nonce: string,\n type: \"module\" | undefined,\n): string {\n const descriptor = typeof script === \"string\" ? { src: script } : script;\n const typeAttribute = type === undefined ? \"\" : ` type=\"${type}\"`;\n const src = ` src=\"${escapeAttribute(descriptor.src)}\"`;\n const integrity =\n descriptor.integrity === undefined ? \"\" : ` integrity=\"${escapeAttribute(descriptor.integrity)}\"`;\n const crossOrigin =\n descriptor.crossOrigin === undefined\n ? \"\"\n : ` crossorigin=\"${escapeAttribute(descriptor.crossOrigin)}\"`;\n\n return `<script${typeAttribute}${src}${nonce}${integrity}${crossOrigin}></script>`;\n}\n\nfunction escapeAttribute(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll('\"', \""\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\");\n}\n\nfunction escapeScriptContent(value: string): string {\n return value\n .replaceAll(\"<\", \"\\\\u003c\")\n .replaceAll(\"\\u2028\", \"\\\\u2028\")\n .replaceAll(\"\\u2029\", \"\\\\u2029\");\n}\n\nfunction notifyHeaders(options: { onHeaders?(headers: Headers): void }): void {\n if (options.onHeaders === undefined) {\n return;\n }\n\n const headers = new Headers();\n headers.set(\"content-type\", \"text/html; charset=utf-8\");\n options.onHeaders(headers);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reckona/mreact-dom",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.189",
|
|
4
4
|
"description": "React DOM-compatible entrypoints for mreact.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dom",
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@reckona/mreact-compat": "0.0.
|
|
67
|
+
"@reckona/mreact-compat": "0.0.189"
|
|
68
68
|
}
|
|
69
69
|
}
|