-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into aymeric/page-lifecycle
- Loading branch information
Showing
31 changed files
with
801 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
variables: | ||
CURRENT_STAGING: staging-19 | ||
CURRENT_STAGING: staging-20 | ||
APP: 'browser-sdk' | ||
CURRENT_CI_IMAGE: 45 | ||
CURRENT_CI_IMAGE: 46 | ||
BUILD_STABLE_REGISTRY: '486234852809.dkr.ecr.us-east-1.amazonaws.com' | ||
CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE' | ||
GIT_REPOSITORY: '[email protected]:DataDog/browser-sdk.git' | ||
MAIN_BRANCH: 'main' | ||
CHROME_PACKAGE_VERSION: 112.0.5615.49-1 | ||
CHROME_DRIVER_VERSION: 112.0.5615.28 | ||
CHROME_PACKAGE_VERSION: 113.0.5672.92-1 | ||
CHROME_DRIVER_VERSION: 113.0.5672.63 | ||
|
||
cache: | ||
key: | ||
|
@@ -271,7 +271,7 @@ deploy-prod-canary: | |
- node ./scripts/deploy/deploy.js prod canary root | ||
- node ./scripts/deploy/upload-source-maps.js canary root | ||
|
||
deploy-prod-all-dcs: | ||
.deploy-prod: | ||
stage: deploy | ||
extends: | ||
- .base-configuration | ||
|
@@ -283,25 +283,28 @@ deploy-prod-all-dcs: | |
- VERSION=$(node -p -e "require('./lerna.json').version") | ||
- yarn | ||
- yarn build:bundle | ||
- node ./scripts/deploy/deploy.js prod v${VERSION%%.*} us1,eu1,us3,us5,ap1 | ||
- node ./scripts/deploy/upload-source-maps.js v${VERSION%%.*} us1,eu1,us3,us5,ap1 | ||
- node ./scripts/deploy/deploy.js prod v${VERSION%%.*} $UPLOAD_PATH | ||
- node ./scripts/deploy/upload-source-maps.js v${VERSION%%.*} $UPLOAD_PATH | ||
|
||
deploy-prod-root: | ||
stage: deploy | ||
step-1_deploy-prod-minor-dcs: | ||
extends: | ||
- .base-configuration | ||
- .tags | ||
when: manual | ||
allow_failure: false | ||
script: | ||
- export BUILD_MODE=release | ||
- VERSION=$(node -p -e "require('./lerna.json').version") | ||
- yarn | ||
- yarn build:bundle | ||
- node ./scripts/deploy/deploy.js prod v${VERSION%%.*} root | ||
- node ./scripts/deploy/upload-source-maps.js v${VERSION%%.*} root | ||
- .deploy-prod | ||
variables: | ||
UPLOAD_PATH: eu1,us3,us5,ap1 | ||
|
||
step-2_deploy-prod-us1: | ||
extends: | ||
- .deploy-prod | ||
variables: | ||
UPLOAD_PATH: us1 | ||
|
||
publish-npm: | ||
step-3_deploy-prod-root: | ||
extends: | ||
- .deploy-prod | ||
variables: | ||
UPLOAD_PATH: root | ||
|
||
step-4_publish-npm: | ||
stage: deploy | ||
extends: | ||
- .base-configuration | ||
|
@@ -489,6 +492,7 @@ bump-chrome-version-scheduled: | |
before_script: | ||
- eval $(ssh-agent -s) | ||
script: | ||
- yarn | ||
- node scripts/test/bump-chrome-driver-version.js | ||
artifacts: | ||
reports: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { ReactNode } from 'react' | ||
import React from 'react' | ||
import { Alert as MantineAlert, Center, Group, MantineProvider, Space } from '@mantine/core' | ||
|
||
export function Alert({ | ||
level, | ||
title, | ||
message, | ||
button, | ||
}: { | ||
level: 'warning' | 'error' | ||
title?: string | ||
message: string | ||
button?: ReactNode | ||
}) { | ||
const color = level === 'warning' ? ('orange' as const) : ('red' as const) | ||
return ( | ||
<Center mt="xl"> | ||
<MantineAlert color={color} title={title}> | ||
{message} | ||
{button && ( | ||
<> | ||
<Space h="sm" /> | ||
<MantineProvider theme={{ components: { Button: { defaultProps: { color } } } }}> | ||
<Group position="right">{button}</Group> | ||
</MantineProvider> | ||
</> | ||
)} | ||
</MantineAlert> | ||
</Center> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
developer-extension/src/panel/components/tabs/replayTab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Box, Button } from '@mantine/core' | ||
import React, { useEffect, useRef, useState } from 'react' | ||
import { TabBase } from '../tabBase' | ||
import type { SessionReplayPlayerStatus } from '../../sessionReplayPlayer/startSessionReplayPlayer' | ||
import { startSessionReplayPlayer } from '../../sessionReplayPlayer/startSessionReplayPlayer' | ||
import { evalInWindow } from '../../evalInWindow' | ||
import { createLogger } from '../../../common/logger' | ||
import { Alert } from '../alert' | ||
import { useSdkInfos } from '../../hooks/useSdkInfos' | ||
|
||
const logger = createLogger('replayTab') | ||
|
||
export function ReplayTab() { | ||
const infos = useSdkInfos() | ||
if (!infos) { | ||
return <Alert level="error" message="No RUM SDK present in the page." /> | ||
} | ||
|
||
if (!infos.cookie?.rum) { | ||
return <Alert level="error" message="No RUM session." /> | ||
} | ||
|
||
if (infos.cookie.rum === '0') { | ||
return <Alert level="error" message="RUM session sampled out." /> | ||
} | ||
|
||
if (infos.cookie.rum === '2') { | ||
return <Alert level="error" message="RUM session plan does not include replay." /> | ||
} | ||
|
||
return <Player /> | ||
} | ||
|
||
function Player() { | ||
const frameRef = useRef<HTMLIFrameElement | null>(null) | ||
const [playerStatus, setPlayerStatus] = useState<SessionReplayPlayerStatus>('loading') | ||
|
||
useEffect(() => { | ||
startSessionReplayPlayer(frameRef.current!, setPlayerStatus) | ||
}, []) | ||
|
||
return ( | ||
<TabBase> | ||
<Box | ||
component="iframe" | ||
ref={frameRef} | ||
sx={{ | ||
height: '100%', | ||
width: '100%', | ||
display: playerStatus === 'ready' ? 'block' : 'none', | ||
border: 'none', | ||
}} | ||
></Box> | ||
{playerStatus === 'waiting-for-full-snapshot' && <WaitingForFullSnapshot />} | ||
</TabBase> | ||
) | ||
} | ||
|
||
function WaitingForFullSnapshot() { | ||
return ( | ||
<Alert | ||
level="warning" | ||
message="Waiting for a full snapshot to be generated..." | ||
button={ | ||
<Button onClick={generateFullSnapshot} color="orange"> | ||
Generate Full Snapshot | ||
</Button> | ||
} | ||
/> | ||
) | ||
} | ||
|
||
function generateFullSnapshot() { | ||
// Restart to make sure we have a fresh Full Snapshot | ||
evalInWindow(` | ||
DD_RUM.stopSessionReplayRecording() | ||
DD_RUM.startSessionReplayRecording() | ||
`).catch((error) => { | ||
logger.error('While restarting recording:', error) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.