Skip to content

Commit

Permalink
update to 0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed Jul 15, 2024
1 parent fe0bc20 commit 44292e0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
18 changes: 10 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@rerun-io/web-viewer-react": "^0.0.8-alpha.2",
"@rerun-io/web-viewer-react": "0.17.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-select": "^5.8.0"
Expand All @@ -29,3 +29,4 @@
"vite-plugin-wasm": "^3.2.2"
}
}

6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const options = [
export default function App() {
const [selected, setSelected] = React.useState([] as string[]);
return (
<div>
<>
<Select isMulti options={options} onChange={(e) => setSelected(e.map((v) => v.value))} />
<WebViewer rrd={selected} />
</div>
<WebViewer width="100%" height="100%" rrd={selected} hide_welcome_screen />
</>
);
}

3 changes: 2 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ body {

/* Allow canvas to fill entire web page: */
html,
body {
body,
#root {
overflow: hidden;
margin: 0 !important;
padding: 0 !important;
Expand Down
16 changes: 16 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import react from "@vitejs/plugin-react-swc";
import wasm from "vite-plugin-wasm";
import { searchForWorkspaceRoot } from "vite";
import fs from "node:fs";
import path from "node:path";

const reloadOnSave = {
name: "full-reload-always",
Expand All @@ -13,9 +16,22 @@ const reloadOnSave = {
/** @type {import("vite").UserConfig} */
const config = {
plugins: [react(), wasm(), reloadOnSave],
optimizeDeps: {
exclude: process.env.NODE_ENV === "production" ? [] : ["@rerun-io/web-viewer"],
},
build: {
target: "esnext",
},
server: {
fs: {
allow: [
searchForWorkspaceRoot(process.cwd()),
// NOTE: hack to allow `new URL("file://...")` in `web-viewer` when it is a linked package
fs.realpathSync(path.join(__dirname, "node_modules", "@rerun-io/web-viewer")),
fs.realpathSync(path.join(__dirname, "node_modules", "@rerun-io/web-viewer-react")),
],
},
},
};

if ("REPOSITORY" in process.env) {
Expand Down

0 comments on commit 44292e0

Please sign in to comment.