-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(javascript): More micro frontends features #7558
Conversation
@timfish is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
...forms/javascript/common/configuration/micro-frontend-support/module-metadata-integration.mdx
Outdated
Show resolved
Hide resolved
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.
very nice changes!
Co-authored-by: Francesco Novy <[email protected]>
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.
Could we add some details to the index on how all the different pieces are meant to be used together?
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.
I left some comments with pointers on how to tweak these new docs to be more user-friendly.
It seems like users need to go through each page to understand how these different tools work together and which ones they need. It would be helpful to explain that on the index page.
src/platforms/javascript/common/configuration/micro-frontend-support/index.mdx
Outdated
Show resolved
Hide resolved
src/platforms/javascript/common/configuration/micro-frontend-support/index.mdx
Outdated
Show resolved
Hide resolved
src/platforms/javascript/common/configuration/micro-frontend-support/metadata-injection.mdx
Outdated
Show resolved
Hide resolved
src/platforms/javascript/common/configuration/micro-frontend-support/metadata-injection.mdx
Outdated
Show resolved
Hide resolved
...forms/javascript/common/configuration/micro-frontend-support/module-metadata-integration.mdx
Outdated
Show resolved
Hide resolved
src/platforms/javascript/common/configuration/micro-frontend-support/multiplexed-transport.mdx
Outdated
Show resolved
Hide resolved
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.
I think this is a great first step. Thanks a lot!
Some thoughts:
- Did we explore putting all of the components on one page?
- I believe it would be nice to have one coherent goal between all of the different steps. Maybe sending an event to different/multiple DSNs based on a
team
value being injected.
I did but it started getting huge so I split it up. Now I'm reading the review comments I'm rethinking that! The metadata injection and metadata integration make more sense on a single page.
Pulling it all together is still a bit complex, hence this PR but I'll add this and some more exmples to the docs. const ROUTE_TO_EXTRA_KEY = 'ROUTE_EVENT_TO';
const transport = makeMultiplexedTransport(createTransport, args => {
const event = args.getEvent();
if (event && event.extra && ROUTE_TO_EXTRA_KEY in event.extra && Array.isArray(event.extra[ROUTE_TO_EXTRA_KEY])) {
return event.extra[ROUTE_TO_EXTRA_KEY];
}
return [];
});
function frameHasMetadataWithDsn(frame: StackFrame): boolean {
return 'module_metadata' in frame && 'dsn' in frame.module_metadata;
}
Sentry.init({
dsn: '__DEFAULT_DSN__',
integrations: [ new ModuleMetadata() ],
transport,
beforeSend: (event) => {
if (event?.exception?.values?.[0].stacktrace?.frames) {
// Reverse the stack frames so we can traverse from top to bottom
const frames = event.exception.values[0].stacktrace.frames;
const routeTo = frames.findLast(frameHasMetadataWithDsn) || [];
if (routeTo.length) {
event.extra = {
...event.extra,
ROUTE_TO_EXTRA_KEY: routeTo,
};
}
}
return event;
}
}) |
Co-authored-by: Shana Matthews <[email protected]>
@timfish - tag me when you'd like me to take another look! |
0a69e7d
to
c0a5242
Compare
I've reworked this back into a single file with a more cohesive story. The titles are now realted to the problem the user is solving rather than the individual tools! |
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.
👍 Thanks Tim! Content-wise this looks good to me!
src/platforms/javascript/common/configuration/micro-frontend-support.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Abhijeet Prasad <[email protected]>
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 great, thanks for the edits @timfish !
src/platforms/javascript/common/configuration/micro-frontend-support.mdx
Outdated
Show resolved
Hide resolved
src/platforms/javascript/common/configuration/micro-frontend-support.mdx
Outdated
Show resolved
Hide resolved
src/platforms/javascript/common/configuration/micro-frontend-support.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Shana Matthews <[email protected]>
Thanks for your patience with this @timfish!! |
Pre-merge checklist
Description of changes
Document new micro frontends features:
ModuleMetadata
integration@sentry/webpack-plugin