Skip to content

Improve Electron Compatibility #2151

@Danielku15

Description

@Danielku15

#1933

This item is about improving the usage in Electron environments.


Problem 1: It seems the renderer process of Electron has some Node-like globals defined which make alphaTab think it is running in a Node.js environment.

Solution 1: Improve the detection that we really identify the browser.


Problem 2: To spawn workers or worklets the respective files of alphaTab have to be available via a URL that can be loaded through standard browser APIs. For Electron in general it is easy, you can place any output files of your compiled app and it will be available. For Obsidian Plugins it might be more tricky.

Solution 2: One improvement is certainly to allow full customization of the worker/worklet URLs used for spawning workers. We used to have the scriptFile configuration but looking at the state today, we might need other mechanisms to specify the URL and worker type. Before building something we should find out how Obsidian/Electron can handle dynamic script loading.

Some points on this topic:

  • We might add a custom lookup dictionary like we did for the SMuFL fonts to specify URLs for worker and worklet. This brings also other benefits where people might want to inject additional custom code.
  • We might need to expose alphaTab.core from the package.json so people can use it directly and make their own alphaTab.main
  • We could also add a callback option where users implement their own logic to spawn workers. This way bundlers could pick up any special syntax constructs needed during bundling-packing (e.g. inline workers).

Metadata

Metadata

Assignees

Labels

area-coreRelated to some core parts of alphaTabplatform-javascriptRelated to the JavaScript version of alphaTabstate-acceptedThis is a valid topic to work on.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions