From f415eb3f9be70403038f26c631bdee8e63921559 Mon Sep 17 00:00:00 2001 From: softmarshmallow Date: Mon, 3 Jan 2022 16:53:37 +0900 Subject: [PATCH] disabled component feature & debug panel for release --- .../editor-appbar-fragment-for-code-editor.tsx | 4 +++- editor/core/states/workspace-initial-state.ts | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/editor/components/editor/editor-appbar/editor-appbar-fragment-for-code-editor.tsx b/editor/components/editor/editor-appbar/editor-appbar-fragment-for-code-editor.tsx index fd94d94e..c11f393a 100644 --- a/editor/components/editor/editor-appbar/editor-appbar-fragment-for-code-editor.tsx +++ b/editor/components/editor/editor-appbar/editor-appbar-fragment-for-code-editor.tsx @@ -11,7 +11,9 @@ export function AppbarFragmentForCodeEditor() { return ( - + {/* disable temporarily */} +
+ {/* */} {hasNotification && ( {}}> diff --git a/editor/core/states/workspace-initial-state.ts b/editor/core/states/workspace-initial-state.ts index b65a3304..4e2b652a 100644 --- a/editor/core/states/workspace-initial-state.ts +++ b/editor/core/states/workspace-initial-state.ts @@ -6,15 +6,27 @@ import { } from "./history-initial-state"; import { react_presets, vanilla_presets } from "@grida/builder-config-preset"; +const _IS_DEV = process.env.NODE_ENV === "development"; + +/** + * you can enable this by default on your .env.local file + * + * ```.env.local + * NEXT_PUBLIC_ENABLE_PREVIEW_FEATURE_COMPONENTS_SUPPORT=true + * ``` + */ +const _ENABLE_PREVIEW_FEATURE_COMPONENTS_SUPPORT = + process.env.NEXT_PUBLIC_ENABLE_PREVIEW_FEATURE_COMPONENTS_SUPPORT === "true"; + export function createInitialWorkspaceState( editor: EditorSnapshot ): WorkspaceState { return { history: createInitialHistoryState(editor), preferences: { - // TODO: temporarily always true for components dev - debug_mode: true, - enable_preview_feature_components_support: true, + debug_mode: _IS_DEV, + enable_preview_feature_components_support: + _ENABLE_PREVIEW_FEATURE_COMPONENTS_SUPPORT, preview_runner_framework_config: vanilla_presets.vanilla_default, framework_config: react_presets.react_default, },