Skip to content

[Feature Request] Blazor: Ability to run some components completely on server-side #8758

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

Closed
RyoukoKonpaku opened this issue Mar 23, 2019 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@RyoukoKonpaku
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The ability to run a portion of Components in Blazor as a Razor Component Island which is planned on the roadmap #8214 which targets if I recall only MVC.

For instance one use-case for this is to run some business logic that you don't want to expose to the client side completely. One example I could think of is the one presented by @danroth27 at NDC for Razor Components wherein they used an ML.NET model to determine sentiment analysis on a text review on every keystroke, but also would like to only restrict these online components on some areas that needs them.

Describe the solution you'd like

Possibly a directive on the component to determine on what context it will run, I'd assume it should be seamless and easy to switch on both modes.

@RuntimeContext Components.ServerSide
@RuntimeContext Components.ClientSide

This should work both ways, Razor Components wanting some areas client-side and Blazor wanting some areas server side.

This would compliment DI as well. Say the component calls ISomeService.DoSomething(), when running on a Blazor context it would look into the registered service on the Blazor IOC container and when running on a Razor Components context it would look into the Server container for ISomeService.

@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 25, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Mar 25, 2019
@mkArtakMSFT
Copy link
Contributor

Thanks for contacting us, @RyoukoKonpaku.
This is not something we plan to do in the near future.

@plasticalligator
Copy link

plasticalligator commented Apr 27, 2019

I know this was shot down and closed, but I wanted to add my two cents here:

I don't know what "near future" is defined as, but if it's a polite way of saying "never" then I want to express that I think a serverside/client runtime context could be extremely valuable for Blazor's long term viability.

I understand keeping track of the DOM differences between both could be haughty but, as OP stated, there are a lot of scenarios Blazor where it doesn't make sense to run certain components on the client or server. This could enable functionalities such as being able to search and filter enumerables acquired from the server locally without any overhead.

I would love to see this implemented at some point in the future to the point where blatant bribery is not out of the question because this would remove the need to otherwise wire together and glue the jigsaw puzzle pieces that don't really fit together to make something like this work.

@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants