From 72b1e2f1e465e4772c25302669b100327dbdeec4 Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Fri, 27 Sep 2024 01:56:40 +0800 Subject: [PATCH 1/2] fix --- js/repl/PluginConfig.ts | 4 +-- js/repl/ReplOptions.tsx | 67 ++++++++++++++++++++++------------------- js/repl/compile.ts | 41 ++++++++++++++----------- js/repl/types.ts | 2 +- 4 files changed, 62 insertions(+), 52 deletions(-) diff --git a/js/repl/PluginConfig.ts b/js/repl/PluginConfig.ts index 940951d048..c18a56c10e 100644 --- a/js/repl/PluginConfig.ts +++ b/js/repl/PluginConfig.ts @@ -66,7 +66,7 @@ const envPresetDefaults = { default: "3.21", }, modules: { - default: false, + default: "false", }, } as const; @@ -109,7 +109,7 @@ const replDefaults: ReplState = { compiledSize: 0, rawSize: 0, }, - modules: false, + modules: "false", presets: "react,stage-2,env", prettier: false, showSidebar: true, diff --git a/js/repl/ReplOptions.tsx b/js/repl/ReplOptions.tsx index faacc0db5a..5c47c19f6d 100644 --- a/js/repl/ReplOptions.tsx +++ b/js/repl/ReplOptions.tsx @@ -531,7 +531,6 @@ class ExpandedContainer extends Component { /> Enabled - - - + {(!babelVersion || + compareVersions(babelVersion, "8.0.0") === -1) && ( + + )} + {(!babelVersion || + compareVersions(babelVersion, "8.0.0") === -1) && ( + + )} {isBugfixesSupported && (