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
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one

Comments

@javiercn
Copy link
Member

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 the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Sep 25, 2019
@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
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Sep 25, 2019
@javiercn
Copy link
Member Author

Related issue #13721

@Ponant
Copy link
Contributor

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 :)

@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
@fireinthemountain
Copy link

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 as completed Oct 2, 2019
@pranavkm pranavkm added Done This issue has been fixed and removed Working labels Oct 2, 2019
@pranavkm pranavkm moved this from In progress to Done in Blazor 3.1 Oct 2, 2019
@rynowak
Copy link
Member

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 tasks
@wstaelens
Copy link

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

@mkArtakMSFT
Copy link
Member

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

@YoanaDimitrova1
Copy link

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
Copy link
Contributor

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.
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

9 participants