summaryrefslogtreecommitdiff
path: root/frontend/src/index.ts
blob: 0faea32ca63af53ef884b621dbc7b9c23e3c68a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Sets up DFL, then loads start.ts which starts up the loader
(async () => {
  if (!window.SP_REACT) {
    console.debug('Setting up React globals...');
    // deliberate partial import
    const DFLWebpack = await import('decky-frontend-lib/dist/webpack');
    // TODO move these finds to dfl in v4
    window.SP_REACT = DFLWebpack.findModule((m) => m.Component && m.PureComponent && m.useLayoutEffect);
    window.SP_REACTDOM = DFLWebpack.findModule((m) => m.createPortal && m.createRoot);
  }
  console.debug('Setting up decky-frontend-lib...');
  window.DFL = await import('decky-frontend-lib');
  await import('./start');
})();