@remix-run/react
Advanced tools
Comparing version 0.0.0-experimental-0a311ab2 to 0.0.0-experimental-149e932f
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -491,10 +491,9 @@ * Copyright (c) Remix Software Inc. | ||
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Object.keys(meta).map(name => { | ||
let value = meta[name]; // Open Graph tags use the `property` attribute, while other meta tags | ||
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Object.entries(meta).map(([name, value]) => { | ||
// Open Graph tags use the `property` attribute, while other meta tags | ||
// use `name`. See https://ogp.me/ | ||
let isOpenGraphTag = name.startsWith("og:"); | ||
return name === "title" ? /*#__PURE__*/React__default["default"].createElement("title", { | ||
key: "title" | ||
}, meta[name]) : Array.isArray(value) ? value.map(content => isOpenGraphTag ? /*#__PURE__*/React__default["default"].createElement("meta", { | ||
}, value) : Array.isArray(value) ? value.map(content => isOpenGraphTag ? /*#__PURE__*/React__default["default"].createElement("meta", { | ||
key: name + content, | ||
@@ -518,3 +517,9 @@ property: name, | ||
} | ||
/** | ||
* Tracks whether Remix has finished hydrating or not, so scripts can be skipped | ||
* during client-side updates. | ||
*/ | ||
let isHydrated = false; | ||
/** | ||
@@ -536,2 +541,5 @@ * Renders the `<script>` tags needed for the initial render. Bundles for | ||
} = useRemixEntryContext(); | ||
React__default["default"].useEffect(() => { | ||
isHydrated = true; | ||
}, []); | ||
let initialScripts = React__default["default"].useMemo(() => { | ||
@@ -578,3 +586,3 @@ let contextScript = serverHandoffString ? `window.__remixContext = ${serverHandoffString};` : ""; | ||
crossOrigin: props.crossOrigin | ||
})), initialScripts); | ||
})), isHydrated ? null : initialScripts); | ||
} | ||
@@ -581,0 +589,0 @@ |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -86,19 +86,30 @@ * Copyright (c) Remix Software Inc. | ||
charSet: "utf-8" | ||
}), /*#__PURE__*/React__default["default"].createElement("title", null, "Uncaught Exception!")), /*#__PURE__*/React__default["default"].createElement("body", null, /*#__PURE__*/React__default["default"].createElement("main", { | ||
}), /*#__PURE__*/React__default["default"].createElement("meta", { | ||
name: "viewport", | ||
content: "width=device-width,initial-scale=1,viewport-fit=cover" | ||
}), /*#__PURE__*/React__default["default"].createElement("title", null, "Application Error!")), /*#__PURE__*/React__default["default"].createElement("body", null, /*#__PURE__*/React__default["default"].createElement("main", { | ||
style: { | ||
border: "solid 2px hsl(10, 50%, 50%)", | ||
fontFamily: "system-ui, sans-serif", | ||
padding: "2rem" | ||
} | ||
}, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("h1", null, "Uncaught Exception!"), /*#__PURE__*/React__default["default"].createElement("p", null, "If you are not the developer, please click back in your browser and try again."), /*#__PURE__*/React__default["default"].createElement("div", { | ||
}, /*#__PURE__*/React__default["default"].createElement("h1", { | ||
style: { | ||
fontFamily: `"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace`, | ||
padding: "1rem", | ||
margin: "1rem 0", | ||
border: "solid 4px" | ||
fontSize: "24px" | ||
} | ||
}, error.message), /*#__PURE__*/React__default["default"].createElement("p", null, "There was an uncaught exception in your application. Check the browser console and/or server console to inspect the error."), /*#__PURE__*/React__default["default"].createElement("p", null, "If you are the developer, consider adding your own error boundary so users don't see this page when unexpected errors happen in production!"), /*#__PURE__*/React__default["default"].createElement("p", null, "Read more about", " ", /*#__PURE__*/React__default["default"].createElement("a", { | ||
target: "_blank", | ||
rel: "noreferrer", | ||
href: "https://remix.run/guides/errors" | ||
}, "Error Handling in Remix"), "."))))); | ||
}, "Application Error"), /*#__PURE__*/React__default["default"].createElement("pre", { | ||
style: { | ||
padding: "2rem", | ||
background: "hsla(10, 50%, 50%, 0.1)", | ||
color: "red", | ||
overflow: "auto" | ||
} | ||
}, error.stack)), /*#__PURE__*/React__default["default"].createElement("script", { | ||
dangerouslySetInnerHTML: { | ||
__html: ` | ||
console.log( | ||
"💿 Hey developer👋. You can provide a way better UX when your app throws errors than this. Check out https://remix.run/guides/errors for more information." | ||
); | ||
` | ||
} | ||
}))); | ||
} | ||
@@ -127,2 +138,3 @@ let RemixCatchContext = /*#__PURE__*/React__default["default"].createContext(undefined); | ||
function RemixRootDefaultCatchBoundary() { | ||
let caught = useCatch(); | ||
return /*#__PURE__*/React__default["default"].createElement("html", { | ||
@@ -132,12 +144,19 @@ lang: "en" | ||
charSet: "utf-8" | ||
}), /*#__PURE__*/React__default["default"].createElement("title", null, "Unhandled Thrown Response!")), /*#__PURE__*/React__default["default"].createElement("body", null, /*#__PURE__*/React__default["default"].createElement("main", { | ||
}), /*#__PURE__*/React__default["default"].createElement("meta", { | ||
name: "viewport", | ||
content: "width=device-width,initial-scale=1,viewport-fit=cover" | ||
}), /*#__PURE__*/React__default["default"].createElement("title", null, "Unhandled Thrown Response!")), /*#__PURE__*/React__default["default"].createElement("body", null, /*#__PURE__*/React__default["default"].createElement("h1", { | ||
style: { | ||
border: "solid 2px hsl(10, 50%, 50%)", | ||
fontFamily: "system-ui, sans-serif", | ||
padding: "2rem" | ||
} | ||
}, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("h1", null, "Unhandled Thrown Response!"), /*#__PURE__*/React__default["default"].createElement("p", null, "If you are not the developer, please click back in your browser and try again."), /*#__PURE__*/React__default["default"].createElement("p", null, "There was an unhandled thrown response in your application."), /*#__PURE__*/React__default["default"].createElement("p", null, "If you are the developer, consider adding your own catch boundary so users don't see this page when unhandled thrown response happen in production!"), /*#__PURE__*/React__default["default"].createElement("p", null, "Read more about", " ", /*#__PURE__*/React__default["default"].createElement("a", { | ||
target: "_blank", | ||
rel: "noreferrer", | ||
href: "https://remix.run/guides/errors" | ||
}, "Throwing Responses in Remix"), "."))))); | ||
}, caught.status, " ", caught.statusText), /*#__PURE__*/React__default["default"].createElement("script", { | ||
dangerouslySetInnerHTML: { | ||
__html: ` | ||
console.log( | ||
"💿 Hey developer👋. You can provide a way better UX when your app throws 404s (and other responses) than this. Check out https://remix.run/guides/not-found for more information." | ||
); | ||
` | ||
} | ||
}))); | ||
} | ||
@@ -144,0 +163,0 @@ |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -483,10 +483,9 @@ * Copyright (c) Remix Software Inc. | ||
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Object.keys(meta).map(name => { | ||
let value = meta[name]; // Open Graph tags use the `property` attribute, while other meta tags | ||
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Object.entries(meta).map(([name, value]) => { | ||
// Open Graph tags use the `property` attribute, while other meta tags | ||
// use `name`. See https://ogp.me/ | ||
let isOpenGraphTag = name.startsWith("og:"); | ||
return name === "title" ? /*#__PURE__*/React__default.createElement("title", { | ||
key: "title" | ||
}, meta[name]) : Array.isArray(value) ? value.map(content => isOpenGraphTag ? /*#__PURE__*/React__default.createElement("meta", { | ||
}, value) : Array.isArray(value) ? value.map(content => isOpenGraphTag ? /*#__PURE__*/React__default.createElement("meta", { | ||
key: name + content, | ||
@@ -510,3 +509,9 @@ property: name, | ||
} | ||
/** | ||
* Tracks whether Remix has finished hydrating or not, so scripts can be skipped | ||
* during client-side updates. | ||
*/ | ||
let isHydrated = false; | ||
/** | ||
@@ -528,2 +533,5 @@ * Renders the `<script>` tags needed for the initial render. Bundles for | ||
} = useRemixEntryContext(); | ||
React__default.useEffect(() => { | ||
isHydrated = true; | ||
}, []); | ||
let initialScripts = React__default.useMemo(() => { | ||
@@ -570,3 +578,3 @@ let contextScript = serverHandoffString ? `window.__remixContext = ${serverHandoffString};` : ""; | ||
crossOrigin: props.crossOrigin | ||
})), initialScripts); | ||
})), isHydrated ? null : initialScripts); | ||
} | ||
@@ -573,0 +581,0 @@ |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -78,19 +78,30 @@ * Copyright (c) Remix Software Inc. | ||
charSet: "utf-8" | ||
}), /*#__PURE__*/React__default.createElement("title", null, "Uncaught Exception!")), /*#__PURE__*/React__default.createElement("body", null, /*#__PURE__*/React__default.createElement("main", { | ||
}), /*#__PURE__*/React__default.createElement("meta", { | ||
name: "viewport", | ||
content: "width=device-width,initial-scale=1,viewport-fit=cover" | ||
}), /*#__PURE__*/React__default.createElement("title", null, "Application Error!")), /*#__PURE__*/React__default.createElement("body", null, /*#__PURE__*/React__default.createElement("main", { | ||
style: { | ||
border: "solid 2px hsl(10, 50%, 50%)", | ||
fontFamily: "system-ui, sans-serif", | ||
padding: "2rem" | ||
} | ||
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h1", null, "Uncaught Exception!"), /*#__PURE__*/React__default.createElement("p", null, "If you are not the developer, please click back in your browser and try again."), /*#__PURE__*/React__default.createElement("div", { | ||
}, /*#__PURE__*/React__default.createElement("h1", { | ||
style: { | ||
fontFamily: `"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace`, | ||
padding: "1rem", | ||
margin: "1rem 0", | ||
border: "solid 4px" | ||
fontSize: "24px" | ||
} | ||
}, error.message), /*#__PURE__*/React__default.createElement("p", null, "There was an uncaught exception in your application. Check the browser console and/or server console to inspect the error."), /*#__PURE__*/React__default.createElement("p", null, "If you are the developer, consider adding your own error boundary so users don't see this page when unexpected errors happen in production!"), /*#__PURE__*/React__default.createElement("p", null, "Read more about", " ", /*#__PURE__*/React__default.createElement("a", { | ||
target: "_blank", | ||
rel: "noreferrer", | ||
href: "https://remix.run/guides/errors" | ||
}, "Error Handling in Remix"), "."))))); | ||
}, "Application Error"), /*#__PURE__*/React__default.createElement("pre", { | ||
style: { | ||
padding: "2rem", | ||
background: "hsla(10, 50%, 50%, 0.1)", | ||
color: "red", | ||
overflow: "auto" | ||
} | ||
}, error.stack)), /*#__PURE__*/React__default.createElement("script", { | ||
dangerouslySetInnerHTML: { | ||
__html: ` | ||
console.log( | ||
"💿 Hey developer👋. You can provide a way better UX when your app throws errors than this. Check out https://remix.run/guides/errors for more information." | ||
); | ||
` | ||
} | ||
}))); | ||
} | ||
@@ -119,2 +130,3 @@ let RemixCatchContext = /*#__PURE__*/React__default.createContext(undefined); | ||
function RemixRootDefaultCatchBoundary() { | ||
let caught = useCatch(); | ||
return /*#__PURE__*/React__default.createElement("html", { | ||
@@ -124,14 +136,21 @@ lang: "en" | ||
charSet: "utf-8" | ||
}), /*#__PURE__*/React__default.createElement("title", null, "Unhandled Thrown Response!")), /*#__PURE__*/React__default.createElement("body", null, /*#__PURE__*/React__default.createElement("main", { | ||
}), /*#__PURE__*/React__default.createElement("meta", { | ||
name: "viewport", | ||
content: "width=device-width,initial-scale=1,viewport-fit=cover" | ||
}), /*#__PURE__*/React__default.createElement("title", null, "Unhandled Thrown Response!")), /*#__PURE__*/React__default.createElement("body", null, /*#__PURE__*/React__default.createElement("h1", { | ||
style: { | ||
border: "solid 2px hsl(10, 50%, 50%)", | ||
fontFamily: "system-ui, sans-serif", | ||
padding: "2rem" | ||
} | ||
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h1", null, "Unhandled Thrown Response!"), /*#__PURE__*/React__default.createElement("p", null, "If you are not the developer, please click back in your browser and try again."), /*#__PURE__*/React__default.createElement("p", null, "There was an unhandled thrown response in your application."), /*#__PURE__*/React__default.createElement("p", null, "If you are the developer, consider adding your own catch boundary so users don't see this page when unhandled thrown response happen in production!"), /*#__PURE__*/React__default.createElement("p", null, "Read more about", " ", /*#__PURE__*/React__default.createElement("a", { | ||
target: "_blank", | ||
rel: "noreferrer", | ||
href: "https://remix.run/guides/errors" | ||
}, "Throwing Responses in Remix"), "."))))); | ||
}, caught.status, " ", caught.statusText), /*#__PURE__*/React__default.createElement("script", { | ||
dangerouslySetInnerHTML: { | ||
__html: ` | ||
console.log( | ||
"💿 Hey developer👋. You can provide a way better UX when your app throws 404s (and other responses) than this. Check out https://remix.run/guides/not-found for more information." | ||
); | ||
` | ||
} | ||
}))); | ||
} | ||
export { RemixCatchBoundary, RemixErrorBoundary, RemixRootDefaultCatchBoundary, RemixRootDefaultErrorBoundary, useCatch }; |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -29,4 +29,6 @@ * Copyright (c) Remix Software Inc. | ||
let descriptors = matches.map(match => { | ||
var _module$links; | ||
let module = routeModules[match.route.id]; | ||
return module.links && module.links() || []; | ||
return ((_module$links = module.links) === null || _module$links === void 0 ? void 0 : _module$links.call(module)) || []; | ||
}).flat(1); | ||
@@ -33,0 +35,0 @@ let preloads = getCurrentPageModulePreloadHrefs(matches, manifest); |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -33,4 +33,6 @@ * Copyright (c) Remix Software Inc. | ||
let descriptors = matches.map(match => { | ||
var _module$links; | ||
let module = routeModules[match.route.id]; | ||
return module.links && module.links() || []; | ||
return ((_module$links = module.links) === null || _module$links === void 0 ? void 0 : _module$links.call(module)) || []; | ||
}).flat(1); | ||
@@ -37,0 +39,0 @@ let preloads = getCurrentPageModulePreloadHrefs(matches, manifest); |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
{ | ||
"name": "@remix-run/react", | ||
"description": "React DOM bindings for Remix", | ||
"version": "0.0.0-experimental-0a311ab2", | ||
"version": "0.0.0-experimental-149e932f", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": { |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
@@ -49,3 +49,3 @@ import type { Location } from "history"; | ||
location: Location; | ||
}): HtmlMetaDescriptor; | ||
}): HtmlMetaDescriptor | undefined; | ||
} | ||
@@ -52,0 +52,0 @@ /** |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/react v0.0.0-experimental-0a311ab2 | ||
* @remix-run/react v0.0.0-experimental-149e932f | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6718
237030