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

Ability to re-render the partial without rendering the parent along with the partials template #1612

Closed
aimyth opened this issue Nov 23, 2019 · 4 comments

Comments

@aimyth
Copy link

aimyth commented Nov 23, 2019

When using partials, the structure of the view or page would be as follows

View1
  partial1
  partial2
  partial3
After rendering the view1 if due to a selection one needs to re-render the partial1, there should be an ability to render only this section instead of re-rendering the entire View1.

@nknapp
Copy link
Collaborator

nknapp commented Nov 28, 2019

Partial rendering is not a use-case for Handlebars. In your case, you can do it yourself using multiple templates instead of partials. But I would strongly suggest to use Ember (if you want to use Handlebars-syntax), Vue.js, React or Angular for in-browser rendering.

@aimyth
Copy link
Author

aimyth commented Dec 9, 2019

I don't agree with this view. One of the reason handlebar is not able to render partials is due to the assumption that all data including the partials should be provided to the parent template.

If one has to use multiple templates which is the current workaround, namely have these template present separately. The parent can't include these partials, we need to know the Ids where the rendered content of the template should go.
Parent
content Id 1 for Template 1 content
content Id 2 for Template 2 content

Handlebar
Template1
Template2

Pass template 1 data and render Template 1. Then using Jquery or other framework this needs to be substituted into parent content id 1. Basically we now need to do this outside nullifying the enhanced use cases for partials for dynamic content.

I am closing this as the current direction for partials is to keep it simple. If enhanced we could relook at this use case.

@aimyth aimyth closed this as completed Dec 9, 2019
@nknapp
Copy link
Collaborator

nknapp commented Dec 9, 2019

I have never used it myself, but maybe 'glimmer-vm' is more appropriate to your case.

@nknapp
Copy link
Collaborator

nknapp commented Dec 9, 2019

Its use case is to render and incrementally update a handlebars template in a website. It is used by ember.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant