-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
The current transformation action implementation has some serious shortcomings. Currently, a compiled template is a function that executes a sequence of update-in calls with the transformation function being the function passed to update-in. Additionally, the function takes the following parameters: [template parameters scoped-parameters action-arguments child-transformations].
This has the following shortcomings:
- The transformation logic has to run on every render - there is no way for an implementation (eg for freactive) to perform setup at compile-time and only update the data during render. Currently, you would render once to generate a freactive component tree and then update its data, rather than render any time the data changes, which is inconsistent with the default use.
- Transformations must be strictly applied to the node being selected. This means that, for example, clone-for can be used to clone content, but not the addressed node itself (it would have to select the parent to do that)
- There is no pre-transform or post-transform steps. This means that specific implementations (eg freactive/om/reagent) cannot prepare the template before applying transformations or clean it up after applying transformations.
All of these things should happen during the compile step and rendering should be a very lightweight "update the data" process.