Fixed: Caching for dynamically loaded JS files Fixed: Incorrect caching of initialize.js (cherry picked from commit f0cb5b81f140c67fa84162e094cc4e0f3476f5da)pull/8883/head
parent
2959f72a10
commit
e691253419
@ -0,0 +1,21 @@
|
||||
import { createBrowserHistory } from 'history';
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import createAppStore from 'Store/createAppStore';
|
||||
import { fetchTranslations } from 'Utilities/String/translate';
|
||||
import App from './App/App';
|
||||
|
||||
export async function bootstrap() {
|
||||
const history = createBrowserHistory();
|
||||
const store = createAppStore(history);
|
||||
const hasTranslationsError = !(await fetchTranslations());
|
||||
|
||||
render(
|
||||
<App
|
||||
store={store}
|
||||
history={history}
|
||||
hasTranslationsError={hasTranslationsError}
|
||||
/>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
import { createBrowserHistory } from 'history';
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { fetchTranslations } from 'Utilities/String/translate';
|
||||
|
||||
import './preload';
|
||||
import './polyfills';
|
||||
import 'Styles/globals.css';
|
||||
import './index.css';
|
||||
|
||||
const history = createBrowserHistory();
|
||||
const hasTranslationsError = !await fetchTranslations();
|
||||
|
||||
const { default: createAppStore } = await import('Store/createAppStore');
|
||||
const { default: App } = await import('./App/App');
|
||||
|
||||
const store = createAppStore(history);
|
||||
|
||||
render(
|
||||
<App
|
||||
store={store}
|
||||
history={history}
|
||||
hasTranslationsError={hasTranslationsError}
|
||||
/>,
|
||||
document.getElementById('root')
|
||||
);
|
@ -0,0 +1,19 @@
|
||||
import './polyfills';
|
||||
import 'Styles/globals.css';
|
||||
import './index.css';
|
||||
|
||||
const initializeUrl = `${
|
||||
window.Radarr.urlBase
|
||||
}/initialize.json?t=${Date.now()}`;
|
||||
const response = await fetch(initializeUrl);
|
||||
|
||||
window.Radarr = await response.json();
|
||||
|
||||
/* eslint-disable no-undef, @typescript-eslint/ban-ts-comment */
|
||||
// @ts-ignore 2304
|
||||
__webpack_public_path__ = `${window.Radarr.urlBase}/`;
|
||||
/* eslint-enable no-undef, @typescript-eslint/ban-ts-comment */
|
||||
|
||||
const { bootstrap } = await import('./bootstrap');
|
||||
|
||||
await bootstrap();
|
Loading…
Reference in new issue