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 Server prerendering with parameters support #14433

Closed
javiercn opened this issue Sep 25, 2019 · 8 comments
Closed

Blazor Server prerendering with parameters support #14433

javiercn opened this issue Sep 25, 2019 · 8 comments
Assignees

Comments

@javiercn
Copy link
Contributor

@javiercn javiercn commented Sep 25, 2019

Right now our customers can create blazor server-side applications but are not able to provide an initial set of parameters for the application to use. This limits the ability to pass in information to the blazor application from the initial component render.

There are many cases where this is useful.

  • Passing per-user initialization information.
    • We get a lot of request from customers about this and there is not an easy solution, passing parameters to the top level components would solve that.
  • Setting up initial context.
    • Being able to pass initial values for the theme of the application would be an example.
  • Rendering multiple components into a page.
    • This would be useful in scenarios where users are building rich reporting experiences with interactive charts and similar components.

All the infrastructure to support this is already in place. The only missing piece is the ability to serialize parameters into the descriptor that we generate and to deserialize them when the circuit starts and provide them as the initial parameters to the renderer.

@danroth27 danroth27 added this to Triage in Blazor 3.1 via automation Sep 25, 2019
@danroth27 danroth27 added this to the 3.1.0-preview2 milestone Sep 25, 2019
@javiercn

This comment has been minimized.

Copy link
Contributor Author

@javiercn javiercn commented Sep 25, 2019

Related issue #13721

@Ponant

This comment has been minimized.

Copy link
Contributor

@Ponant Ponant commented Sep 26, 2019

Ideally, it would be great to be able to do this, in a Razor Page rather than only in a Razor component
<Counter IncrementAmount=2/>

We have an RP based website and now would like to add some blazor components in some of these cshtml RP pages, but we cannot pass in parameters, neither with a tag nor with an anonymous type in RenderComponentAsync (as known here https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-9/#multiple-components-in-views-or-pages).

Thanks for this feature to come :)

@javiercn javiercn added the Working label Sep 26, 2019
@mkArtakMSFT mkArtakMSFT moved this from Triage to In progress in Blazor 3.1 Sep 27, 2019
@mkArtakMSFT mkArtakMSFT assigned pranavkm and unassigned javiercn Sep 27, 2019
pranavkm added a commit that referenced this issue Oct 1, 2019
Fixes #14433
pranavkm added a commit that referenced this issue Oct 1, 2019
Fixes #14433
pranavkm added a commit that referenced this issue Oct 1, 2019
Fixes #14433
mkArtakMSFT added a commit that referenced this issue Oct 1, 2019
@fireinthemountain

This comment has been minimized.

Copy link

@fireinthemountain fireinthemountain commented Oct 2, 2019

Support for parameters being passed from MVC views or razor pages would be beneficial to my organization to use Blazor. Hopefully support for server-side parameters will be in 3.1. This definitely caught me off guard with its removal in 3.0.

@pranavkm pranavkm closed this Oct 2, 2019
@pranavkm pranavkm added Done and removed Working labels Oct 2, 2019
@pranavkm pranavkm moved this from In progress to Done in Blazor 3.1 Oct 2, 2019
@rynowak

This comment has been minimized.

Copy link
Member

@rynowak rynowak commented Oct 2, 2019

Support for parameters being passed from MVC views or razor pages would be beneficial to my organization to use Blazor. Hopefully support for server-side parameters will be in 3.1. This definitely caught me off guard with its removal in 3.0.

Thanks for your feedback. This feature will be back in 3.1

@danroth27 danroth27 changed the title [Blazor] Server-side parameters support Blazor Server prerendering with parameters support Oct 2, 2019
@danroth27 danroth27 mentioned this issue Oct 2, 2019
10 of 10 tasks complete
@wstaelens

This comment has been minimized.

Copy link

@wstaelens wstaelens commented Oct 11, 2019

Can't use blazor 3.0 without this. When is 3.1 ready?

@mkArtakMSFT

This comment has been minimized.

Copy link
Contributor

@mkArtakMSFT mkArtakMSFT commented Oct 12, 2019

@wstaelens it'll be some time between late November to early December.

@YoanaDimitrova-kpmg

This comment has been minimized.

Copy link

@YoanaDimitrova-kpmg YoanaDimitrova-kpmg commented Nov 18, 2019

I still get System.InvalidOperationException: 'Server components with parameters are not supported.'
I am on Version: 3.1.100-preview3-014645.

Is this going to be resolved soon or at all? A lot of us don't want to migrate a whole ASP.NET app to Blazor directly but would rather migrate our JScomponents to Blazor components first especially since WebAssembly Blazor is not production ready untill at least March next year.

Am I correct thinking that currently the only way to use Blazor is to migrate an ASP.NET app to Blazor server-side and convert all Razor pages to Blazor pages? Presumably this will allow using Blazor components with parameters?

@pranavkm

This comment has been minimized.

Copy link
Contributor

@pranavkm pranavkm commented Nov 18, 2019

Hi, it looks like you are posting on a closed issue/PR/commit!

We're very likely to lose track of your bug/feedback/question unless you:

  1. Open a new issue
  2. Explain very clearly what you need help with
  3. If you think you have found a bug, include detailed repro steps so that we can investigate the problem

Thanks!

@dotnet dotnet locked as resolved and limited conversation to collaborators Nov 18, 2019
@jaredpar jaredpar removed this from Done in Blazor 3.1 Jan 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.