mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 15:06:51 +00:00
af5249655c
## Description: - Inline the game worker into the main bundle (`?worker&inline`) instead of loading it from the CDN via a same-origin Blob trampoline. - Some users were failing to load the worker — most likely a cross-origin / CDN edge case the trampoline didn't paper over. Inlining serves the worker as a same-origin Blob from the main bundle, bypassing the cross-origin `new Worker(url)` restriction entirely. - Removes `createGameWorker()`, the trampoline script, the `trampoline_error` message type, and the `onTrampolineError` listener in `initialize()`. The 60s init timeout backstop stays. - `cdnBase` is still forwarded in the `init` message — that's for in-worker asset fetches (maps, etc.), unrelated to loading the worker module itself. Tradeoff: the worker bundles all of `src/core`, so the main JS download grows by that amount on every page load (including lobby/settings pages that never start a game). Accepted because load reliability > bundle size here. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan