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

Upgrade H5Web and fix error display when file size limit is reached #40

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Apr 19, 2024

Upgrading H5Web to v11.2.0 and fixing an issue with the file-size limit error not appearing (it was thrown outside of the error boundary).

Unfortunately, I don't think I can switch to H5WasmLocalFileProvider to remove the file size limit altogether. When I open an HDF5 file in VS Code, I get a CustomDocument with a URI. I can convert this URI into one that the webview can fetch, but I can't pass a reference to the underlying file on the file system.

In the webview, H5WasmLocalFileProvider needs a File object from an HTML file input. I can probably fake it by creating a File object from a Blob with new File([blob], 'name'), but to create that Blob I need an ArrayBuffer, so I still end up having to fetch the file even though it's local.

Shame... Maybe it will work once I implement a provider that can do range requests.

@axelboc axelboc requested a review from loichuder April 19, 2024 09:56
Copy link
Member

@loichuder loichuder left a comment

Choose a reason for hiding this comment

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

Unfortunate. I guess there is no way around it:

Webviews run in isolated contexts that cannot directly access local resources.

https://code.visualstudio.com/api/extension-guides/webview#loading-local-content

@axelboc axelboc merged commit 163b398 into main Apr 19, 2024
6 checks passed
@axelboc axelboc deleted the up-h5web branch April 19, 2024 10:53
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