From 5175e5e73cf02f2f0368431c28e98ff171e35b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Gonz=C3=A1lez=20Viegas?= Date: Sun, 7 Jun 2026 18:44:28 +0200 Subject: [PATCH] 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 --- package.json | 2 +- src/cli/templates/bim-beta/src/main.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ffa1467..673ce24 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "access": "public" }, "private": false, - "version": "0.0.3", + "version": "0.0.4", "main": "dist/index.cjs.js", "module": "dist/index.es.js", "types": "dist/index.d.ts", diff --git a/src/cli/templates/bim-beta/src/main.ts b/src/cli/templates/bim-beta/src/main.ts index eade424..bcd5bfe 100644 --- a/src/cli/templates/bim-beta/src/main.ts +++ b/src/cli/templates/bim-beta/src/main.ts @@ -2,6 +2,10 @@ import * as THREE from "three"; import * as OBC from "@thatopen-platform/components-beta"; import * as OBF from "@thatopen-platform/components-front-beta"; import * as FRAGS from "@thatopen-platform/fragments-beta"; +// Inlines the fragments worker so it runs inside the platform's sandboxed iframe +// (IIFE bundle: no import.meta, no cross-origin fetch). Opt-in — only apps that +// import this pay the worker's size. +import "@thatopen-platform/fragments-beta/inline"; import * as BUI from "@thatopen/ui"; import * as MARKERJS from "@markerjs/markerjs3" import {