mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 08:19:07 +02:00
feat: React 18 + automatic JSX runtime + build --dev (#8961)
This commit is contained in:
parent
76f920359b
commit
187e5aa218
69 changed files with 404 additions and 209 deletions
|
@ -45,8 +45,8 @@
|
|||
"fs-extra": "^11.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
"react-dom": "^16.8.4 || ^17.0.0"
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
|
|
|
@ -72,8 +72,14 @@ async function getIsAppInstalledRelatedApps() {
|
|||
if (!('getInstalledRelatedApps' in window.navigator)) {
|
||||
return false;
|
||||
}
|
||||
const relatedApps = await navigator.getInstalledRelatedApps();
|
||||
return relatedApps.some((app) => app.platform === 'webapp');
|
||||
try {
|
||||
const relatedApps = await navigator.getInstalledRelatedApps();
|
||||
return relatedApps.some((app) => app.platform === 'webapp');
|
||||
} catch (e) {
|
||||
// Error might be thrown when Docusaurus is embedded in an iframe:
|
||||
// registerSW failed DOMException: Failed to execute 'getInstalledRelatedApps' on 'Navigator': getInstalledRelatedApps() is only supported in top-level browsing contexts.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isStandaloneDisplayMode() {
|
||||
return window.matchMedia('(display-mode: standalone)').matches;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue