1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #5997 from dmitrylyzo/fix-legacy-devtools

Fix @tanstack/query-devtools on legacy browsers
This commit is contained in:
Bill Thornton 2024-09-06 12:22:38 -04:00 committed by GitHub
commit 4bcbf65d1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View file

@ -5,10 +5,14 @@ import React from 'react';
import { ApiProvider } from 'hooks/useApi';
import { UserSettingsProvider } from 'hooks/useUserSettings';
import { WebConfigProvider } from 'hooks/useWebConfig';
import browser from 'scripts/browser';
import { queryClient } from 'utils/query/queryClient';
import RootAppRouter from 'RootAppRouter';
const useReactQueryDevtools = window.Proxy // '@tanstack/query-devtools' requires 'Proxy', which cannot be polyfilled for legacy browsers
&& !browser.tv; // Don't use devtools on the TV as the navigation is weird
const RootApp = () => (
<QueryClientProvider client={queryClient}>
<ApiProvider>
@ -18,7 +22,9 @@ const RootApp = () => (
</WebConfigProvider>
</UserSettingsProvider>
</ApiProvider>
<ReactQueryDevtools initialIsOpen={false} />
{useReactQueryDevtools && (
<ReactQueryDevtools initialIsOpen={false} />
)}
</QueryClientProvider>
);

View file

@ -230,6 +230,23 @@ const config = {
}
}]
},
// Strict EcmaScript modules require additional flags
{
test: /\.(js|jsx|mjs)$/,
include: [
path.resolve(__dirname, 'node_modules/@tanstack/query-devtools')
],
resolve: {
fullySpecified: false
},
use: [{
loader: 'babel-loader',
options: {
cacheCompression: false,
cacheDirectory: true
}
}]
},
{
test: /\.worker\.ts$/,
exclude: /node_modules/,