Editor singleton to prevent re-renders (#2163)
* move editor data into a singleton Signed-off-by: Jess Frazelle <github@jessfraz.com> * debounce on update Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make select on extrude work Signed-off-by: Jess Frazelle <github@jessfraz.com> * highlight range Signed-off-by: Jess Frazelle <github@jessfraz.com> * highlight range Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix errors Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * almost forgot the error pane Signed-off-by: Jess Frazelle <github@jessfraz.com> * loint Signed-off-by: Jess Frazelle <github@jessfraz.com> * call out to codemirror Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tauri; Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * more efficient Signed-off-by: Jess Frazelle <github@jessfraz.com> * create the modals in the hook Signed-off-by: Jess Frazelle <github@jessfraz.com> * Revert "create the modals in the hook" This reverts commit bbeba85030763cf7235a09fa24247dbf120f2a64. * change todo Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
		@ -1,15 +1,9 @@
 | 
			
		||||
import react from '@vitejs/plugin-react'
 | 
			
		||||
import viteTsconfigPaths from 'vite-tsconfig-paths'
 | 
			
		||||
import eslint from 'vite-plugin-eslint'
 | 
			
		||||
import dns from 'dns'
 | 
			
		||||
import { defineConfig, configDefaults } from 'vitest/config'
 | 
			
		||||
import version from 'vite-plugin-package-version'
 | 
			
		||||
 | 
			
		||||
// Only needed because we run Node < 17
 | 
			
		||||
// and we want to open `localhost` not `127.0.0.1` on server start
 | 
			
		||||
// reference: https://vitejs.dev/config/server-options.html#server-host
 | 
			
		||||
dns.setDefaultResultOrder('verbatim')
 | 
			
		||||
 | 
			
		||||
const config = defineConfig({
 | 
			
		||||
  server: {
 | 
			
		||||
    open: true,
 | 
			
		||||
@ -25,32 +19,38 @@ const config = defineConfig({
 | 
			
		||||
      forks: {
 | 
			
		||||
        maxForks: 2,
 | 
			
		||||
        minForks: 1,
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    setupFiles: 'src/setupTests.ts',
 | 
			
		||||
    setupFiles: ['src/setupTests.ts', '@vitest/web-worker'],
 | 
			
		||||
    environment: 'happy-dom',
 | 
			
		||||
    coverage: {
 | 
			
		||||
      provider: 'istanbul' // or 'v8'
 | 
			
		||||
      provider: 'istanbul', // or 'v8'
 | 
			
		||||
    },
 | 
			
		||||
    exclude: [...configDefaults.exclude, '**/e2e/playwright/**/*'],
 | 
			
		||||
    deps: {
 | 
			
		||||
      inline: ['vitest-canvas-mock']
 | 
			
		||||
    }
 | 
			
		||||
      optimizer: {
 | 
			
		||||
        web: {
 | 
			
		||||
          include: ['vitest-canvas-mock'],
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    clearMocks: true,
 | 
			
		||||
    restoreMocks: true,
 | 
			
		||||
    mockReset: true,
 | 
			
		||||
    reporters: process.env.GITHUB_ACTIONS
 | 
			
		||||
      ? ['dot', 'github-actions']
 | 
			
		||||
      : ['verbose', 'hanging-process'],
 | 
			
		||||
    testTimeout: 1000,
 | 
			
		||||
    hookTimeout: 1000,
 | 
			
		||||
    teardownTimeout: 1000,
 | 
			
		||||
  },
 | 
			
		||||
  build: {
 | 
			
		||||
    outDir: 'build',
 | 
			
		||||
  },
 | 
			
		||||
  plugins: [
 | 
			
		||||
    react(),
 | 
			
		||||
    viteTsconfigPaths(),
 | 
			
		||||
    eslint(),
 | 
			
		||||
    version(),
 | 
			
		||||
  ],
 | 
			
		||||
  plugins: [react(), viteTsconfigPaths(), eslint(), version()],
 | 
			
		||||
  worker: {
 | 
			
		||||
    plugins: () =>  [
 | 
			
		||||
      viteTsconfigPaths(),
 | 
			
		||||
    ],
 | 
			
		||||
  }
 | 
			
		||||
    plugins: () => [viteTsconfigPaths()],
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
export default config
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user