From 31e589e362ac690896b961be38f783219a3b68b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grabarz?= Date: Mon, 12 Aug 2024 18:52:44 +0200 Subject: [PATCH] Do not default to development ydoc server in prod build. (#10786) Fixes https://github.com/enso-org/enso/issues/10784 --- app/gui2/package.json | 2 +- app/gui2/src/composables/animation.ts | 1 - app/gui2/vite.config.ts | 4 +++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/gui2/package.json b/app/gui2/package.json index 8da94f8ad2a..6e4786cd5a0 100644 --- a/app/gui2/package.json +++ b/app/gui2/package.json @@ -8,7 +8,7 @@ "email": "contact@enso.org" }, "scripts": { - "dev": "echo DEPRECATED! Use `pnpm dev:gui` in workspace root directory.", + "dev": "echo DEPRECATED! Use `pnpm -w dev:gui` instead.", "dev:vite": "vite", "build": "corepack pnpm -r --filter enso-dashboard run compile && corepack pnpm run build:vite", "build-cloud": "cross-env CLOUD_BUILD=true corepack pnpm run build", diff --git a/app/gui2/src/composables/animation.ts b/app/gui2/src/composables/animation.ts index 8d00c0b85cc..e89c6429d15 100644 --- a/app/gui2/src/composables/animation.ts +++ b/app/gui2/src/composables/animation.ts @@ -63,7 +63,6 @@ export function useRaf( }, { immediate: true }, ) - console.log('onScopeDispose(unmountRaf)?') onScopeDispose(unmountRaf) } diff --git a/app/gui2/vite.config.ts b/app/gui2/vite.config.ts index 42bdc33a91c..81d65dc0d52 100644 --- a/app/gui2/vite.config.ts +++ b/app/gui2/vite.config.ts @@ -15,7 +15,9 @@ const projectManagerUrl = process.env.E2E === 'true' ? 'ws://127.0.0.1:30536' : 'ws://127.0.0.1:30535' const IS_CLOUD_BUILD = process.env.CLOUD_BUILD === 'true' -const YDOC_SERVER_URL = process.env.ENSO_POLYGLOT_YDOC_SERVER ?? 'ws://localhost:5976' +const YDOC_SERVER_URL = + process.env.ENSO_POLYGLOT_YDOC_SERVER ?? + (process.env.NODE_ENV === 'development' ? 'ws://localhost:5976' : undefined) await readEnvironmentFromFile()