5 ms·
I have a list of widgets and a button to create a new widget. I don’t want a full page reload when I create a new widget. What are some elegant strategies for
by nkingsy 8y ago
I have a list of widgets and a button to create a new widget. I don’t want a full page reload when I create a new widget.
What are some elegant strategies for handling this with SSR?
I’ve used turbo links and found it rather clunky. Haven’t seen a solution that lets me elegantly reuse server side components in JavaScript without going SPA.
- colecut 8y agoWhy does creating a new client side widget require a server call at all? Couldn't you have the widget in a JavaScript template and just clone it on the dom client side?
- nkingsy 8y agoCloning from a template would be the what, but I was wondering if there are tools designed for this. It's the kind of thing that could spike complexity and I would want an established pattern of delivering html solely for the purpose of javascript manipulation. It's not a hard problem, but a messy one.
- colecut 8y agoI would use a simple "javascript templating engine" like mustache or handlebars, to easily inject dynamic content into your widget templates.