There seem to be multiple types of middleware that we could support:
- Middleware that participates in the instrumentation of the t-string, before parsing into a placeholder DOM tree
- Middleware that alters the post-parsed placeholder DOM tree (these alternations could be cached, just like the placeholder tree)
- Middleware that participates in substitutions of content values, attribute values, and/or component invocations
- Middleware that alters the final post-substitution DOM tree (outside of the cache)
@pauleveritt I know you've thought a lot about this. Based on our previous conversations, I think your primary interests are probably (a) "participate in component invocation" and (b) "modify the placeholder DOM tree"?
There are a few ways that we could configure such middleware, but the simplest might be to add a bunch of keyword-only arguments to our html() function like instrumentation_middleware=... that takes a callable and... does stuff? Would need to consider how each of these offers plugability.
There seem to be multiple types of middleware that we could support:
@pauleveritt I know you've thought a lot about this. Based on our previous conversations, I think your primary interests are probably (a) "participate in component invocation" and (b) "modify the placeholder DOM tree"?
There are a few ways that we could configure such middleware, but the simplest might be to add a bunch of keyword-only arguments to our
html()function likeinstrumentation_middleware=...that takes a callable and... does stuff? Would need to consider how each of these offers plugability.