soapbox/app/soapbox/main.tsx

35 lines
820 B
TypeScript
Raw Normal View History

2020-03-27 20:59:38 +00:00
'use strict';
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';
import * as BuildConfig from 'soapbox/build_config';
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';
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(() => {
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
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;