-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PROPOSAL] Add component.handler
middleware
#1208
[PROPOSAL] Add component.handler
middleware
#1208
Conversation
Hi @jtfell, thanks a lot for this! I like the idea of tracking components as page views. Also, thank you for sharing your diagram, this is helpful for understanding the motivation behind this PR. I was first a bit concerned because we'd like new middlewares to stay in our RIDR framework (right now, the component and handler execution happens in However, since this is not an app middleware, I think this should work. Do you have more middlewares for
Looking forward to hearing your thoughts on this! I'll add some documentation for this as well |
I just restructured the component docs a bit (still not happy, but it should be a bit clearer now). I also added the following:
The documentation is very light there, suggestions appreciated 👍🏻 |
"However, since this is not an app middleware, I think this should work." - I'm not sure what you mean by this. "Do you have more middlewares for component in mind? Would other component and handler specific middlewares be added like this?" - I haven't given it a great deal of thought but I can't think of any other use-cases that I would need this sort of thing for. Maybe some sort of monitoring solution (like APM traces) could benefit from it Your ideas for further hooks seem reasonable, but I'm not sure exactly which ones would be most generally useful I think the docs are looking good. I'll hopefully be able to contribute our analytics plugin at some point so that could be useful as an example to point to |
I meant those: jovo-framework/framework/src/App.ts Line 29 in 61900a9
|
I see, that makes sense. Thanks for clarifying. I've thought about this a bit more and I think that
|
hey @jtfell . I really like the idea! However, I'm struggling with how to add this functionality into the framework in a consistent way. ( We keep brainstorming 😄 |
…ell/jovo-framework into feature/component-handler-middleware
Thanks for looking into it @aswetlow! What do you think of the latest commit I pushed as a starting point? Will that miss some edge cases? I'm still figuring out how all the pieces of the framework fit together so you'd know better than me |
Hi @jtfell, thank you for the update! @aswetlow and I just talked about this:
With this naming, we think it would make it a bit easier for us to add more hooks in the future. What do you think? |
That all sounds great to me 👍 Feel free to take over this PR to implement it in this way :) |
I've pushed a change that uses the following:
|
Hi @jtfell, Thank you for your changes, I just added a "Middlewares" page to the docs. After some consideration and discussions with @aswetlow, we decided to rename the handler middleware to This can be merged from my side, thank you! |
…nto feature/component-handler-middleware
Proposed changes
We are building a custom analytics plugin to map components (rather than intents) to pages in Google Analytics. This diagram is specific to our use, but demonstrates what we want to achieve:
To do this, we would like to add a
component.handler
middleware so that plugins can monitor the use of components throughout a request. The way I've implemented it here seems to work. Our plugin does something like this:Types of changes
Checklist