- Notifications
You must be signed in to change notification settings - Fork8
[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 ourterms of service andprivacy 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?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
acd05a6 tof38fce4Comparef38fce4 to761d68dCompare
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 inae68609
| 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?
| returntoReturn; | ||
| } | ||
| constcfg=validatedOptions.sourceCodeContextasSourceCodeContextOptions; |
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 ofas casting.
| constcfg=validatedOptions.sourceCodeContextasSourceCodeContextOptions; | |
| constcfg:SourceCodeContextOptions=validatedOptions.sourceCodeContext; |
| constcfg=validatedOptions.sourceCodeContextasSourceCodeContextOptions; | ||
| if(!cfg?.service||typeofcfg.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?
Ithink this is the default.
| constbundlerEntry=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?