#1829 - Allow coding up of template dependencies
| Identifier | #1829 |
|---|---|
| Issue type | Feature request or suggestion |
| Title | Allow coding up of template dependencies |
| Status | Completed |
| Tags |
Roadmap: v11 partial implementation (custom) |
| Handling member | Chris Graham |
| Addon | core_themeing |
| Description | If you include one template in another via Tempcode include, or in LESS, then if the included file changes, Composr does not know to recompile the referenced file. Create some kind of system for coding up dependencies. Possibly via _config.php |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
dep:custom.less
Could be encapsulated using whatever native comments, e.g.
/*dep:custom.less*/
{$,dep:FORM_STANDARD_END.tpl}
New function, can_use_cache($cache_type, $file_path, $cache_path) -- implements smart_decaching (if enabled), and checks of various cache/keep_cache/cache_*/keep_cache_* parameters, and $SITE_INFO['dependency__' / dependencies_are_good stuff (recursively)
Rename disable_smart_decaching to smart_decaching, and don't have enabled by default (due to the performance hit)
Update the documentation about smart_decaching to make it clear it is not on by default, although it can be enabled via the keep_smart_decaching option
New keep_cache_off_for parameter. Any cacheable asset matching that regexp will not be cached. Implemented within can_use_cache function. Documented alongside documentation about smart_decaching
New automatic dependency detection support:
When Tempcode is parsed with the INCLUDE directive, update a .dat file, e.g. global.css.tcp.dat
Emptying the template cache (in any way) should delete the .dat files
can_use_cache function will use this data, recursively
Document alongside documentation about smart_decaching
All we need is a simple keep_cache_avoid_for URL parameter that takes a regexp of what templates (etc) to temporarily not enable caching on.
Then the developer can debug using that, and when done, empty the template cache.
Meanwhile, the ability to hard-code dependencies is useful, so I've simply documented the simple implementation I've already done.
Implementing auto-detection for that would just be bloat, too much core complexity.