Skip to content

Version 0.20260804.0 - #545

Merged
agarny merged 3 commits into
opencor:mainfrom
agarny:cleaning-up
Aug 3, 2026
Merged

Version 0.20260804.0#545
agarny merged 3 commits into
opencor:mainfrom
agarny:cleaning-up

Conversation

@agarny

@agarny agarny commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings August 3, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the package version and updates how the renderer resolves/loads libOpenCOR’s WebAssembly “glue” (libopencor.js), including adjusting where the build-time download is placed and removing the now-unused __LIBOPENCOR_WASM_BASE_URL__ define.

Changes:

  • Move the downloaded libopencor.js into public/libopencor/downloads/wasm/<version>/ to align with the new runtime URL strategy.
  • Rework runtime initialisation to prefer a same-origin libopencor.js when available, otherwise fall back to fetching/patching from https://opencor.ws.
  • Remove __LIBOPENCOR_WASM_BASE_URL__ from Vite/Electron defines and TypeScript shims.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/renderer/vite.lib.config.ts Downloads libopencor.js into the new libopencor/downloads/wasm/... public path and removes the base-URL define.
src/renderer/vite.config.ts Same as above for the app build config.
src/renderer/src/types/shims.d.ts Removes the shim for __LIBOPENCOR_WASM_BASE_URL__ since it’s no longer defined/used.
src/renderer/src/common/initialisation.ts Updates libOpenCOR loading to try same-origin first, then fallback to opencor.ws with worker URL patching.
src/renderer/package.json Bumps renderer package version to 0.20260804.0.
package.json Bumps root package version to 0.20260804.0.
electron.vite.config.ts Removes the base-URL define from the Electron renderer build defines.
Suppressed comments (1)

src/renderer/src/common/initialisation.ts:159

  • libOpenCORWorkerUrl is created unconditionally, but if the worker URL pattern is not found you fall back to importing directly from https://opencor.ws and the blob URL is never used/revoked. This leaks an object URL each time initialisation runs in that fallback path.
      } else {
        // The glue doesn't contain the expected worker-script URL, which means a future version of libOpenCOR generates
        // different code. So, import it directly from https://opencor.ws, which works in standard browsers (the worker
        // will then be cross-origin, which is allowed with CORS), but may not in restricted ones.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/src/common/initialisation.ts
Comment thread src/renderer/src/common/initialisation.ts Outdated
Comment thread src/renderer/src/common/initialisation.ts Outdated
agarny added 2 commits August 3, 2026 17:07
Refactored the initialisation of the Web app to load and instantiate libOpenCOR through a shared helper, then prefer same-origin glue URLs before falling back to opencor.ws.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/renderer/src/common/initialisation.ts:179

  • If importAndInstantiateLibOpenCOR(patchedLibOpenCORUrl) throws, libOpenCORWorkerUrl is currently never revoked. Since the worker blob URL is only needed when the patched glue successfully loads, this can leak a blob URL (and its backing source) on the failure path. Consider revoking libOpenCORWorkerUrl in a catch before rethrowing, while still keeping it alive on success for libOpenCOR's lazy worker spawning.
        try {
          await importAndInstantiateLibOpenCOR(patchedLibOpenCORUrl);
        } finally {
          // The patched glue has now been imported, so its blob URL is no longer needed and can be revoked.
          // Note: libOpenCORWorkerUrl, on the other hand, must remain valid since libOpenCOR spawns its module worker

@agarny
agarny merged commit 342a30c into opencor:main Aug 3, 2026
9 checks passed
@agarny
agarny deleted the cleaning-up branch August 3, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants