Closed foscomputerservices closed 6 years ago
TemplateData needs to conform to the Hashable
protocol and the corresponding function needs to be implemented.
This has been fixed in #31. The file path is now used. Templates that don't have a path are no longer cached. Thanks!
I'm struggling with the wrong leaf template being rendered in production (not in development). I'm almost 100% sure that this is a caching problem as if I turn caching off all works as expected.
In digging into TemplateRenderer, I find the following:
Can hashValue on Data really be used as a unique key? I seem to be getting a collision in two of my templates. In the attached debugger autos windows that is stopped at the "if let cached = ..." line above, you'll see that the hash is the same value for both template files, however, the template files are drastically different.
(Please note: I migrated this issue from Leaf #114 as the issue really is with template-kit and not Leaf -- I apologize for incorrectly locating the issue originally)