leshill / handlebars_assets

Use handlebars.js templates with the Rails asset pipeline.
MIT License
649 stars 159 forks source link

Causes very long load times #136

Closed quinn closed 8 years ago

quinn commented 8 years ago

A project with many hbs templates can take a very long time to load in development. I wonder if there is an easy way to compile all hbs templates into a single file, rather than individual files?

AlexRiedler commented 8 years ago

@quinn it should be linear with the number of templates you have. Merging them into one file should be part of the asset pipeline. I would recommend making sure you are using a relatively recent version for ExecJS to run of v8 or similar. What do you mean by "very long" as well as it is very relative.

Maybe there is a way we can use a pool of ExecJS instances to compile instead which would make things faster...

quinn commented 8 years ago

you're right, it is linear :) and you're also right, this issue isn't really relevant to this project. fwiw, my solution was this:

<%= javascript_include_tag 'application' %>
<%= javascript_include_tag 'hbs_views', debug: false %>