-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.tsx
55 lines (46 loc) · 1.85 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { startClientApplication, getClientApplicationConfig } from 'framework/public/client';
import { createRequest, createAppLogger, createURLCompiler } from 'framework/public/universal';
import { routes } from 'application/pages/shared';
import { CompileAppURLContext, allowedURLQueryKeys } from 'application/entities/ui/navigation';
import { ApplicationConfig } from 'application/shared/config/types';
import { PopupControllerContext, PopupController } from 'application/shared/kit/popup';
import { ToastControllerContext, ToastController } from 'application/shared/kit/toast';
import { RequesterContext } from 'application/shared/lib/request';
import { getTitle } from '../common/metadata/getTitle';
import { Main } from '../common/react';
const toastController = new ToastController();
const popupController = new PopupController();
const config = getClientApplicationConfig<ApplicationConfig>();
const request = createRequest({
networkTimeout: config.networkTimeout,
});
const appLogger = createAppLogger({
networkTimeout: config.networkTimeout,
});
const compileAppURL = createURLCompiler(routes);
startClientApplication({
MainComp: (
<CompileAppURLContext.Provider value={compileAppURL}>
<RequesterContext.Provider value={request}>
<ToastControllerContext.Provider value={toastController}>
<PopupControllerContext.Provider value={popupController}>
<Main />
</PopupControllerContext.Provider>
</ToastControllerContext.Provider>
</RequesterContext.Provider>
</CompileAppURLContext.Provider>
),
appLogger,
onRecoverableErrorHandler(args) {
appLogger.sendErrorLog({
id: 'onRecoverableError',
message: (!!args && args.toString()) || 'onRecoverableError',
source: 'unknown',
});
},
router: {
compileURL: compileAppURL,
allowedURLQueryKeys,
},
getTitle,
});