tapestry-cloud / tapestry

PHP static site generator using the plates template system
https://www.tapestry.cloud/
MIT License
32 stars 1 forks source link

Incremental Builds #213

Open carbontwelve opened 7 years ago

carbontwelve commented 7 years ago

This is related to #167; incremental builds would require that Tapestry follow a more tight definition of Compiler and actually go about parsing into a graph all content and then identifying which graph nodes are affected during a rebuild.

This is quite a complex subject and will involve a lot of refactoring.

carbontwelve commented 7 years ago

The content structure of Tapestry is:

During the Parsing phase of compilation for each File discovered all of the above must be identified in order to build the content graph. One node of which may be:

{
    type: 'file',
    path: '/index.phtml',
    template: '/_templates/default.phtml',
    contentType: 'default',
    'taxonomy: null
}

The above node is linked to the Template _/templates/default.phtml and the Content Type default. If either of those change then this node will be marked as needs changes too.

This is rather basic and easily achievable by simply parsing all files for Front Matter and building the graph from that - however - Plates allows the usage of partials therefore a single phtml file could include multiple other phtml partial files. The complexity here is identifying the includes.

carbontwelve commented 7 years ago

This may be useful to look at http://gittup.org/tup/build_system_rules_and_algorithms.pdf

carbontwelve commented 6 years ago

Also maybe useful to look at https://github.com/thejameskyle/graph-sequencer