Skip to content

Consider adding pluggable "middleware" support. #31

Description

@davepeck

There seem to be multiple types of middleware that we could support:

  1. Middleware that participates in the instrumentation of the t-string, before parsing into a placeholder DOM tree
  2. Middleware that alters the post-parsed placeholder DOM tree (these alternations could be cached, just like the placeholder tree)
  3. Middleware that participates in substitutions of content values, attribute values, and/or component invocations
  4. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions