Skip to content

Commit 25ea46a

Browse files
authored
Revert "Add IS_DEV and Hot Reloading to debug. (RooCodeInc#1895)" (RooCodeInc#1917)
This reverts commit b0446f7.
1 parent b0446f7 commit 25ea46a

File tree

6 files changed

+2
-43
lines changed

6 files changed

+2
-43
lines changed

.changeset/yellow-paws-chew.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
"request": "launch",
1212
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
1313
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
14-
"preLaunchTask": "${defaultBuildTask}",
15-
"env": {
16-
"IS_DEV": "true",
17-
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}"
18-
}
14+
"preLaunchTask": "${defaultBuildTask}"
1915
}
2016
]
2117
}

.vscode/tasks.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
"presentation": {
2525
"group": "watch",
2626
"reveal": "never"
27-
},
28-
"options": {
29-
"env": {
30-
"IS_DEV": "true"
31-
}
3227
}
3328
},
3429
{

src/extension.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Logger } from "./services/logging/Logger"
77
import { createClineAPI } from "./exports"
88
import "./utils/path" // necessary to have access to String.prototype.toPosix
99
import { DIFF_VIEW_URI_SCHEME } from "./integrations/editor/DiffViewProvider"
10-
import assert from "node:assert"
1110

1211
/*
1312
Built using https://github.com/microsoft/vscode-webview-ui-toolkit
@@ -191,19 +190,3 @@ export function activate(context: vscode.ExtensionContext) {
191190
export function deactivate() {
192191
Logger.log("Cline extension deactivated")
193192
}
194-
195-
// TODO: remove this in production
196-
// This is a workaround to reload the extension when the source code changes
197-
// since vscode doesn't support hot reload for extensions
198-
const { IS_DEV, DEV_WORKSPACE_FOLDER } = process.env
199-
200-
if (IS_DEV) {
201-
assert(DEV_WORKSPACE_FOLDER, "DEV_WORKSPACE_FOLDER must be set in development")
202-
const watcher = vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(DEV_WORKSPACE_FOLDER, "src/**/*"))
203-
204-
watcher.onDidChange(({ scheme, path }) => {
205-
console.info(`${scheme} ${path} changed. Reloading VSCode...`)
206-
207-
vscode.commands.executeCommand("workbench.action.reloadWindow")
208-
})
209-
}

webview-ui/scripts/build-react-no-split.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
const rewire = require("rewire")
1313
const defaults = rewire("react-scripts/scripts/build.js")
1414
const config = defaults.__get__("config")
15-
const webpack = require("webpack")
1615

1716
/* Modifying Webpack Configuration for 'shared' dir
1817
This section uses Rewire to modify Create React App's webpack configuration without ejecting. Rewire allows us to inject and alter the internal build scripts of CRA at runtime. This allows us to maintain a flexible project structure that keeps shared code outside the webview-ui/src directory, while still adhering to CRA's security model that typically restricts imports to within src/.
@@ -120,15 +119,6 @@ config.output = {
120119
filename: "static/js/[name].js",
121120
}
122121

123-
// Adjust build environment variables for dev/debug builds.
124-
config.plugins[4] = new webpack.DefinePlugin({
125-
"process.env": {
126-
...config.plugins[4].definitions["process.env"],
127-
NODE_ENV: JSON.stringify(process.env.IS_DEV ? "development" : "production"),
128-
IS_DEV: JSON.stringify(process.env.IS_DEV),
129-
},
130-
})
131-
132122
// Rename main.{hash}.css to main.css
133123
config.plugins[5].options.filename = "static/css/[name].css"
134124
config.plugins[5].options.moduleFilename = () => "static/css/main.css"

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { validateApiConfiguration, validateModelId } from "../../utils/validate"
55
import { vscode } from "../../utils/vscode"
66
import ApiOptions from "./ApiOptions"
77
import SettingsButton from "../common/SettingsButton"
8-
const { IS_DEV } = process.env
8+
const IS_DEV = false // FIXME: use flags when packaging
99

1010
type SettingsViewProps = {
1111
onDone: () => void

0 commit comments

Comments
 (0)