✨ Add Browser RUM Salesforce package and support#4726
✨ Add Browser RUM Salesforce package and support#4726BeltranBulbarellaDD wants to merge 4 commits into
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 0fe7170 | Docs | Datadog PR Page | Give us feedback! |
Bundles Sizes Evolution
|
f4cc6bb to
5ce95a1
Compare
3260f6c to
288b9de
Compare
288b9de to
8c6cd15
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c6cd15706
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Salesforce LWS does not support the unhandledrejection event. https://developer.salesforce.com/tools/lws-distortion-viewer | ||
| if (!isEventSupported(globalObject.window, DOM_EVENT.UNHANDLED_REJECTION, noop)) { | ||
| return { stop: noop } | ||
| } |
There was a problem hiding this comment.
thought: I understand that we want to test for cookieStore "change" event explicitly, because else the session manager won't work correctly.
However, for other events, I wonder if it wouldn't be simpler to wrap the addEventListener in a try/catch and ignore event silently.
There was a problem hiding this comment.
I think this way just makes it clearer we are trying to attach the event in Salesforce. If we were to wrap the addEventListener we might catch/fail on other things without realizing it?
|
|
||
| export function instrumentUnhandledRejection(callback: UnhandledErrorCallback) { | ||
| // Salesforce LWS does not support the unhandledrejection event. https://developer.salesforce.com/tools/lws-distortion-viewer | ||
| if (!isEventSupported(globalObject.window, DOM_EVENT.UNHANDLED_REJECTION, noop)) { |
There was a problem hiding this comment.
nitpick: globalObject.window is a bit redundant
| if (!isEventSupported(globalObject.window, DOM_EVENT.UNHANDLED_REJECTION, noop)) { | |
| if (!isEventSupported(window, DOM_EVENT.UNHANDLED_REJECTION, noop)) { |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48f1282cc2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d6d99ef to
a076a34
Compare
a076a34 to
0fe7170
Compare

Motivation
Make the SDK not crash when instrumenting in Salesforce lightning environments.
Changes
You can review commit by commit.
First commit
Adds a new
browser-rum-salesforceprivate package. It usesrum-slimand contains set up instructions for customers.Second commit.
Adds the support on the SDK so it not crashes on LWC environment.
The main idea of this is to use
isEventSupportedto patch the 3 listeners LWC does not support and make the SDK crash. By usingisEventSupportedwe can try to assign the listener and it fails safely.We do this check on 3 things:
change event of CookieStore,unhandledrejection eventandsecuritypolicyviolation event listenerThe other 2 changes is to safely access
globalObject.locationinstead of justlocationper Salesforce docs.Test instructions
Don't forget to make in the Dev Extension:
Event collection strategytoRequestsLightning application URL
Username: 1780401668150_test-avrjsf381uzm@example.com
Password: Ufv7@chnbkeqmdssfjfn
Experience Cloud URL
Checklist