Skip to content

Commit 3240ae7

Browse files
agviegasclaude
andcommitted
feat(bim-beta): import fragments-beta/inline so the worker runs in the sandbox
The platform serves apps as IIFE bundles inside a sandboxed iframe, where the fragments worker can't resolve via import.meta.url or cross-origin fetch. The bim-beta scaffold now imports "@thatopen-platform/fragments-beta/inline" to register the inlined worker. Bumps @thatopen/services to 0.0.4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 807ceba commit 3240ae7

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"access": "public"
1616
},
1717
"private": false,
18-
"version": "0.0.3",
18+
"version": "0.0.4",
1919
"main": "dist/index.cjs.js",
2020
"module": "dist/index.es.js",
2121
"types": "dist/index.d.ts",

src/cli/templates/bim-beta/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import * as THREE from "three";
22
import * as OBC from "@thatopen-platform/components-beta";
33
import * as OBF from "@thatopen-platform/components-front-beta";
44
import * as FRAGS from "@thatopen-platform/fragments-beta";
5+
// Inlines the fragments worker so it runs inside the platform's sandboxed iframe
6+
// (IIFE bundle: no import.meta, no cross-origin fetch). Opt-in — only apps that
7+
// import this pay the worker's size.
8+
import "@thatopen-platform/fragments-beta/inline";
59
import * as BUI from "@thatopen/ui";
610
import * as MARKERJS from "@markerjs/markerjs3"
711
import {

0 commit comments

Comments
 (0)