koajs / koa-hbs

Handlebars templates for Koa.js
MIT License
159 stars 43 forks source link

changing thunk to promise seems to gain better performance #48

Closed renaesop closed 7 years ago

renaesop commented 8 years ago
  1. change thunk to promise;
  2. make the disable cache option can be applied to partials
shellscape commented 8 years ago

@renaesop looks like the tests need to be updated for travis to pass.

also, this will be an unpopular position, given that the new hotness is to move away from thunks while we wait for async/await to be finalized and implemented: there are lots of people still using thunks. the changes are small enough that we can and should provide and option for which return pattern the user would like.

shellscape commented 8 years ago

@renaesop any chance you could pull out your changes and the caching fixes into a separate PR? If not, I can cherry pick them. but I'd like to get those fixes in while we wait for feedback on switching to promises from thunks.

partials fixes reference #33

shellscape commented 7 years ago

cherry picked the partials cache fix, but at this time are not proceeding with the promise implementation. at a point in the future we'll go that route for koa@2 compatibility.