Sometimes the NodeTemplate cannot store all the information you need to create a new node (may be too expensive to copy all that data around, or simply can't own the data). In those cases, it makes sense to store some sort of id or handle inside the NodeTemplate and use that to index into a structure holding the actual data.
To enable this pattern, the user_state is now passed as a parameter to build_node. This is a breaking change, but not a huge one: Old implementations can simply ignore the new parameter, and the compiler should guide users to the issue when updating. It still was deemed necessary because there's no other way to access graph-global data in build_node.
Sometimes the
NodeTemplate
cannot store all the information you need to create a new node (may be too expensive to copy all that data around, or simply can't own the data). In those cases, it makes sense to store some sort of id or handle inside theNodeTemplate
and use that to index into a structure holding the actual data.To enable this pattern, the
user_state
is now passed as a parameter tobuild_node
. This is a breaking change, but not a huge one: Old implementations can simply ignore the new parameter, and the compiler should guide users to the issue when updating. It still was deemed necessary because there's no other way to access graph-global data inbuild_node
.