-
Notifications
You must be signed in to change notification settings - Fork 10
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
[WIP] Precompile Handlebars templates #85
base: master
Are you sure you want to change the base?
Conversation
/cc @ocke |
<% unless templates.nil? %> | ||
{ | ||
<% templates.each do |name, fn| %> | ||
<%= name %>: <%= fn %>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do the following to make it work:
That also what the normal compiler outputs btw (it wraps it into that Handlebars.template function).
- <%= name %>: <%= fn %>,
+ <%= name %>: Handlebars.template(<%= fn %>),
I can't make a PR on this PR... so I guess I'll just comment here ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ocke, yep
I only began testing when I first put it up, realised there was a call missing, then moved onto something else 😸
Thanks for the comment, much appreciated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well now you know I tried your code ;-). I actually programmed this thing myself, not realizing you did it already.
I used npm and .bin/handlebars #{file}
though. But I like your approach more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably saw, in the PR description, I considered that, as an enhancement, it might be better to precompile the templates out to a file to be cached in S3, rather than precompiling every time.
🐨 🚫⚠️
POC/WIP to precompile Handlebars templates on the server rather than in the client.
Note: this currently only services ZAT, ZAM would need to be independently updated if proceeding
/cc @danielbreves
Tasks
References
Risks