queckezz / koa-views

Template rendering middleware for koa (hbs, swig, pug, anything! :sparkles:)
MIT License
710 stars 87 forks source link

Module based template locations #116

Closed ozzyogkush closed 3 years ago

ozzyogkush commented 6 years ago

This pull requests adds the ability for users with a module-based application structure to use this package. Since this is a breaking change to the API it would bump it to version 7.0.0.

niftylettuce commented 6 years ago

I do not think this should be supported in this package, it is a very unique use case I have never seen.

ozzyogkush commented 6 years ago

This makes it a little more flexible, which is good for end users. For my specific case, the project has been canceled, so I don't really care if this gets merged in, but you can use it as a starting point to supporting more use cases if you want. In terms of uniqueness, some frameworks do support and require a module-based approach. Magento is a prime example, even though it's PHP-based. At the time I was writing a new framework in JS based on a similar approach, hence the need for the support here. FWIW I wouldn't be surprised if more frameworks extendible in such a manner pop up.

int64ago commented 6 years ago

@ozzyogkush Thanks for the PR :-)

IMO, it maybe not worth of a break change, i'll keep this PR opened and wait for more feedback from others.