Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5dadb50
Add new Browser-rum-salesforce package
BeltranBulbarellaDD Jun 4, 2026
8c6cd15
Add support for Salesforce LWS
BeltranBulbarellaDD Jun 4, 2026
48f1282
Address comments from review
BeltranBulbarellaDD Jun 4, 2026
0fe7170
Address comments from Codex
BeltranBulbarellaDD Jun 4, 2026
ecbb855
Add unit tests
BeltranBulbarellaDD Jun 8, 2026
d9b95ba
Address location change observable comments
BeltranBulbarellaDD Jun 9, 2026
a55b33f
Make window optional in globalObject
BeltranBulbarellaDD Jun 9, 2026
3355032
Fix format and codex reviews
BeltranBulbarellaDD Jun 9, 2026
aa6f784
Fix linter
BeltranBulbarellaDD Jun 9, 2026
b260896
Initialize sf-lwc-app test app with eslint and prettier ignored
BeltranBulbarellaDD Jun 10, 2026
a742145
Add minimal LWC app for testing (Navigation, views, actions, resource…
BeltranBulbarellaDD Jun 10, 2026
14362c2
Merge branch 'main' into salesforce/add-e2e-tests_2
BeltranBulbarellaDD Jun 10, 2026
dfab355
fix: build, woke, home url in console output
BeltranBulbarellaDD Jun 10, 2026
93e8012
fix: rename sample json api url
BeltranBulbarellaDD Jun 10, 2026
1e47d83
Format SF html files. Add data-testid
BeltranBulbarellaDD Jun 11, 2026
e71a4dc
remove allowed tracing urls
BeltranBulbarellaDD Jun 11, 2026
dd7c95f
Cleanup unused code and files
BeltranBulbarellaDD Jun 24, 2026
d32e6bf
Merge branch 'main' into salesforce/add-e2e-tests_2
BeltranBulbarellaDD Jun 24, 2026
9565382
Remove unused code
BeltranBulbarellaDD Jun 24, 2026
a5f06b4
Use query params for Datadog RUM config
BeltranBulbarellaDD Jun 24, 2026
7c535a0
Clean up Datadog RUM URL parameters, don't initialize RUM if not conf…
BeltranBulbarellaDD Jun 24, 2026
33581fd
chore: remove accidental rum-events-format gitlink
BeltranBulbarellaDD Jun 24, 2026
0560c00
Address codex comments
BeltranBulbarellaDD Jun 24, 2026
07a08a2
reuse cleanUrl function
BeltranBulbarellaDD Jun 26, 2026
4175f81
Fix cleanUrl function
BeltranBulbarellaDD Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yarn.lock
/generated-docs
/developer-extension/.output
/developer-extension/.wxt
/test/apps/sf-lwc-app/*

# Auto-generated by API Extractor — do not format
/packages/js-core/api
Expand Down
1 change: 1 addition & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default defineConfig(
'test/apps/vue-router-v4-app',
'test/apps/nuxt-app',
'test/apps/nuxt-vue-router-v4-app',
'test/apps/sf-lwc-app',
'sandbox',
'coverage',
'.yarn',
Expand Down
3 changes: 3 additions & 0 deletions test/apps/sf-lwc-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.sf
.sfdx
/force-app/main/default/staticresources/datadog_rum_slim.js
24 changes: 24 additions & 0 deletions test/apps/sf-lwc-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SF LWC App

Salesforce DX project used to exercise browser-sdk behavior in a real Lightning Web Components runtime.

This app is Lightning-only.

## What It Contains

- A Lightning app named `SF LWC App`
- A trimmed Home page with Datadog test controls
- A `Product Explorer` app page with three hardcoded editable products
- `c:datadogInit` in the utility bar, backed by the `datadog_rum_slim` static resource

## Deploy

From this directory:

```sh
yarn run setup -o engrumdev --ignore-conflicts
```

The setup script copies the local RUM slim bundle into the static resource, deploys the app, assigns the app permission set to the target user, and prints the app-specific Home URL.

If prompted for a user. Log into 1Password and use `beltran.bulbarella@datadoghq.com.engrumdev`
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>Tab</actionName>
<content>SF_LWC_App_Home</content>
<formFactor>Large</formFactor>
<type>Flexipage</type>
<pageOrSobjectType>standard-home</pageOrSobjectType>
</actionOverrides>
<formFactors>Large</formFactors>
<label>SF LWC App</label>
<navType>Standard</navType>
<tabs>standard-home</tabs>
<tabs>Product_Explorer</tabs>
<uiType>Lightning</uiType>
<utilityBar>SF_LWC_App_UtilityBar</utilityBar>
</CustomApplication>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CspTrustedSite xmlns="http://soap.sforce.com/2006/04/metadata">
<canAccessCamera>false</canAccessCamera>
<canAccessMicrophone>false</canAccessMicrophone>
<context>All</context>
<description>Datadog browser RUM intake for US1</description>
<endpointUrl>https://browser-intake-datadoghq.com</endpointUrl>
<isActive>true</isActive>
<isApplicableToConnectSrc>true</isApplicableToConnectSrc>
</CspTrustedSite>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
<flexiPageRegions>
<itemInstances>
<componentInstance>
<componentName>productExplorer</componentName>
<identifier>productExplorer</identifier>
</componentInstance>
</itemInstances>
<name>main</name>
<type>Region</type>
</flexiPageRegions>
<masterLabel>Product Explorer</masterLabel>
<template>
<name>flexipage:defaultAppHomeTemplate</name>
</template>
<type>AppPage</type>
</FlexiPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
<flexiPageRegions>
<itemInstances>
<componentInstance>
<componentName>customActionButtons</componentName>
Comment thread
BeltranBulbarellaDD marked this conversation as resolved.
<identifier>customActionButtons</identifier>
</componentInstance>
</itemInstances>
<name>top</name>
<type>Region</type>
</flexiPageRegions>
<masterLabel>SF LWC App Home</masterLabel>
<template>
<name>home:desktopTemplate</name>
</template>
<type>HomePage</type>
</FlexiPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
<flexiPageRegions>
<itemInstances>
<componentInstance>
<componentInstanceProperties>
<name>eager</name>
<type>decorator</type>
<value>true</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>label</name>
<type>decorator</type>
<value>Datadog Init</value>
</componentInstanceProperties>
<componentName>datadogInit</componentName>
<identifier>datadogInit</identifier>
</componentInstance>
</itemInstances>
<name>utilityItems</name>
<type>Region</type>
</flexiPageRegions>
<masterLabel>SF LWC App UtilityBar</masterLabel>
<template>
<name>one:utilityBarTemplateDesktop</name>
</template>
<type>UtilityBar</type>
</FlexiPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<template>
<section data-testid="home-custom-actions">
<div>
<h2>Datadog Custom Actions</h2>
<p>Use these buttons to send manual RUM custom actions from the home page.</p>
</div>
<div>
<lightning-button
label="Custom Action 1"
variant="brand"
data-action-name="custom action 1"
data-testid="custom-action-1"
onclick="{handleActionClick}"
Comment thread
BeltranBulbarellaDD marked this conversation as resolved.
></lightning-button>
<lightning-button
label="Custom Action 2"
variant="neutral"
data-action-name="custom action 2"
onclick="{handleActionClick}"
></lightning-button>
</div>
<template lwc:if="{lastActionName}">
<p>Last sent: {lastActionName}</p>
</template>
</section>
<section>
<div>
<h2>Datadog Custom Errors</h2>
<p>Use these buttons to send manual RUM custom errors from the home page.</p>
</div>
<div>
<lightning-button
label="Custom Error 1"
variant="destructive"
data-error-name="custom error 1"
data-testid="custom-error-1"
onclick="{handleErrorClick}"
></lightning-button>
<lightning-button
label="Custom Error 2"
variant="destructive-text"
data-error-name="custom error 2"
onclick="{handleErrorClick}"
></lightning-button>
</div>
<template lwc:if="{lastErrorName}">
<p>Last sent: {lastErrorName}</p>
</template>
</section>
<section>
<div>
<h2>Datadog Runtime Errors</h2>
<p>Use this button to trigger an unhandled error that should be captured via window.onerror.</p>
</div>
<div>
<lightning-button
label="Runtime Error"
variant="destructive"
onclick="{handleRuntimeErrorClick}"
></lightning-button>
</div>
</section>
<section>
<div>
<h2>Datadog Long Tasks</h2>
<p>Blocks the main thread to generate a long_task RUM event.</p>
</div>
<div>
<lightning-button
label="Long Task"
variant="brand"
data-testid="long-task"
onclick="{handleLongTaskClick}"
></lightning-button>
</div>
</section>
<section>
<div>
<h2>Datadog Vitals</h2>
<p>Add Duration Vital and Start/Stop Vital use the DD_RUM vitals API directly.</p>
</div>
<div>
<lightning-button
label="Add Duration Vital"
variant="brand"
onclick="{handleAddDurationVitalClick}"
></lightning-button>
<lightning-button
label="Start/Stop Vital"
variant="brand"
onclick="{handleStartStopVitalClick}"
></lightning-button>
</div>
</section>
<section>
<div>
<h2>Datadog Resources</h2>
<p>Use these buttons to generate resource timing entries for fetch and XHR.</p>
</div>
<div>
<lightning-button
label="Fetch Resource"
variant="brand"
onclick="{handleFetchResourceClick}"
></lightning-button>
<lightning-button
label="XHR Resource"
variant="brand"
onclick="{handleXhrResourceClick}"
></lightning-button>
</div>
<template lwc:if="{lastResourceName}">
<p>Last requested: {lastResourceName}</p>
</template>
</section>
<section>
<div>
<h2>Datadog Selector Probe</h2>
<p>Use this button to compare the LWC internal click target with the automatic RUM click selector.</p>
</div>
<div>
<button
data-dd-action-name="inner selector probe button"
data-testid="inner-selector-probe-button"
onclick="{handleSelectorProbeClick}"
style="margin: 0.75rem 0; padding: 0.25rem 0.75rem"
>
Inner Selector Probe
</button>
</div>
<template lwc:if="{lastSelectorProbe}">
<p>Last probe: {lastSelectorProbe}</p>
</template>
</section>
</template>
Loading
Loading