CloudyKit / jet

Jet template engine
Apache License 2.0
1.26k stars 106 forks source link

add Cache, simplify Loader, revamp NewSet #183

Closed sauerbraten closed 3 years ago

sauerbraten commented 4 years ago

Altogether, this would mean a v6 release with major breaking changes in Jet's API.

sauerbraten commented 4 years ago

@tooolbox: pinging you because this contains a change you previously didn't like: Loader.Exists() doesn't return the actual path anymore.

I introduced this because Jet builds canonical paths for each referenced template now before looking them up in the loader, i.e. no matter what path is used to reference a certain template from somewhere else, the lookup to the loader will always be an absolute, slash-delimited path. I don't see the point of returning that same path. Jet doesn't need it from any Loader, and it makes sense for no Loader implementations provided by the package. Outside implementations are free to have a Normalize() method if they deal with a second path scheme apart from Jet's.

In general, feedback on this PR is greatly appreciated if you can find the time!