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: Support asynchronous accessors for Blazor Server #23

Closed
KristofferStrube opened this issue Oct 7, 2022 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@KristofferStrube
Copy link
Owner

KristofferStrube commented Oct 7, 2022

Some might use this package in Blazor Server. In Blazor Server we can't use IJSInProcessObjectRefereces which we currently use to get properties like Name from a FileSystemHandle synchronously. It would be nice to have a sample project that uses Blazor Server and to set up the service structure so that you don't need to initialize an IJSInProcessObjectReferece if you don't use it.
A proposed name for the asynchronous counterpart i.e. the Name property would be GetNameAsync().

@KristofferStrube KristofferStrube added the enhancement New feature or request label Oct 7, 2022
@KristofferStrube
Copy link
Owner Author

KristofferStrube commented Nov 2, 2022

In the new packages that this project will rely on which are Blazor.Streams and Blazor.FileAPI I have started a new wrapper structure that simplifies how to have the functionality that is supported in Blazor Server, but also the easy accessors that are available in Blazor WASM through the use of IJSInProcessObjectReferences.
The new structure that I use in those projects should be familiar to people as I basically have some implementation supported in Blazor Server (i.e. the Blob wrapper class) and then another wrapper class that has the features from Blazor WASM which extends the Blazer Server version. (i.e. the BlobInProcess wrapper class). This is similar to the relationship between the IJSRuntime and IJSInProcessRuntime.

I want to adopt this structure in this project. This will be a breaking change but will make it possible to use the package in both Blazor Server and Blazor WASM.

@KristofferStrube
Copy link
Owner Author

This was implemented as a part of #28 and has been published in version 2.0.0 to NuGet.

We have normalized the structure of the wrapper classes to have Blazor Server compatible base implementations and Blazor WASM versions that extend these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant