Skip to content

Commit 960f9e6

Browse files
committed
[Replay Visualizer] Fix ConnectX build
1 parent bbf2189 commit 960f9e6

File tree

1 file changed

+13
-7
lines changed
  • kaggle_environments/envs/connectx/visualizer/default/src

1 file changed

+13
-7
lines changed
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
import { Player, PreactAdapter } from "@kaggle-environments/core";
2-
import { Renderer } from "./renderer";
3-
import "./style.css";
1+
import { createReplayVisualizer, PreactAdapter } from '@kaggle-environments/core';
2+
import { Renderer } from './renderer';
3+
import './style.css';
44

5-
const app = document.getElementById("app");
5+
const app = document.getElementById('app');
66
if (!app) {
7-
throw new Error("Could not find app element");
7+
throw new Error('Could not find app element');
88
}
99

10-
// TODO - fix this when we figure out a global format
10+
// TODO - fix this any when we figure out a global format
1111
const adapter = new PreactAdapter(Renderer as any);
12-
new Player(app, adapter);
12+
if (app) {
13+
// Set up an HMR boundary for development
14+
if (import.meta?.env?.DEV && import.meta?.hot) {
15+
import.meta.hot.accept();
16+
}
17+
createReplayVisualizer(app, adapter);
18+
}

0 commit comments

Comments
 (0)