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

Vision never reloads/recompiles partials #110

Closed
adamesque opened this issue Feb 20, 2017 · 3 comments
Closed

Vision never reloads/recompiles partials #110

adamesque opened this issue Feb 20, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@adamesque
Copy link

@adamesque adamesque commented Feb 20, 2017

If we use the setting isCached: false, Vision will read & recompile top-level templates each time render is called. This is great!

But, helpers and partials are only ever read & registered on startup, so (for instance) given a handlebars template that makes heavy use of partials to break apart the view, changes to those partials will only appear after a full server restart.

Seems like it'd be expensive to reload every single partial & helper on every render call when isCached: false, but the alternative would be to listen to changes in partials in a plugin and manually call Handlebars.registerPartial on them. But that reaches way outside vision and feels weird.

Another idea would be to scan a template for partial names, and selectively recompile and reregister just those partials if caching is turned off.

Thoughts?

@btmorex

This comment has been minimized.

Copy link

@btmorex btmorex commented May 18, 2017

This confused me too. I thought isCached wasn't working at all. I think partials should be reloaded regardless of the cost; disabling caching is for development so the performance impact doesn't really matter.

@wswoodruff

This comment has been minimized.

Copy link
Contributor

@wswoodruff wswoodruff commented Nov 4, 2017

I can get to work on this soon

@wswoodruff wswoodruff added the request label Nov 8, 2017
@wswoodruff wswoodruff self-assigned this Nov 8, 2017
@wswoodruff

This comment has been minimized.

Copy link
Contributor

@wswoodruff wswoodruff commented Nov 11, 2017

@adamesque
I've got a PR for this here: #132 -- you can test it out on examples/handlebars/partials and examples/handlebars/helpers if you pull down the recompile-partials branch.

I added helpers loading as well because those are normally light-weight, and like you guys said, this is only intended for development.

@wswoodruff wswoodruff added this to the 5.2.0 milestone Nov 13, 2017
@Marsup Marsup added feature and removed request labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.