Skip to content

Commit 02c6e2f

Browse files
committed
chore: pass through config
1 parent 367a461 commit 02c6e2f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

packages/@triplex/client/src/templates.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const scripts = {
9898
9999
async function initialize() {
100100
window.triplex = JSON.parse(\`${JSON.stringify({
101+
config: template.config,
101102
env: { mode: "default", state: "edit" },
102103
preload: template.preload,
103104
})}\`);
@@ -241,6 +242,7 @@ export const scripts = {
241242
242243
async function initialize() {
243244
window.triplex = JSON.parse(\`${JSON.stringify({
245+
config: template.config,
244246
env: { mode: "webxr", state: "edit" },
245247
preload: template.preload,
246248
})}\`);

packages/bridge/renderer.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
*/
77
declare interface Window {
88
readonly triplex: {
9+
readonly config: import("../@triplex/server").ReconciledTriplexConfig;
910
readonly env: {
1011
readonly mode: "webxr" | "default";
1112
state: "edit" | "pause" | "play";
1213
};
1314
readonly preload: {
1415
readonly reactThreeFiber: boolean;
1516
};
16-
readonly webgpu: boolean;
1717
};
1818
}

packages/renderer/src/features/canvas/canvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function Canvas({ children, ...props }: CanvasProps) {
5454

5555
return (
5656
<FiberCanvas
57-
renderer={window.triplex.webgpu ? "webgpu" : undefined}
57+
renderer={window.triplex.config.webgpu ? "webgpu" : undefined}
5858
shadows="percentage"
5959
{...props}
6060
raycaster={{

0 commit comments

Comments
 (0)