Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow declaring path of every file for WasmSDKLoadSettings #80

Open
icopp opened this issue Jul 26, 2022 · 1 comment

Comments

@icopp
Copy link

icopp commented Jul 26, 2022

Currently you can set engineLocation and workerLocation, but this still basically requires dumping all the contents of resources into a static path.

If it was possible to set an individual path for each required file, it would be possible to include the entire thing in an appropriately build process, such as with Webpack's resource loaders or Next.js's use of URL and import.meta.url for importing resource files.

@vjekoart
Copy link
Contributor

vjekoart commented Aug 1, 2022

Hi @icopp,

Thanks for the feedback.

Regarding your use case, we already have an individual path for the workerLocation property. Does that suit your needs? For example, you can use workerLocation property in the following manner: loadSettings.workerLocation = "/my-path/BlinkIDWasmSDK.worker.min.js".

If not, could you provide an example of how you'd like to set properties for workerLocation and engineLocation properties?

Furthermore, exposing all necessary files in resources/ folder is not straightforward with the current implementation. Right now, a worker script will load a JS script from the resources/ folder, which will in turn load WebAssembly module. That means that tool like Webpack may be able to include JS script from the resources/ folder in the final bundle, but it won't have any knowledge about the WebAssembly module and related .data file.

Also, we dynamically choose which WebAssembly bundle from the resources/ folder should be used based on the browser features. For example, in older web browsers subfolder resources/basic/ will be used, while in most modern web browsers folder resources/advanced/ will be used.

Sincerely,
Vjekoslav

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

No branches or pull requests

2 participants