Skip to content

Commit 44292e0

Browse files
committed
update to 0.17
1 parent fe0bc20 commit 44292e0

File tree

5 files changed

+33
-13
lines changed

5 files changed

+33
-13
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@rerun-io/web-viewer-react": "^0.0.8-alpha.2",
13+
"@rerun-io/web-viewer-react": "0.17.0",
1414
"react": "^18.2.0",
1515
"react-dom": "^18.2.0",
1616
"react-select": "^5.8.0"
@@ -29,3 +29,4 @@
2929
"vite-plugin-wasm": "^3.2.2"
3030
}
3131
}
32+

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ const options = [
1717
export default function App() {
1818
const [selected, setSelected] = React.useState([] as string[]);
1919
return (
20-
<div>
20+
<>
2121
<Select isMulti options={options} onChange={(e) => setSelected(e.map((v) => v.value))} />
22-
<WebViewer rrd={selected} />
23-
</div>
22+
<WebViewer width="100%" height="100%" rrd={selected} hide_welcome_screen />
23+
</>
2424
);
2525
}
2626

src/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ body {
99

1010
/* Allow canvas to fill entire web page: */
1111
html,
12-
body {
12+
body,
13+
#root {
1314
overflow: hidden;
1415
margin: 0 !important;
1516
padding: 0 !important;

vite.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import react from "@vitejs/plugin-react-swc";
22
import wasm from "vite-plugin-wasm";
3+
import { searchForWorkspaceRoot } from "vite";
4+
import fs from "node:fs";
5+
import path from "node:path";
36

47
const reloadOnSave = {
58
name: "full-reload-always",
@@ -13,9 +16,22 @@ const reloadOnSave = {
1316
/** @type {import("vite").UserConfig} */
1417
const config = {
1518
plugins: [react(), wasm(), reloadOnSave],
19+
optimizeDeps: {
20+
exclude: process.env.NODE_ENV === "production" ? [] : ["@rerun-io/web-viewer"],
21+
},
1622
build: {
1723
target: "esnext",
1824
},
25+
server: {
26+
fs: {
27+
allow: [
28+
searchForWorkspaceRoot(process.cwd()),
29+
// NOTE: hack to allow `new URL("file://...")` in `web-viewer` when it is a linked package
30+
fs.realpathSync(path.join(__dirname, "node_modules", "@rerun-io/web-viewer")),
31+
fs.realpathSync(path.join(__dirname, "node_modules", "@rerun-io/web-viewer-react")),
32+
],
33+
},
34+
},
1935
};
2036

2137
if ("REPOSITORY" in process.env) {

0 commit comments

Comments
 (0)