2020-03-27 20:59:38 +00:00
|
|
|
'use strict';
|
|
|
|
|
2021-08-22 19:34:58 +00:00
|
|
|
import './precheck';
|
2022-04-05 19:43:29 +00:00
|
|
|
import * as OfflinePluginRuntime from '@lcdp/offline-plugin/runtime';
|
2020-03-27 20:59:38 +00:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
2022-01-10 22:25:06 +00:00
|
|
|
|
2022-04-16 00:54:40 +00:00
|
|
|
import * as BuildConfig from 'soapbox/build_config';
|
2022-01-10 22:25:06 +00:00
|
|
|
|
2022-01-10 22:01:24 +00:00
|
|
|
import { default as Soapbox } from './containers/soapbox';
|
2021-09-08 20:45:44 +00:00
|
|
|
import * as monitoring from './monitoring';
|
2022-01-10 22:17:52 +00:00
|
|
|
import * as perf from './performance';
|
2020-03-27 20:59:38 +00:00
|
|
|
import ready from './ready';
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
perf.start('main()');
|
|
|
|
|
2021-09-08 20:45:44 +00:00
|
|
|
// Sentry
|
|
|
|
monitoring.start();
|
|
|
|
|
2020-03-27 20:59:38 +00:00
|
|
|
ready(() => {
|
2022-04-16 00:54:40 +00:00
|
|
|
const mountNode = document.getElementById('soapbox') as HTMLElement;
|
2020-03-27 20:59:38 +00:00
|
|
|
|
2020-05-28 22:52:07 +00:00
|
|
|
ReactDOM.render(<Soapbox />, mountNode);
|
2021-09-05 21:42:48 +00:00
|
|
|
|
2022-04-16 00:54:40 +00:00
|
|
|
if (BuildConfig.NODE_ENV === 'production') {
|
2022-04-05 19:43:29 +00:00
|
|
|
// avoid offline in dev mode because it's harder to debug
|
|
|
|
OfflinePluginRuntime.install();
|
|
|
|
}
|
2020-03-27 20:59:38 +00:00
|
|
|
perf.stop('main()');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default main;
|