-
Notifications
You must be signed in to change notification settings - Fork 404
Description
Background
Data Transform Plugin is a popular (over 470 000 installs according to Packagist) plugin for Pattern Lab PHP. It is especially useful in Drupal front end development. It is possible that some users don't even realize that the features provided by Data Transform Plugin are not part of Pattern Lab PHP core.
A Node version of Data Transform Plugin would make migration from Pattern Lab PHP to Pattern Lab Node easier for many people.
Based on my limited knowledge of JavaScript and the Pattern Lab Node codebase, it seems to me that it is not currently possible to create a Node version, due to missing core support for some requirements. If it turns out that core does support all requirements, it would still be good to know the 'right' way to do these things!
Technical description and requirements
Data Transform Plugin processes data in pattern data files and makes the processed data available to patterns. Other patterns can be included in data files and pattern specific data is also made available to patterns included in the templates themselves.
-
Core should have a working plugin system (Core should have a working plugin system #1021).
-
Since an included pattern might not yet be rendered by core, the plugin needs to be able to render a pattern exactly as core would render it (Plugins should be able to render individual patterns exactly as core would render them #1022).
-
For performance reasons it would be ideal if the plugin had at least read access to all Pattern Lab data, so it can check if the included pattern is already rendered. Even better would be if the plugin had write access also, so that core does not have to render patterns already rendered by the plugin. (Plugins and Engines should have access to all Pattern Lab data #1023)
-
To be able to add data for patterns included in Twig templates, the Twig engine needs similar access to all Pattern Lab data, also from PHP code (Plugins and Engines should have access to all Pattern Lab data #1023).