Skip to content

Comments

feat: Inject component annotations into HTML elements rather than React components#851

Merged
Lms24 merged 2 commits intogetsentry:mainfrom
timfish:timfish/feat/inject-into-html
Jan 26, 2026
Merged

feat: Inject component annotations into HTML elements rather than React components#851
Lms24 merged 2 commits intogetsentry:mainfrom
timfish:timfish/feat/inject-into-html

Conversation

@timfish
Copy link
Collaborator

@timfish timfish commented Jan 22, 2026

Rather than inject attributes into React components which can cause incompatibilities with props, this PR adds an alternative version of the babel plugin that instead injects attributes into every HTML element in the components root.

This can be enabled by setting reactComponentAnnotation: { enabled: true, _experimentalInjectIntoHtml: true }.

I created a separate babel transform plugin so I didn't have to hack around and get the logic working in the old plugin. It's much more simple. The experimental option switches between the two plugins.

@timfish timfish force-pushed the timfish/feat/inject-into-html branch from cb7cb1f to 6e194f2 Compare January 23, 2026 12:25
@timfish timfish marked this pull request as draft January 23, 2026 13:55
@timfish timfish marked this pull request as ready for review January 24, 2026 01:26
@Lms24 Lms24 merged commit 7ea6848 into getsentry:main Jan 26, 2026
24 checks passed
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jan 27, 2026
@timfish timfish deleted the timfish/feat/inject-into-html branch February 17, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reactComponentAnnotation. I use an unintended value for a prop.

3 participants