Skip to content
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

ViewComponent: consider consuming ActiveSupport notifications, audit our instrumentation for private API usage #2872

Open
fallwith opened this issue Sep 30, 2024 · 1 comment

Comments

@fallwith
Copy link
Contributor

As discussed in #2870 which addressed #2869, our existing ViewComponent instrumentation had been making use of a private API which was well within its rights to change without us knowing about it. We also monkeypatch render_in instead of consuming the ActiveSupport notification generated by ViewComponent's own render_in method.

We ought to:

  • See if we can completely get out of the business of monkeypatching render_in and rely solely on the notification produced by original method and if not we should work with ViewComponent's maintainers to report our findings. At first glance, it looks like the big win that monkeypatching gives us over the notifications is that we are able to wrap the call in a rescue and generate a New Relic noticed error. Can we enhance ViewComponent's own error handling of render_in to include error information in the ActiveSupport notification?
  • Audit all existing ViewComponent API calls we make and comment on any uses of private APIs. These should all have very specific unit test coverage to give us early warnings when a new ViewComponent gem version is released, and they should all have corresponding GitHub issues created to remind us to work with the ViewComponent maintainers to evaluate options for moving away from using private APIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants