Skip to content

Instrumentation: emit event with view file #2451

@olivier-thatch

Description

@olivier-thatch

Feature request

When instrumentation is enabled, ViewComponent will emit render.view_component events. The payload for these events looks like:

{
  name: "MyComponent",
  identifier: "/Users/mona/project/app/components/my_component.rb"
}

It would be nice if ViewComponent was also able to emit events when rendering a specific view file (app/components/my_component.html.erb), and include the view file in the payload, similar to ActionView's own render_{template,layout,partial}.action_view events.

Motivation

These events would enable Coverband to detect when a specific view is used. More information in this thread: danmayer/coverband#591

Metadata

Metadata

Assignees

No one assigned

    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