Conversation
davepeck
left a comment
There was a problem hiding this comment.
Thanks @ianjosephwilson for this updated PR! I hope I've done a good first-level job at explaining my perspective here...
|
One last comment:
I think we need to support this, mostly for familiarity from anyone arriving from Javascript-land. |
Fine, I think it is a small mistake, but we can hopefully make it configurable later on. |
|
Some diagrams showing the call structures: TElement, TFragment and TComponentgraph TD;
process_tnode-->_process_element;
_process_element-->process_tnode;
process_tnode-->_process_fragment;
_process_fragment-->process_tnode;
process_tnode-->_process_component;
_process_component-->process_tnode;
TText (Raw) and TCommentgraph TD;
process_tnode-->_process_raw_texts;
_process_raw_texts-->resolve_text_without_recursion;
process_tnode-->_process_escapable_raw_texts;
_process_escapable_raw_texts-->resolve_text_without_recursion;
process_tnode-->_process_comment;
_process_comment-->resolve_text_without_recursion;
TText (Normal)graph TD;
process_tnode-->_process_normal_texts;
_process_normal_texts-->_process_normal_text;
_process_normal_text-->_process_normal_text_from_value;
_process_normal_text_from_value-->_process_normal_text_from_value;
_process_normal_text_from_value-->process_tnode;
Node Processorgraph TD;
_resolve_t_node-->_substitute_and_flatten_children;
_substitute_and_flatten_children-->_resolve_t_node;
_resolve_t_node-->_invoke_component;
_resolve_t_node-->_resolve_t_text_ref;
_resolve_t_text_ref-->_node_from_value;
_invoke_component-->_node_from_value;
_node_from_value-->_node_from_value;
_node_from_value-->_resolve_t_node;
|
|
I've moved my stuff away from Node and over to this PR. Including context. I currently have around an 80 line "fork" override to enable calling components. If I could get a "hook" plug point, I could eliminate it. I (with Claude) have a writeup I can provide. |
|
@pauleveritt What do you mean "enable calling components"? I think components should still work, although this roller coaster of pull-requests has been changing a lot. I'm sorry. I have been thinking about your attribute rewriting situation. It is similar to the "svg" attr fix situation in a way and there seems to be emerging behavior that resembles these sort of single level (1-node/1-node's children) change of behavior or multiple level (subtree) change in behavior. I think there should be some sort of pluggability in there but I'm not sure what/where at this point. Maybe that is for another PR ? |
|
I have a DI system that changes the way components are called. I'd like to configure a function I can provide that handles the calling of a component. The function should be provided the target and have access to the contextvar. I have a long analysis of this (via an agent) with a lot more detail. No rush, as my "fork" is now rebased on this PR. |
svgsupport into processor.Add in system context, parent tag context and namespace context.Needs another PR.Templateso the actual contents are not processed until after the component is invoked.to_html(t'<div>{(lambda: "dynamic")}</div>') != '<div>dynamic</div>'callbackcan be used which then interpolates the return valueto_html(t'<div>{(lambda: "dynamic"):callback}</div>') == '<div>dynamic</div>'Boolean values no longer have special treatmentWe'll keep this for now.