@react-aria/ssr
Advanced tools
Comparing version 3.9.4-nightly.4624 to 3.9.4
@@ -48,3 +48,3 @@ var $14Xyt$react = require("react"); | ||
// append and increment the counter. | ||
prefix: cur === $97d95f6660b1bb14$var$defaultContext ? "" : `${cur.prefix}-${counter}`, | ||
prefix: cur === $97d95f6660b1bb14$var$defaultContext ? '' : `${cur.prefix}-${counter}`, | ||
current: 0 | ||
@@ -57,3 +57,3 @@ }), [ | ||
// then schedule a layout effect to update the component after hydration. | ||
if (typeof document !== "undefined") // This if statement technically breaks the rules of hooks, but is safe | ||
if (typeof document !== 'undefined') // This if statement technically breaks the rules of hooks, but is safe | ||
// because the condition never changes after mounting. | ||
@@ -72,5 +72,5 @@ // eslint-disable-next-line react-hooks/rules-of-hooks | ||
function $97d95f6660b1bb14$export$9f8ac96af4b1b2ae(props) { | ||
if (typeof (0, ($parcel$interopDefault($14Xyt$react)))["useId"] === "function") { | ||
if (process.env.NODE_ENV !== "test" && !$97d95f6660b1bb14$var$warnedAboutSSRProvider) { | ||
console.warn("In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app."); | ||
if (typeof (0, ($parcel$interopDefault($14Xyt$react)))['useId'] === 'function') { | ||
if (process.env.NODE_ENV !== 'test' && !$97d95f6660b1bb14$var$warnedAboutSSRProvider) { | ||
console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.'); | ||
$97d95f6660b1bb14$var$warnedAboutSSRProvider = true; | ||
@@ -82,3 +82,3 @@ } | ||
} | ||
let $97d95f6660b1bb14$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement); | ||
let $97d95f6660b1bb14$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement); | ||
let $97d95f6660b1bb14$var$componentIds = new WeakMap(); | ||
@@ -127,5 +127,5 @@ function $97d95f6660b1bb14$var$useCounter(isDisabled = false) { | ||
// provide a warning to hint to the developer to add one. | ||
if (ctx === $97d95f6660b1bb14$var$defaultContext && !$97d95f6660b1bb14$var$canUseDOM) console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server."); | ||
if (ctx === $97d95f6660b1bb14$var$defaultContext && !$97d95f6660b1bb14$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.'); | ||
let counter = $97d95f6660b1bb14$var$useCounter(!!defaultId); | ||
let prefix = ctx === $97d95f6660b1bb14$var$defaultContext && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${ctx.prefix}`; | ||
let prefix = ctx === $97d95f6660b1bb14$var$defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`; | ||
return defaultId || `${prefix}-${counter}`; | ||
@@ -137,6 +137,6 @@ } | ||
let [didSSR] = (0, $14Xyt$react.useState)($97d95f6660b1bb14$export$535bd6ca7f90a273()); | ||
let prefix = didSSR || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${$97d95f6660b1bb14$var$defaultContext.prefix}`; | ||
let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${$97d95f6660b1bb14$var$defaultContext.prefix}`; | ||
return defaultId || `${prefix}-${id}`; | ||
} | ||
const $97d95f6660b1bb14$export$619500959fc48b26 = typeof (0, ($parcel$interopDefault($14Xyt$react)))["useId"] === "function" ? $97d95f6660b1bb14$var$useModernSSRSafeId : $97d95f6660b1bb14$var$useLegacySSRSafeId; | ||
const $97d95f6660b1bb14$export$619500959fc48b26 = typeof (0, ($parcel$interopDefault($14Xyt$react)))['useId'] === 'function' ? $97d95f6660b1bb14$var$useModernSSRSafeId : $97d95f6660b1bb14$var$useLegacySSRSafeId; | ||
function $97d95f6660b1bb14$var$getSnapshot() { | ||
@@ -155,3 +155,3 @@ return false; | ||
// In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating. | ||
if (typeof (0, ($parcel$interopDefault($14Xyt$react)))["useSyncExternalStore"] === "function") return (0, ($parcel$interopDefault($14Xyt$react)))["useSyncExternalStore"]($97d95f6660b1bb14$var$subscribe, $97d95f6660b1bb14$var$getSnapshot, $97d95f6660b1bb14$var$getServerSnapshot); | ||
if (typeof (0, ($parcel$interopDefault($14Xyt$react)))['useSyncExternalStore'] === 'function') return (0, ($parcel$interopDefault($14Xyt$react)))['useSyncExternalStore']($97d95f6660b1bb14$var$subscribe, $97d95f6660b1bb14$var$getSnapshot, $97d95f6660b1bb14$var$getServerSnapshot); | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
@@ -158,0 +158,0 @@ return (0, $14Xyt$react.useContext)($97d95f6660b1bb14$var$IsSSRContext); |
@@ -36,3 +36,3 @@ import $670gB$react, {useContext as $670gB$useContext, useState as $670gB$useState, useMemo as $670gB$useMemo, useLayoutEffect as $670gB$useLayoutEffect, useRef as $670gB$useRef} from "react"; | ||
// append and increment the counter. | ||
prefix: cur === $b5e257d569688ac6$var$defaultContext ? "" : `${cur.prefix}-${counter}`, | ||
prefix: cur === $b5e257d569688ac6$var$defaultContext ? '' : `${cur.prefix}-${counter}`, | ||
current: 0 | ||
@@ -45,3 +45,3 @@ }), [ | ||
// then schedule a layout effect to update the component after hydration. | ||
if (typeof document !== "undefined") // This if statement technically breaks the rules of hooks, but is safe | ||
if (typeof document !== 'undefined') // This if statement technically breaks the rules of hooks, but is safe | ||
// because the condition never changes after mounting. | ||
@@ -60,5 +60,5 @@ // eslint-disable-next-line react-hooks/rules-of-hooks | ||
function $b5e257d569688ac6$export$9f8ac96af4b1b2ae(props) { | ||
if (typeof (0, $670gB$react)["useId"] === "function") { | ||
if (process.env.NODE_ENV !== "test" && !$b5e257d569688ac6$var$warnedAboutSSRProvider) { | ||
console.warn("In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app."); | ||
if (typeof (0, $670gB$react)['useId'] === 'function') { | ||
if (process.env.NODE_ENV !== 'test' && !$b5e257d569688ac6$var$warnedAboutSSRProvider) { | ||
console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.'); | ||
$b5e257d569688ac6$var$warnedAboutSSRProvider = true; | ||
@@ -70,3 +70,3 @@ } | ||
} | ||
let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement); | ||
let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement); | ||
let $b5e257d569688ac6$var$componentIds = new WeakMap(); | ||
@@ -115,5 +115,5 @@ function $b5e257d569688ac6$var$useCounter(isDisabled = false) { | ||
// provide a warning to hint to the developer to add one. | ||
if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM) console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server."); | ||
if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.'); | ||
let counter = $b5e257d569688ac6$var$useCounter(!!defaultId); | ||
let prefix = ctx === $b5e257d569688ac6$var$defaultContext && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${ctx.prefix}`; | ||
let prefix = ctx === $b5e257d569688ac6$var$defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`; | ||
return defaultId || `${prefix}-${counter}`; | ||
@@ -125,6 +125,6 @@ } | ||
let [didSSR] = (0, $670gB$useState)($b5e257d569688ac6$export$535bd6ca7f90a273()); | ||
let prefix = didSSR || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`; | ||
let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`; | ||
return defaultId || `${prefix}-${id}`; | ||
} | ||
const $b5e257d569688ac6$export$619500959fc48b26 = typeof (0, $670gB$react)["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId; | ||
const $b5e257d569688ac6$export$619500959fc48b26 = typeof (0, $670gB$react)['useId'] === 'function' ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId; | ||
function $b5e257d569688ac6$var$getSnapshot() { | ||
@@ -143,3 +143,3 @@ return false; | ||
// In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating. | ||
if (typeof (0, $670gB$react)["useSyncExternalStore"] === "function") return (0, $670gB$react)["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot); | ||
if (typeof (0, $670gB$react)['useSyncExternalStore'] === 'function') return (0, $670gB$react)['useSyncExternalStore']($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot); | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
@@ -146,0 +146,0 @@ return (0, $670gB$useContext)($b5e257d569688ac6$var$IsSSRContext); |
{ | ||
"name": "@react-aria/ssr", | ||
"version": "3.9.4-nightly.4624+d80999e89", | ||
"version": "3.9.4", | ||
"description": "Spectrum UI components in React", | ||
@@ -44,3 +44,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882" | ||
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
17
37
81376