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

Consider consolidating client to a single minified file with embedded worker code #56

Open
untoldone opened this issue Jan 22, 2022 · 0 comments

Comments

@untoldone
Copy link

It might assist developer usability to embed worker code into a single minified file instead of requiring multiple files as per the current documentation. This could be done using URL.createObjectURL and Blob apis. For example:

var downloadWorkerUrl = URL.createObjectURL(
  new Blob([
    '<DOWNLOAD WORKER CODE HERE>'
  ], {type: 'text/javascript'})
);

// which can then be passed to a worker
var worker = new Worker(downloadWorkerUrl)

A scenario where this would be useful is if someone is trying to embed the client in a web-based environment (such as a third party survey tool) where they don't have the ability to upload other static assets to be fetched by the ndt-7 client code. It would also simplify usage in other contexts so that only a single file is needed.

This said, I don't know the client's current browser targets/ these APIs have support for the following:

https://caniuse.com/?search=createobjecturl
https://caniuse.com/?search=blob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant