-
Notifications
You must be signed in to change notification settings - Fork 49
Prepare for hapi v6.0 #69
Comments
Are you deprecating helpersPath as well ? I haven't been able to make it work with the advised changes, I'm on 5.1 and a structure like this worked better : engines: {
html: {
module: require('handlebars')
}
} Still missing the helpers though, working on it. |
helpersPath should not change since that is always relative to the basePath or path. What's not working? |
The helpers are unknown to handlebars, I've already checked the path is correct. |
You should not need to put it under module. The tests don't. Can you construct a failing helpers test? |
Well it's worse without module ( The current tests already fail with missing helper as you can see on travis. |
I suspect it has something to do with you cloning the engine module multiple times. I'll look into it tomorrow. |
I think I've found at least one cause of failure, the require on handlebars goes through |
I forgot you are trying to be backwards compatible. Then yes, you need |
Unless there's a compelling reason not to, I'll try to be, it's not a huge effort at least for that 6.0, I might revise that later if things change in hapi. |
Is it normal that hapi gobbles the module part after providing it to |
Well, everything works now. Any thoughts on the changes ? v4.2.0...hapi6 |
The entire way the options are setup mixing views and non-views settings is very messy. Why is the engine configurable when the paths to the templates are not? I don't understand what should and should not be customizable. Why isn't just the CSS customizable? |
See hapi6-eran branch. |
I never bothered to change these options since it seemed fined when I took over the project, and people might want to override everything, from the rendering engine to css, so I've kept it that way. This doesn't work with hapi 5 but I might as well go for hapi 6. I don't know if people follow hapi versions closely. |
What doesn't work? The tests are hapi-version-specific but the lib code should work on 6 and 5. |
hapijs/hapi#1664
Quick review shows that moving
plugin.loader()
, requiring handlebars directly, and moving to absolute path to the templates directory will allow it to be backwards compatible change.The text was updated successfully, but these errors were encountered: