Proposal: Add ability to pass @Model to prerendered boot func #1589

Closed
opened 2025-08-09 17:20:47 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @laskoviymishka on 6/1/2016

It would be nice to see some ability to pass extension model for our prerendered components. It could be very helpfull for some redux/flux apps (we could populate initial state with them). And it could reduce total overhead of loading some info via Http requests.
Proposal api looks pretty simple. In tag helper add populate new attribute:

<app asp-prerender-module="ClientApp/boot-server"
     asp-prerender-model="Model"
     asp-prerender-webpack-config="webpack.config.js">Loading...</app>

Inside boot func there is new optional parameter, which popuated from asp-prerender-model attribute:

export interface BootFunc {
  (params: BootFuncParams, model: any): Promise<RenderToStringResult>;
}

Such feature would be really good for building some dynamic parts for exist applications (not whole application handled by some JS-framework).

*Originally created by @laskoviymishka on 6/1/2016* It would be nice to see some ability to pass extension model for our prerendered components. It could be very helpfull for some redux/flux apps (we could populate initial state with them). And it could reduce total overhead of loading some info via Http requests. Proposal api looks pretty simple. In tag helper add populate new attribute: ``` <app asp-prerender-module="ClientApp/boot-server" asp-prerender-model="Model" asp-prerender-webpack-config="webpack.config.js">Loading...</app> ``` Inside boot func there is new optional parameter, which popuated from `asp-prerender-model` attribute: ``` export interface BootFunc { (params: BootFuncParams, model: any): Promise<RenderToStringResult>; } ``` Such feature would be really good for building some dynamic parts for exist applications (not whole application handled by some JS-framework).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1589
No description provided.