Skip to content

Commit b67454f

Browse files
committed
delete unused code
1 parent 6039f6a commit b67454f

File tree

50 files changed

+140
-3952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+140
-3952
lines changed

engine/baml-schema-wasm/web/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
"clean": "git clean -xdf ./dist .turbo node_modules",
88
"comment": "don't use 'wasm pack --dev' below or it will be too big of a bundle and playground will be slow to load.",
99
"build": "pnpm run release",
10-
"release": "pnpm run pack",
11-
"release-old": "pnpm run pack --release",
12-
"pack": "wasm-pack build ../ --dev --target bundler --out-dir ./web/dist"
10+
"release": "pnpm run pack --dev",
11+
"pack": "wasm-pack build ../ --target bundler --out-dir ./web/dist"
1312
},
1413
"exports": {
1514
".": {
@@ -27,6 +26,5 @@
2726
"directory": "baml-schema-wasm"
2827
},
2928
"author": "BAML",
30-
3129
"license": "Apache-2.0"
32-
}
30+
}

engine/playground-server/src/bin/playground_barebones.rs

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use tracing_subscriber::EnvFilter;
99
use walkdir::WalkDir;
1010

1111
// const PROJECT_DIR: &'static str = "/Users/sam/baml4/c2/baml_src";
12-
const PROJECT_DIR: &'static str = "/Users/sam/baml4/engine/playground-server/tests/repro1";
12+
// const PROJECT_DIR: &'static str = "/Users/sam/baml/engine/playground-server/tests/codelens-bugs";
13+
const PROJECT_DIR: &'static str = "/Users/sam/baml/integ-tests/baml_src";
1314

1415
#[derive(Debug)]
1516
pub struct Playground2Server {
@@ -179,24 +180,26 @@ pub async fn run_server() -> anyhow::Result<()> {
179180
let Ok(Some(_line)) = lines.next_line().await else {
180181
break;
181182
};
182-
// let playground_message =
183-
// LangServerToWasmMessage::PlaygroundMessage(FrontendMessage::run_test {
184-
// function_name: "ExtractResume".to_string(),
185-
// test_name: "vaibhav_resume".to_string(),
186-
// });
187-
// tracing::info!("Sending playground message: {:?}", playground_message);
188-
// let _ = broadcast_tx.send(playground_message);
189-
tracing::info!("Sending samtest_update_project {}", chrono::Local::now());
190-
if let Err(e) = broadcast_tx.send(LangServerToWasmMessage::PlaygroundMessage(
191-
FrontendMessage::samtest_update_project {
192-
root_path: PROJECT_DIR.to_string(),
193-
files: vec![("test.baml".to_string(), "// comment\n".to_string())]
194-
.into_iter()
195-
.collect(),
196-
},
197-
)) {
183+
let playground_message =
184+
LangServerToWasmMessage::PlaygroundMessage(FrontendMessage::run_test {
185+
function_name: "TestFnNamedArgsSingleClass".to_string(),
186+
test_name: "TestFnNamedArgsSingleClass".to_string(),
187+
});
188+
tracing::info!("Sending playground message: {:?}", playground_message);
189+
let _ = broadcast_tx.send(playground_message).inspect_err(|e| {
198190
tracing::error!("Error sending playground message: {:?}", e);
199-
};
191+
});
192+
// tracing::info!("Sending samtest_update_project {}", chrono::Local::now());
193+
// if let Err(e) = broadcast_tx.send(LangServerToWasmMessage::PlaygroundMessage(
194+
// FrontendMessage::samtest_update_project {
195+
// root_path: PROJECT_DIR.to_string(),
196+
// files: vec![("test.baml".to_string(), "// comment\n".to_string())]
197+
// .into_iter()
198+
// .collect(),
199+
// },
200+
// )) {
201+
// tracing::error!("Error sending playground message: {:?}", e);
202+
// };
200203
}
201204

202205
Ok::<(), anyhow::Error>(())

integ-tests/go/baml_client/baml_source_map.go

Lines changed: 64 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/python-v1/baml_client/inlinedbaml.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/python/baml_client/inlinedbaml.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/react/baml_client/inlinedbaml.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/typescript-esm/baml_client/inlinedbaml.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/typescript/baml_client/inlinedbaml.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetbrains/src/main/kotlin/com/boundaryml/jetbrains_ext/BamlToolWindowFactory.kt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,32 @@ private const val PLACEHOLDER_HTML = """
5353
</html>
5454
"""
5555

56+
private const val VITE_HOT_RELOAD_HTML = """
57+
<!DOCTYPE html>
58+
<html lang="en">
59+
60+
<head>
61+
<meta charset="UTF-8" />
62+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
63+
<title>BAML Playground</title>
64+
<script type="module">
65+
import RefreshRuntime from "http://localhost:3030/@react-refresh"
66+
RefreshRuntime.injectIntoGlobalHook(window)
67+
${"window.\$RefreshReg\$ = () => {}"}
68+
${"window.\$RefreshSig\$ = () => (type) => type"}
69+
window.__vite_plugin_react_preamble_installed__ = true
70+
</script>
71+
<script type="module" crossorigin src="http://localhost:3030/src/main.tsx"></script>
72+
<link rel="stylesheet" crossorigin href="http://localhost:3030/src/main.tsx">
73+
</head>
74+
75+
<body>
76+
<div id="root"></div>
77+
</body>
78+
79+
</html>
80+
"""
81+
5682
class BamlToolWindowFactory : ToolWindowFactory {
5783

5884
init {
@@ -83,6 +109,14 @@ class BamlToolWindowFactory : ToolWindowFactory {
83109
}
84110
}
85111

112+
// vite hot reload
113+
val viteButton = JButton("viteButton").apply {
114+
addActionListener {
115+
browser.loadHTML(VITE_HOT_RELOAD_HTML.trimIndent())
116+
}
117+
}
118+
119+
86120
// Create lorem ipsum button
87121
val loremButton = JButton("Lorem Ipsum").apply {
88122
addActionListener {
@@ -109,6 +143,7 @@ class BamlToolWindowFactory : ToolWindowFactory {
109143
}
110144

111145
controlPanel.add(reloadButton)
146+
controlPanel.add(viteButton)
112147
controlPanel.add(loremButton)
113148
controlPanel.add(openDevToolsButton)
114149
}

typescript/packages/playground-common/src/baml_wasm_web/EventListener.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const EventListener: React.FC = () => {
120120
const isVSCodeWebview = vscode.isVscode()
121121

122122
const [selectedFunc, setSelectedFunction] = useAtom(selectedFunctionAtom)
123-
const setSelectedTestcase = useSetAtom(selectedTestcaseAtom)
123+
const [selectedTestcase, setSelectedTestcase] = useAtom(selectedTestcaseAtom)
124124
const setBamlConfig = useSetAtom(bamlConfig)
125125
const [bamlCliVersion, setBamlCliVersion] = useAtom(bamlCliVersionAtom)
126126
const { runTests: runBamlTests } = useRunBamlTests()
@@ -327,9 +327,12 @@ export const EventListener: React.FC = () => {
327327
console.debug('run_test', content);
328328
setSelectedFunction(content.function_name);
329329
setSelectedTestcase(content.test_name);
330-
runBamlTests([
331-
{ functionName: content.function_name, testName: content.test_name },
332-
]);
330+
331+
setTimeout(() => {
332+
runBamlTests([
333+
{ functionName: content.function_name, testName: content.test_name },
334+
]);
335+
}, 1000);
333336
// run([content.test_name])
334337
// setShowTests(true)
335338
// setClientGraph(false)
@@ -341,7 +344,7 @@ export const EventListener: React.FC = () => {
341344

342345
return () => window.removeEventListener('message', fn);
343346
// If we dont add the jotai atom callbacks here like setRunningTests, this will call an old version of the atom (e.g. runTests which may have undefined dependencies).
344-
}, [selectedFunc, runBamlTests, updateCursor, setSelectedTestcase]);
347+
}, [selectedFunc, runBamlTests, updateCursor, setSelectedFunction, setSelectedTestcase]);
345348

346349
return (
347350
<>

0 commit comments

Comments
 (0)