-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
📝 [Proposal]: We need partial render! #3297
Comments
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
+1 This sounds like a great idea. Due to the way SSE and A problem we could potentially have with this is that a If possible, we may want to add this functionality to a different interface to avoid that confusion. |
@grivera64 @vmpartner Should we implement this functionality out as a new middleware? |
I think method RenderToWriter must appear inside main app, it cannot be implement in middleware |
I think it is possible to use a middleware to encapsulate the feature, though we would still need to implement a An idea could be to create this method under a separate package (or even bundle it alongside the middleware in a
partials.RenderAsBytes(templateName string) []byte
partials.RenderToWriter(w *bufio.Writer, templateName string) error This way, we could directly use this in a middleware: app.Get("/partial", partials.New("my-partial", func() fiber.Map {
return getLiveData() // assuming getLiveData() returns a bind of type fiber.Map
}) What do you both think about this setup? @vmpartner @JIeJaitt |
@grivera64 Sounds good! |
Feature Proposal Description
We have amazing gofiber + htmx + sse. We can send partial template on each update via SSE
Example how it can be reached now:
I propose that we can add method RenderToWriter(w *bufio.Writer, templateName string, data fiber.Map, layoutName string)
Alignment with Express API
HTTP RFC Standards Compliance
API Stability
Feature Examples
Checklist:
The text was updated successfully, but these errors were encountered: