Files
supabase/apps/studio/tsconfig.json
T
Beng EuandAlaister Young 744c61c1d7 Speed up Studio development via SWC and keeping built pages in memory for longer (#19192)
* fix: enable `useDefineForClassFields` in Studio `tsconfig.json`

Per https://mobx.js.org/installation.html#use-spec-compliant-transpilation-for-class-properties. Needed to switch to SWC.

* fix: remove Studio `.babelrc` to enable SWC

This was tried previously and reverted. I believe that it should work now with `useDefineForClassField` enabled in the previous commit, support for which was added to Next.js in https://github.com/vercel/next.js/pull/36335.

* fix: set Studio `onDemandEntries` options `maxInactiveAge` to 1 day, `pagesBufferLength` to 100

This will keep up to 100 built pages in memory for 1 day, speeding up development. You'd expect that this speed up would come at the cost of memory usage, but in my unscientific testing involving clicking around every page I could get to, with SWC compilation, memory usage maxed out at ~3.3 GB with these options enabled, and no compilation was needed for any revisited pages, whereas without these options, memory usage maxed out at ~4 GB(?!), and revisited pages were compiled once they were out of the buffer. Perhaps the recompilation actually worsens memory usage.

* fix prettier

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2023-11-24 11:34:44 +01:00

27 lines
715 B
JSON

{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"downlevelIteration": true,
"incremental": true,
"paths": {
"@ui/*": ["./../../packages/ui/src/*"] // handle ui package paths
},
"useDefineForClassFields": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
"exclude": ["node_modules"]
}