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