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

Blazor WASM support? #24

Open
pm64 opened this issue Mar 29, 2021 · 6 comments
Open

Blazor WASM support? #24

pm64 opened this issue Mar 29, 2021 · 6 comments

Comments

@pm64
Copy link

pm64 commented Mar 29, 2021

I can see this library likely works great for Blazor Server, but could it be extended to add compressed static resource support in Blazor WASM applications?

@AnderssonPeter
Copy link
Owner

Sorry for the late reply, i havent had any interest in blazor yet so i have no idea how it works and sadly have no idea if and how to support it.

@aloksharma1
Copy link

aloksharma1 commented Jan 2, 2022

I can see this library likely works great for Blazor Server, but could it be extended to add compressed static resource support in Blazor WASM applications?

WASM is client side, so you get detached from server just like angular, react etc so the files server is serving have no way to be controlled by pure WASM.. but as a work around you can put all the static files on a subdomain and treat it as a file server (or make a bunch of them to mimic cdn) this is a workaround, you can also control content headers but thats it when you are sitting on client end .

@pm64
Copy link
Author

pm64 commented Jan 2, 2022

Thank you @aloksharma1 for providing your thoughts. I agree that deploying a secondary server-side application for the purpose of serving image files would facilitate the desired behavior in Blazor WASM. A simpler pure-client solution that does not involve a separate file server is obviously possible, but perhaps not in a way that reconciles with this library's API. It would be nice for both Server and WASM to be handled through a common mechanism.

@aloksharma1
Copy link

Thank you @aloksharma1 for providing your thoughts. I agree that deploying a secondary server-side application for the purpose of serving image files would facilitate the desired behavior in Blazor WASM. A simpler pure-client solution that does not involve a separate file server is obviously possible, but perhaps not in a way that reconciles with this library's API. It would be nice for both Server and WASM to be handled through a common mechanism.

iirc WASM can also be hosted in server side app, so maybe you can try this mixed approach, but i have checked again pure client side WASM wont have any control on server behavior.

@pm64
Copy link
Author

pm64 commented Jan 4, 2022

Well a pure client-side solution could exist in which the client explicitly requests the best static resources it can support. But this would require special markup, which would not reconcile with this library's API. So a complete solution supporting both Blazor Server and Blazor WASM would impose such markup on Blazor Server components as well, even though the actual requests would likely be handled differently in the two cases. This is the only way to facilitate components supporting compressed static resources, where the components themselves are interchangeable between Server and WASM.

@AnderssonPeter
Copy link
Owner

As i said I'm a total noob when it comes to blazor but arent static resources like html, css, images and javascript requested normally? If that is the case then this library should still help there? The only thing that then wouldn't be precompressed would be the application code?

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

3 participants