tapestry icon indicating copy to clipboard operation
tapestry copied to clipboard

Incremental Builds

Open carbontwelve opened this issue 8 years ago • 4 comments

carbontwelve avatar Jun 12 '17 11:06 carbontwelve

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 avatar Jun 12 '17 11:06 carbontwelve

The content structure of Tapestry is:

  • File belongsTo ContentType
  • ContentType hasMany Taxonomy
  • File hasMany Taxonomy
  • File hasOne Template
  • File hasMany Use
  • Template hasOne Template (can be many levels deep)

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 avatar Jun 12 '17 11:06 carbontwelve

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

carbontwelve avatar Aug 18 '17 15:08 carbontwelve

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

carbontwelve avatar Dec 05 '17 20:12 carbontwelve