-
Notifications
You must be signed in to change notification settings - Fork 8
[RUM-13448] Add source code context injection for microfrontend #255
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
base: master
Are you sure you want to change the base?
Conversation
acd05a6 to
f38fce4
Compare
f38fce4 to
761d68d
Compare
yoannmoinet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks super good.
Thanks for tackling this.
Do you think you could also update ownership of the plugin?
build-plugins/.github/CODEOWNERS
Line 26 in ae68609
| packages/plugins/rum @yoannmoinet |
I mostly had small comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file accidentally duplicated?
| return toReturn; | ||
| } | ||
|
|
||
| const cfg = validatedOptions.sourceCodeContext as SourceCodeContextOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work?
I'm not a super fan of as casting.
| const cfg = validatedOptions.sourceCodeContext as SourceCodeContextOptions; | |
| const cfg: SourceCodeContextOptions = validatedOptions.sourceCodeContext; |
| const cfg = validatedOptions.sourceCodeContext as SourceCodeContextOptions; | ||
|
|
||
| if (!cfg?.service || typeof cfg.service !== 'string') { | ||
| toReturn.errors.push(`Missing ${red('"sourceCodeContext.service"')}.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid any confusion from user's standpoint.
| toReturn.errors.push(`Missing ${red('"sourceCodeContext.service"')}.`); | |
| toReturn.errors.push(`Missing ${red('"rum.sourceCodeContext.service"')}.`); |
| { | ||
| entry: bundlers.reduce((acc, bundler) => ({ ...acc, [bundler]: './index.js' }), {}), | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
I think this is the default.
| const bundlerEntry = buildConfigOverride?.entry?.[bundler] || './index.js'; |
| { | |
| entry: bundlers.reduce((acc, bundler) => ({ ...acc, [bundler]: './index.js' }), {}), | |
| }, |
What and why?
This PR adds source code context injection capabilities to the RUM plugin, enabling customers to identify which microfrontend originates each RUM event in their applications. It focuses on setups with separated bundles loaded via dynamic imports (e.g., module federation) by injecting source code metadata at entry points.
How?