From db517f89ce83f101fc42532c95a04a5cdd6b275b Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> Date: Fri, 8 Aug 2025 20:30:12 +0000 Subject: [PATCH 01/33] rename all packages for mixpanel distribution --- .changeset/config.json | 38 +- package.json | 8 +- packages/all/package.json | 2 +- packages/packer/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../rrweb-plugin-console-record/package.json | 2 +- .../rrweb-plugin-console-replay/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/record/package.json | 2 +- packages/replay/package.json | 2 +- packages/rrdom-nodejs/package.json | 2 +- packages/rrdom/package.json | 2 +- packages/rrvideo/package.json | 2 +- .../rrweb-player/.svelte-kit/ambient.d.ts | 324 ++++++------------ packages/rrweb-player/package.json | 2 +- packages/rrweb-snapshot/package.json | 2 +- packages/rrweb/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- packages/web-extension/package.json | 2 +- 22 files changed, 144 insertions(+), 264 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index 89ad04bbc7..30fae511f1 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,25 +4,25 @@ "commit": false, "fixed": [ [ - "rrweb", - "rrweb-snapshot", - "rrdom", - "rrdom-nodejs", - "rrweb-player", - "@rrweb/all", - "@rrweb/replay", - "@rrweb/record", - "@rrweb/types", - "@rrweb/packer", - "@rrweb/utils", - "@rrweb/web-extension", - "rrvideo", - "@rrweb/rrweb-plugin-console-record", - "@rrweb/rrweb-plugin-console-replay", - "@rrweb/rrweb-plugin-sequential-id-record", - "@rrweb/rrweb-plugin-sequential-id-replay", - "@rrweb/rrweb-plugin-canvas-webrtc-record", - "@rrweb/rrweb-plugin-canvas-webrtc-replay" + "@mixpanel/rrweb", + "@mixpanel/rrweb-snapshot", + "@mixpanel/rrdom", + "@mixpanel/rrdom-nodejs", + "@mixpanel/rrweb-player", + "@mixpanel/all", + "@mixpanel/replay", + "@mixpanel/record", + "@mixpanel/types", + "@mixpanel/packer", + "@mixpanel/utils", + "@mixpanel/web-extension", + "@mixpanel/rrvideo", + "@mixpanel/rrweb-plugin-console-record", + "@mixpanel/rrweb-plugin-console-replay", + "@mixpanel/rrweb-plugin-sequential-id-record", + "@mixpanel/rrweb-plugin-sequential-id-replay", + "@mixpanel/rrweb-plugin-canvas-webrtc-record", + "@mixpanel/rrweb-plugin-canvas-webrtc-replay" ] ], "linked": [], diff --git a/package.json b/package.json index 60e7b9e5b9..e844f868f9 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "@rrweb/_monorepo", + "name": "@mixpanel/rrweb", "description": "record and replay the web", "repository": { "type": "git", - "url": "git+ssh://git@github.com/rrweb-io/rrweb.git" + "url": "git+ssh://git@github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb" @@ -11,10 +11,10 @@ "author": "yanzhen@smartx.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "private": true, - "homepage": "https://github.com/rrweb-io/rrweb#readme", + "homepage": "https://github.com/mixpanel/rrweb#readme", "workspaces": [ "packages/*", "packages/plugins/*" diff --git a/packages/all/package.json b/packages/all/package.json index 6aa8256457..aae0c85f42 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/all", + "name": "@mixpanel/all", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" diff --git a/packages/packer/package.json b/packages/packer/package.json index c4595a4e87..4061ef39ae 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/packer", + "name": "@mixpanel/packer", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index c5c0c38e29..751b11af71 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/rrweb-plugin-canvas-webrtc-record", + "name": "@mixpanel/rrweb-plugin-canvas-webrtc-record", "version": "2.0.0-alpha.18", "description": "", "type": "module", diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index 901039cf78..c19bbf3fe6 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/rrweb-plugin-canvas-webrtc-replay", + "name": "@mixpanel/rrweb-plugin-canvas-webrtc-replay", "version": "2.0.0-alpha.18", "description": "", "type": "module", diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index 07897f39dd..789d49097f 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/rrweb-plugin-console-record", + "name": "@mixpanel/rrweb-plugin-console-record", "version": "2.0.0-alpha.18", "description": "", "type": "module", diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index 2484fd7eb4..a99ea39318 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/rrweb-plugin-console-replay", + "name": "@mixpanel/rrweb-plugin-console-replay", "version": "2.0.0-alpha.18", "description": "", "type": "module", diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index dc3fc37a15..784de6a602 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/rrweb-plugin-sequential-id-record", + "name": "@mixpanel/rrweb-plugin-sequential-id-record", "version": "2.0.0-alpha.18", "description": "", "type": "module", diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index 0538a6db52..6700c41e0d 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/rrweb-plugin-sequential-id-replay", + "name": "@mixpanel/rrweb-plugin-sequential-id-replay", "version": "2.0.0-alpha.18", "description": "", "type": "module", diff --git a/packages/record/package.json b/packages/record/package.json index 6b1d244d6f..badd6d5848 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/record", + "name": "@mixpanel/record", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" diff --git a/packages/replay/package.json b/packages/replay/package.json index 5c9d3f44e9..d1215f4304 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/replay", + "name": "@mixpanel/replay", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index 455c317a7c..5fe1f2656e 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -1,5 +1,5 @@ { - "name": "rrdom-nodejs", + "name": "@mixpanel/rrdom-nodejs", "version": "2.0.0-alpha.18", "scripts": { "dev": "vite build --watch", diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index 9657f17209..90bb9038c0 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,5 +1,5 @@ { - "name": "rrdom", + "name": "@mixpanel/rrdom", "version": "2.0.0-alpha.18", "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index 996184dee2..ef376cebe0 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,5 +1,5 @@ { - "name": "rrvideo", + "name": "@mixpanel/rrvideo", "version": "2.0.0-alpha.18", "description": "transform rrweb session into video", "main": "build/index.js", diff --git a/packages/rrweb-player/.svelte-kit/ambient.d.ts b/packages/rrweb-player/.svelte-kit/ambient.d.ts index 436172dd51..66489477b3 100644 --- a/packages/rrweb-player/.svelte-kit/ambient.d.ts +++ b/packages/rrweb-player/.svelte-kit/ambient.d.ts @@ -26,16 +26,16 @@ * ``` */ declare module '$env/static/private' { - export const GITHUB_STATE: string; - export const GIT_CLONE_PROTECTION_ACTIVE: string; + export const PYENV_VIRTUALENV_INIT: string; + export const ANTHROPIC_VERTEX_PROJECT_ID: string; + export const LESSOPEN: string; export const npm_package_scripts_test_cross_platform_build: string; export const npm_package_devDependencies_rollup: string; export const npm_package_devDependencies__types_node: string; - export const STATS_TRP: string; - export const DEPLOYMENT_BASEPATH: string; - export const DOTNET_NOLOGO: string; export const npm_package_devDependencies_vitest: string; + export const TFLINT_OPA_POLICY_DIR: string; export const USER: string; + export const SSH_CLIENT: string; export const npm_package_bin_svelte_kit: string; export const npm_package_dependencies_sirv: string; export const npm_package_dependencies_sade: string; @@ -43,200 +43,140 @@ declare module '$env/static/private' { export const npm_package_dependencies_magic_string: string; export const npm_config_version_commit_hooks: string; export const npm_config_user_agent: string; - export const CI: string; export const npm_package_scripts_generate_version: string; export const npm_package_dependencies__types_cookie: string; export const npm_config_bin_links: string; - export const RUNNER_ENVIRONMENT: string; - export const GITHUB_ENV: string; - export const PIPX_HOME: string; + export const CHRONOSPHERE_ORG_NAME: string; + export const XDG_SESSION_TYPE: string; + export const GIT_ASKPASS: string; export const npm_node_execpath: string; export const npm_package_devDependencies_vite: string; export const npm_package_devDependencies__sveltejs_vite_plugin_svelte: string; export const npm_config_init_version: string; - export const JAVA_HOME_8_X64: string; export const SHLVL: string; + export const BROWSER: string; export const npm_package_exports___node_types: string; export const npm_package_files_0: string; + export const GO15VENDOREXPERIMENT: string; export const HOME: string; + export const OLDPWD: string; export const npm_package_files_1: string; export const npm_package_repository_directory: string; - export const RUNNER_TEMP: string; - export const GITHUB_EVENT_PATH: string; + export const SKIP_PUPPETEER_DOWNLOAD: string; + export const TERM_PROGRAM_VERSION: string; + export const VSCODE_IPC_HOOK_CLI: string; export const npm_package_files_2: string; - export const JAVA_HOME_11_X64: string; - export const PIPX_BIN_DIR: string; - export const GITHUB_REPOSITORY_OWNER: string; + export const PYENV_SHELL: string; + export const BASH_DEFAULT_TIMEOUT_MS: string; export const npm_package_engines_node: string; export const npm_package_exports___vite_import: string; export const npm_package_files_3: string; export const npm_package_devDependencies_svelte_preprocess: string; export const npm_config_init_license: string; - export const GRADLE_HOME: string; - export const ANDROID_NDK_LATEST_HOME: string; - export const JAVA_HOME_21_X64: string; - export const STATS_RDCL: string; - export const GITHUB_RETENTION_DAYS: string; + export const NODE_OPTIONS: string; + export const VSCODE_GIT_ASKPASS_MAIN: string; export const npm_package_files_4: string; export const npm_config_version_tag_prefix: string; - export const GITHUB_REPOSITORY_OWNER_ID: string; - export const POWERSHELL_DISTRIBUTION_CHANNEL: string; - export const AZURE_EXTENSION_DIR: string; - export const GITHUB_HEAD_REF: string; + export const VSCODE_GIT_ASKPASS_NODE: string; + export const SSL_CERT_FILE: string; export const npm_package_scripts_check: string; export const npm_package_files_5: string; export const npm_package_dependencies_tiny_glob: string; - export const SYSTEMD_EXEC_PID: string; + export const NEW_MACHINE: string; + export const GH_NO_UPDATE_NOTIFIER: string; + export const DBUS_SESSION_BUS_ADDRESS: string; export const npm_package_scripts_postinstall: string; export const npm_package_files_6: string; - export const GITHUB_GRAPHQL_URL: string; + export const COLORTERM: string; + export const GOOGLE_APPLICATION_CREDENTIALS: string; export const npm_package_devDependencies_typescript: string; export const npm_package_devDependencies__types_connect: string; export const npm_package_description: string; - export const GOROOT_1_20_X64: string; - export const NVM_DIR: string; + export const DEBUGINFOD_URLS: string; export const npm_package_readmeFilename: string; export const npm_package_types: string; export const npm_package_homepage: string; - export const DOTNET_SKIP_FIRST_TIME_EXPERIENCE: string; - export const GOROOT_1_21_X64: string; - export const JAVA_HOME_17_X64: string; - export const ImageVersion: string; + export const USE_GKE_GCLOUD_AUTH_PLUGIN: string; export const npm_package_exports___hooks_types: string; export const npm_package_devDependencies__playwright_test: string; - export const RUNNER_OS: string; - export const GITHUB_API_URL: string; - export const GOROOT_1_22_X64: string; - export const SWIFT_PATH: string; + export const LOGNAME: string; export const npm_package_type: string; - export const RUNNER_USER: string; - export const STATS_V3PS: string; - export const CHROMEWEBDRIVER: string; - export const JOURNAL_STREAM: string; - export const GITHUB_WORKFLOW: string; + export const CLAUDE_CODE_USE_VERTEX: string; export const _: string; + export const XDG_SESSION_CLASS: string; export const npm_package_scripts_lint: string; export const npm_config_registry: string; - export const ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: string; - export const STATS_D: string; - export const GITHUB_RUN_ID: string; - export const STATS_VMFE: string; - export const GITHUB_REF_TYPE: string; - export const BOOTSTRAP_HASKELL_NONINTERACTIVE: string; - export const GITHUB_WORKFLOW_SHA: string; - export const GITHUB_BASE_REF: string; - export const ImageOS: string; + export const TERM: string; + export const XDG_SESSION_ID: string; + export const CLOUD_ML_REGION: string; export const npm_package_exports___import: string; export const npm_package_devDependencies_dts_buddy: string; export const npm_package_dependencies_kleur: string; export const npm_package_dependencies_devalue: string; export const npm_config_ignore_scripts: string; - export const GITHUB_WORKFLOW_REF: string; - export const PERFLOG_LOCATION_SETTING: string; - export const GITHUB_ACTION_REPOSITORY: string; export const npm_package_exports___package_json: string; export const npm_package_peerDependencies_svelte: string; export const PATH: string; export const NODE: string; - export const ANT_HOME: string; - export const DOTNET_MULTILEVEL_LOOKUP: string; - export const RUNNER_TRACKING_ID: string; - export const INVOCATION_ID: string; - export const RUNNER_TOOL_CACHE: string; export const npm_package_repository_type: string; export const npm_package_name: string; - export const GITHUB_ACTION: string; - export const GITHUB_RUN_NUMBER: string; - export const GITHUB_TRIGGERING_ACTOR: string; - export const RUNNER_ARCH: string; export const XDG_RUNTIME_DIR: string; - export const AGENT_TOOLSDIRECTORY: string; export const npm_package_scripts_test_integration: string; export const npm_package_exports___node_polyfills_import: string; export const npm_package_devDependencies__types_set_cookie_parser: string; + export const DEVBOX: string; + export const SSL_CERT_DIR: string; export const npm_package_scripts_test_unit: string; export const npm_package_exports___vite_types: string; export const npm_config_ignore_path: string; export const LANG: string; - export const VCPKG_INSTALLATION_ROOT: string; - export const CONDA: string; - export const RUNNER_NAME: string; - export const XDG_CONFIG_HOME: string; - export const STATS_VMD: string; - export const GITHUB_REF_NAME: string; - export const GITHUB_REPOSITORY: string; - export const STATS_D_D: string; + export const LS_COLORS: string; + export const VSCODE_GIT_IPC_HANDLE: string; + export const TERM_PROGRAM: string; export const npm_lifecycle_script: string; export const npm_package_scripts_test_cross_platform_dev: string; - export const STATS_UE: string; - export const ANDROID_NDK_ROOT: string; - export const GITHUB_ACTION_REF: string; - export const DEBIAN_FRONTEND: string; + export const SSH_AUTH_SOCK: string; export const npm_package_scripts_test: string; export const npm_package_dependencies_esm_env: string; export const npm_config_version_git_message: string; - export const GITHUB_REPOSITORY_ID: string; - export const GITHUB_ACTIONS: string; + export const SHELL: string; + export const GITHUB_PERSONAL_ACCESS_TOKEN: string; + export const GOPATH: string; export const npm_lifecycle_event: string; export const npm_package_repository_url: string; export const npm_package_version: string; - export const GITHUB_REF_PROTECTED: string; + export const PYENV_VIRTUALENV_DISABLE_PROMPT: string; export const npm_config_argv: string; export const npm_package_scripts_generate_types: string; export const npm_package_scripts_check_all: string; export const npm_package_devDependencies_svelte: string; export const npm_package_dependencies_cookie: string; - export const GITHUB_WORKSPACE: string; - export const ACCEPT_EULA: string; - export const GITHUB_JOB: string; - export const RUNNER_PERFLOG: string; + export const LESSCLOSE: string; export const YARN_IGNORE_PATH: string; export const npm_package_exports___node_import: string; - export const GITHUB_SHA: string; - export const GITHUB_RUN_ATTEMPT: string; export const npm_package_devDependencies__types_sade: string; export const npm_config_version_git_tag: string; export const npm_config_version_git_sign: string; - export const GITHUB_REF: string; - export const GITHUB_ACTOR: string; - export const ANDROID_SDK_ROOT: string; export const npm_package_license: string; export const npm_config_strict_ssl: string; - export const LEIN_HOME: string; + export const VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; export const npm_package_scripts_format: string; - export const GITHUB_PATH: string; - export const JAVA_HOME: string; export const PWD: string; - export const GITHUB_ACTOR_ID: string; - export const RUNNER_WORKSPACE: string; + export const GCP_DEVBOX: string; export const npm_execpath: string; export const npm_package_dependencies_set_cookie_parser: string; - export const HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: string; - export const STATS_TIS: string; - export const GITHUB_EVENT_NAME: string; - export const HOMEBREW_NO_AUTO_UPDATE: string; - export const ANDROID_HOME: string; - export const GITHUB_SERVER_URL: string; - export const GECKOWEBDRIVER: string; - export const LEIN_JAR: string; - export const GHCUP_INSTALL_BASE_PREFIX: string; - export const GITHUB_OUTPUT: string; + export const VIRTUAL_ENV_DISABLE_PROMPT: string; + export const SSH_CONNECTION: string; + export const PYENV_ROOT: string; + export const XDG_DATA_DIRS: string; export const npm_package_exports___types: string; - export const EDGEWEBDRIVER: string; - export const STATS_EXT: string; export const npm_package_peerDependencies_vite: string; export const npm_package_peerDependencies__sveltejs_vite_plugin_svelte: string; export const npm_config_save_prefix: string; export const npm_config_ignore_optional: string; - export const ANDROID_NDK: string; - export const SGX_AESM_ADDR: string; - export const CHROME_BIN: string; - export const SELENIUM_JAR_PATH: string; - export const STATS_EXTP: string; + export const MANPATH: string; export const npm_package_exports___node_polyfills_types: string; export const INIT_CWD: string; - export const ANDROID_NDK_HOME: string; - export const GITHUB_STEP_SUMMARY: string; export const npm_package_exports___hooks_import: string; export const npm_package_dependencies_import_meta_resolve: string; } @@ -270,16 +210,16 @@ declare module '$env/static/public' { */ declare module '$env/dynamic/private' { export const env: { - GITHUB_STATE: string; - GIT_CLONE_PROTECTION_ACTIVE: string; + PYENV_VIRTUALENV_INIT: string; + ANTHROPIC_VERTEX_PROJECT_ID: string; + LESSOPEN: string; npm_package_scripts_test_cross_platform_build: string; npm_package_devDependencies_rollup: string; npm_package_devDependencies__types_node: string; - STATS_TRP: string; - DEPLOYMENT_BASEPATH: string; - DOTNET_NOLOGO: string; npm_package_devDependencies_vitest: string; + TFLINT_OPA_POLICY_DIR: string; USER: string; + SSH_CLIENT: string; npm_package_bin_svelte_kit: string; npm_package_dependencies_sirv: string; npm_package_dependencies_sade: string; @@ -287,200 +227,140 @@ declare module '$env/dynamic/private' { npm_package_dependencies_magic_string: string; npm_config_version_commit_hooks: string; npm_config_user_agent: string; - CI: string; npm_package_scripts_generate_version: string; npm_package_dependencies__types_cookie: string; npm_config_bin_links: string; - RUNNER_ENVIRONMENT: string; - GITHUB_ENV: string; - PIPX_HOME: string; + CHRONOSPHERE_ORG_NAME: string; + XDG_SESSION_TYPE: string; + GIT_ASKPASS: string; npm_node_execpath: string; npm_package_devDependencies_vite: string; npm_package_devDependencies__sveltejs_vite_plugin_svelte: string; npm_config_init_version: string; - JAVA_HOME_8_X64: string; SHLVL: string; + BROWSER: string; npm_package_exports___node_types: string; npm_package_files_0: string; + GO15VENDOREXPERIMENT: string; HOME: string; + OLDPWD: string; npm_package_files_1: string; npm_package_repository_directory: string; - RUNNER_TEMP: string; - GITHUB_EVENT_PATH: string; + SKIP_PUPPETEER_DOWNLOAD: string; + TERM_PROGRAM_VERSION: string; + VSCODE_IPC_HOOK_CLI: string; npm_package_files_2: string; - JAVA_HOME_11_X64: string; - PIPX_BIN_DIR: string; - GITHUB_REPOSITORY_OWNER: string; + PYENV_SHELL: string; + BASH_DEFAULT_TIMEOUT_MS: string; npm_package_engines_node: string; npm_package_exports___vite_import: string; npm_package_files_3: string; npm_package_devDependencies_svelte_preprocess: string; npm_config_init_license: string; - GRADLE_HOME: string; - ANDROID_NDK_LATEST_HOME: string; - JAVA_HOME_21_X64: string; - STATS_RDCL: string; - GITHUB_RETENTION_DAYS: string; + NODE_OPTIONS: string; + VSCODE_GIT_ASKPASS_MAIN: string; npm_package_files_4: string; npm_config_version_tag_prefix: string; - GITHUB_REPOSITORY_OWNER_ID: string; - POWERSHELL_DISTRIBUTION_CHANNEL: string; - AZURE_EXTENSION_DIR: string; - GITHUB_HEAD_REF: string; + VSCODE_GIT_ASKPASS_NODE: string; + SSL_CERT_FILE: string; npm_package_scripts_check: string; npm_package_files_5: string; npm_package_dependencies_tiny_glob: string; - SYSTEMD_EXEC_PID: string; + NEW_MACHINE: string; + GH_NO_UPDATE_NOTIFIER: string; + DBUS_SESSION_BUS_ADDRESS: string; npm_package_scripts_postinstall: string; npm_package_files_6: string; - GITHUB_GRAPHQL_URL: string; + COLORTERM: string; + GOOGLE_APPLICATION_CREDENTIALS: string; npm_package_devDependencies_typescript: string; npm_package_devDependencies__types_connect: string; npm_package_description: string; - GOROOT_1_20_X64: string; - NVM_DIR: string; + DEBUGINFOD_URLS: string; npm_package_readmeFilename: string; npm_package_types: string; npm_package_homepage: string; - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: string; - GOROOT_1_21_X64: string; - JAVA_HOME_17_X64: string; - ImageVersion: string; + USE_GKE_GCLOUD_AUTH_PLUGIN: string; npm_package_exports___hooks_types: string; npm_package_devDependencies__playwright_test: string; - RUNNER_OS: string; - GITHUB_API_URL: string; - GOROOT_1_22_X64: string; - SWIFT_PATH: string; + LOGNAME: string; npm_package_type: string; - RUNNER_USER: string; - STATS_V3PS: string; - CHROMEWEBDRIVER: string; - JOURNAL_STREAM: string; - GITHUB_WORKFLOW: string; + CLAUDE_CODE_USE_VERTEX: string; _: string; + XDG_SESSION_CLASS: string; npm_package_scripts_lint: string; npm_config_registry: string; - ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: string; - STATS_D: string; - GITHUB_RUN_ID: string; - STATS_VMFE: string; - GITHUB_REF_TYPE: string; - BOOTSTRAP_HASKELL_NONINTERACTIVE: string; - GITHUB_WORKFLOW_SHA: string; - GITHUB_BASE_REF: string; - ImageOS: string; + TERM: string; + XDG_SESSION_ID: string; + CLOUD_ML_REGION: string; npm_package_exports___import: string; npm_package_devDependencies_dts_buddy: string; npm_package_dependencies_kleur: string; npm_package_dependencies_devalue: string; npm_config_ignore_scripts: string; - GITHUB_WORKFLOW_REF: string; - PERFLOG_LOCATION_SETTING: string; - GITHUB_ACTION_REPOSITORY: string; npm_package_exports___package_json: string; npm_package_peerDependencies_svelte: string; PATH: string; NODE: string; - ANT_HOME: string; - DOTNET_MULTILEVEL_LOOKUP: string; - RUNNER_TRACKING_ID: string; - INVOCATION_ID: string; - RUNNER_TOOL_CACHE: string; npm_package_repository_type: string; npm_package_name: string; - GITHUB_ACTION: string; - GITHUB_RUN_NUMBER: string; - GITHUB_TRIGGERING_ACTOR: string; - RUNNER_ARCH: string; XDG_RUNTIME_DIR: string; - AGENT_TOOLSDIRECTORY: string; npm_package_scripts_test_integration: string; npm_package_exports___node_polyfills_import: string; npm_package_devDependencies__types_set_cookie_parser: string; + DEVBOX: string; + SSL_CERT_DIR: string; npm_package_scripts_test_unit: string; npm_package_exports___vite_types: string; npm_config_ignore_path: string; LANG: string; - VCPKG_INSTALLATION_ROOT: string; - CONDA: string; - RUNNER_NAME: string; - XDG_CONFIG_HOME: string; - STATS_VMD: string; - GITHUB_REF_NAME: string; - GITHUB_REPOSITORY: string; - STATS_D_D: string; + LS_COLORS: string; + VSCODE_GIT_IPC_HANDLE: string; + TERM_PROGRAM: string; npm_lifecycle_script: string; npm_package_scripts_test_cross_platform_dev: string; - STATS_UE: string; - ANDROID_NDK_ROOT: string; - GITHUB_ACTION_REF: string; - DEBIAN_FRONTEND: string; + SSH_AUTH_SOCK: string; npm_package_scripts_test: string; npm_package_dependencies_esm_env: string; npm_config_version_git_message: string; - GITHUB_REPOSITORY_ID: string; - GITHUB_ACTIONS: string; + SHELL: string; + GITHUB_PERSONAL_ACCESS_TOKEN: string; + GOPATH: string; npm_lifecycle_event: string; npm_package_repository_url: string; npm_package_version: string; - GITHUB_REF_PROTECTED: string; + PYENV_VIRTUALENV_DISABLE_PROMPT: string; npm_config_argv: string; npm_package_scripts_generate_types: string; npm_package_scripts_check_all: string; npm_package_devDependencies_svelte: string; npm_package_dependencies_cookie: string; - GITHUB_WORKSPACE: string; - ACCEPT_EULA: string; - GITHUB_JOB: string; - RUNNER_PERFLOG: string; + LESSCLOSE: string; YARN_IGNORE_PATH: string; npm_package_exports___node_import: string; - GITHUB_SHA: string; - GITHUB_RUN_ATTEMPT: string; npm_package_devDependencies__types_sade: string; npm_config_version_git_tag: string; npm_config_version_git_sign: string; - GITHUB_REF: string; - GITHUB_ACTOR: string; - ANDROID_SDK_ROOT: string; npm_package_license: string; npm_config_strict_ssl: string; - LEIN_HOME: string; + VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; npm_package_scripts_format: string; - GITHUB_PATH: string; - JAVA_HOME: string; PWD: string; - GITHUB_ACTOR_ID: string; - RUNNER_WORKSPACE: string; + GCP_DEVBOX: string; npm_execpath: string; npm_package_dependencies_set_cookie_parser: string; - HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: string; - STATS_TIS: string; - GITHUB_EVENT_NAME: string; - HOMEBREW_NO_AUTO_UPDATE: string; - ANDROID_HOME: string; - GITHUB_SERVER_URL: string; - GECKOWEBDRIVER: string; - LEIN_JAR: string; - GHCUP_INSTALL_BASE_PREFIX: string; - GITHUB_OUTPUT: string; + VIRTUAL_ENV_DISABLE_PROMPT: string; + SSH_CONNECTION: string; + PYENV_ROOT: string; + XDG_DATA_DIRS: string; npm_package_exports___types: string; - EDGEWEBDRIVER: string; - STATS_EXT: string; npm_package_peerDependencies_vite: string; npm_package_peerDependencies__sveltejs_vite_plugin_svelte: string; npm_config_save_prefix: string; npm_config_ignore_optional: string; - ANDROID_NDK: string; - SGX_AESM_ADDR: string; - CHROME_BIN: string; - SELENIUM_JAR_PATH: string; - STATS_EXTP: string; + MANPATH: string; npm_package_exports___node_polyfills_types: string; INIT_CWD: string; - ANDROID_NDK_HOME: string; - GITHUB_STEP_SUMMARY: string; npm_package_exports___hooks_import: string; npm_package_dependencies_import_meta_resolve: string; [key: `PUBLIC_${string}`]: undefined; diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index e9e7614bea..7ddbadf117 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,5 +1,5 @@ { - "name": "rrweb-player", + "name": "@mixpanel/rrweb-player", "version": "2.0.0-alpha.18", "devDependencies": { "@rrweb/types": "^2.0.0-alpha.18", diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 299384b2de..127be76b94 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,5 +1,5 @@ { - "name": "rrweb-snapshot", + "name": "@mixpanel/rrweb-snapshot", "version": "2.0.0-alpha.18", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index abb46b258e..66788ccdae 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,5 +1,5 @@ { - "name": "rrweb", + "name": "@mixpanel/rrweb", "version": "2.0.0-alpha.18", "description": "record and replay the web", "scripts": { diff --git a/packages/types/package.json b/packages/types/package.json index 8fce976d2e..c4f9926dfc 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/types", + "name": "@mixpanel/types", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" diff --git a/packages/utils/package.json b/packages/utils/package.json index 10f0141da1..a7c0f1d46f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/utils", + "name": "@mixpanel/rrweb-utils", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index f9f340a53c..f929ff5edc 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -1,5 +1,5 @@ { - "name": "@rrweb/web-extension", + "name": "@mixpanel/rrweb-web-extension", "private": true, "version": "2.0.0-alpha.18", "description": "The web extension of rrweb which helps to run rrweb on any website out of box", From 085ed074d9b3c05320b002494d3ffc822f0ae2d1 Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> Date: Fri, 8 Aug 2025 21:26:26 +0000 Subject: [PATCH 02/33] update references --- .changeset/config.json | 16 ++++++++-------- packages/all/package.json | 14 +++++++------- packages/packer/package.json | 10 +++++----- .../package.json | 10 +++++----- .../package.json | 10 +++++----- .../rrweb-plugin-console-record/package.json | 14 +++++++------- .../rrweb-plugin-console-replay/package.json | 12 ++++++------ .../package.json | 4 ++-- .../package.json | 6 +++--- packages/record/package.json | 14 +++++++------- packages/replay/package.json | 12 ++++++------ packages/rrdom-nodejs/package.json | 4 ++-- packages/rrdom/package.json | 10 +++++----- packages/rrvideo/package.json | 2 +- packages/rrweb-player/package.json | 6 +++--- packages/rrweb-snapshot/package.json | 10 +++++----- packages/rrweb/package.json | 14 +++++++------- packages/types/package.json | 8 ++++---- packages/utils/package.json | 6 +++--- packages/web-extension/package.json | 6 +++--- 20 files changed, 94 insertions(+), 94 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index 30fae511f1..839d290b43 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "rrweb-io/rrweb" }], + "changelog": ["@changesets/changelog-github", { "repo": "mixpanel/rrweb" }], "commit": false, "fixed": [ [ @@ -9,13 +9,13 @@ "@mixpanel/rrdom", "@mixpanel/rrdom-nodejs", "@mixpanel/rrweb-player", - "@mixpanel/all", - "@mixpanel/replay", - "@mixpanel/record", - "@mixpanel/types", - "@mixpanel/packer", - "@mixpanel/utils", - "@mixpanel/web-extension", + "@mixpanel/rrweb-all", + "@mixpanel/rrweb-replay", + "@mixpanel/rrweb-record", + "@mixpanel/rrweb-types", + "@mixpanel/rrweb-packer", + "@mixpanel/rrweb-utils", + "@mixpanel/rrweb-web-extension", "@mixpanel/rrvideo", "@mixpanel/rrweb-plugin-console-record", "@mixpanel/rrweb-plugin-console-replay", diff --git a/packages/all/package.json b/packages/all/package.json index aae0c85f42..26a1271f65 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,5 +1,5 @@ { - "name": "@mixpanel/all", + "name": "@mixpanel/rrweb-all", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" @@ -17,13 +17,13 @@ "prepublish": "tsc -noEmit && vite build", "lint": "yarn eslint src/**/*.ts" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/all#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/@rrweb/all#readme", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "license": "MIT", "type": "module", @@ -56,9 +56,9 @@ "typescript": "^5.4.5" }, "dependencies": { - "@rrweb/types": "^2.0.0-alpha.18", - "@rrweb/packer": "^2.0.0-alpha.18", - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", + "@mixpanel/rrweb-packer": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18" }, "browserslist": [ "supports es6-class" diff --git a/packages/packer/package.json b/packages/packer/package.json index 4061ef39ae..980523994c 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,5 +1,5 @@ { - "name": "@mixpanel/packer", + "name": "@mixpanel/rrweb-packer", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" @@ -17,13 +17,13 @@ "prepublish": "tsc -noEmit && vite build", "lint": "yarn eslint src/**/*.ts" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/packer#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/@rrweb/packer#readme", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "license": "MIT", "type": "module", @@ -78,7 +78,7 @@ }, "dependencies": { "fflate": "^0.4.4", - "@rrweb/types": "^2.0.0-alpha.18" + "@mixpanel/rrweb-types": "^2.0.0-alpha.18" }, "browserslist": [ "supports es6-class" diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index 751b11af71..72292d7bb9 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -31,7 +31,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb" @@ -39,16 +39,16 @@ "author": "justin@recordonce.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, - "homepage": "https://github.com/rrweb-io/rrweb#readme", + "homepage": "https://github.com/mixpanel/rrweb#readme", "devDependencies": { - "rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", "typescript": "^5.4.5", "vite": "^5.3.1", "vite-plugin-dts": "^3.9.1" }, "peerDependencies": { - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18" } } diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index c19bbf3fe6..bb1d2c3aae 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -31,7 +31,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb" @@ -39,16 +39,16 @@ "author": "justin@recordonce.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, - "homepage": "https://github.com/rrweb-io/rrweb#readme", + "homepage": "https://github.com/mixpanel/rrweb#readme", "devDependencies": { - "rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", "typescript": "^5.4.5", "vite": "^5.3.1", "vite-plugin-dts": "^3.9.1" }, "peerDependencies": { - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18" } } diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index 789d49097f..60babd3734 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -33,19 +33,19 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb" ], - "author": "yanzhen@smartx.com", + "author": "justin@recordonce.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, - "homepage": "https://github.com/rrweb-io/rrweb#readme", + "homepage": "https://github.com/mixpanel/rrweb#readme", "devDependencies": { - "rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", "typescript": "^5.4.5", "vite": "^5.3.1", "vite-plugin-dts": "^3.9.1", @@ -53,7 +53,7 @@ "puppeteer": "^20.9.0" }, "peerDependencies": { - "rrweb": "^2.0.0-alpha.18", - "@rrweb/utils": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb-utils": "^2.0.0-alpha.18" } } diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index a99ea39318..9183cd4b0d 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -31,7 +31,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb" @@ -39,17 +39,17 @@ "author": "yanzhen@smartx.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, - "homepage": "https://github.com/rrweb-io/rrweb#readme", + "homepage": "https://github.com/mixpanel/rrweb#readme", "devDependencies": { - "@rrweb/rrweb-plugin-console-record": "^2.0.0-alpha.18", - "rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb-plugin-console-record": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", "typescript": "^5.4.5", "vite": "^5.3.1", "vite-plugin-dts": "^3.9.1" }, "peerDependencies": { - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18" } } diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index 784de6a602..b6bfb8ffb9 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -43,12 +43,12 @@ }, "homepage": "https://github.com/rrweb-io/rrweb#readme", "devDependencies": { - "rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", "typescript": "^5.4.5", "vite": "^5.3.1", "vite-plugin-dts": "^3.9.1" }, "peerDependencies": { - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18" } } diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index 6700c41e0d..082b9851c8 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -43,13 +43,13 @@ }, "homepage": "https://github.com/rrweb-io/rrweb#readme", "devDependencies": { - "@rrweb/rrweb-plugin-sequential-id-record": "^2.0.0-alpha.18", - "rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb-plugin-sequential-id-record": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", "typescript": "^5.4.5", "vite": "^5.3.1", "vite-plugin-dts": "^3.9.1" }, "peerDependencies": { - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18" } } diff --git a/packages/record/package.json b/packages/record/package.json index badd6d5848..accd1c4350 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,5 +1,5 @@ { - "name": "@mixpanel/record", + "name": "@mixpanel/rrweb-record", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" @@ -17,13 +17,13 @@ "prepublish": "tsc -noEmit && vite build", "lint": "yarn eslint src/**/*.ts" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/record#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/@rrweb/record#readme", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "license": "MIT", "type": "module", @@ -55,9 +55,9 @@ "typescript": "^5.4.5" }, "dependencies": { - "@rrweb/types": "^2.0.0-alpha.18", - "rrweb": "^2.0.0-alpha.18", - "@rrweb/utils": "^2.0.0-alpha.18" + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb-utils": "^2.0.0-alpha.18" }, "browserslist": [ "supports es6-class" diff --git a/packages/replay/package.json b/packages/replay/package.json index d1215f4304..2919dc9ff8 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,5 +1,5 @@ { - "name": "@mixpanel/replay", + "name": "@mixpanel/rrweb-replay", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" @@ -17,13 +17,13 @@ "prepublish": "tsc -noEmit && vite build", "lint": "yarn eslint src/**/*.ts" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/replay#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/@rrweb/replay#readme", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "license": "MIT", "type": "module", @@ -56,8 +56,8 @@ "typescript": "^5.4.5" }, "dependencies": { - "@rrweb/types": "^2.0.0-alpha.18", - "rrweb": "^2.0.0-alpha.18" + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", + "@mixpanel/rrweb": "^2.0.0-alpha.18" }, "browserslist": [ "supports es6-class" diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index 5fe1f2656e..5825413d9a 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -55,7 +55,7 @@ "cssom": "^0.5.0", "cssstyle": "^2.3.0", "nwsapi": "2.2.0", - "rrdom": "^2.0.0-alpha.18", - "@rrweb/types": "^2.0.0-alpha.18" + "@mixpanel/rrdom": "^2.0.0-alpha.18", + "@mixpanel/rrweb-types": "^2.0.0-alpha.18" } } diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index 90bb9038c0..dd1135edc6 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,7 +1,7 @@ { "name": "@mixpanel/rrdom", "version": "2.0.0-alpha.18", - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/rrdom#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", "type": "module", "main": "./dist/rrdom.cjs", @@ -26,7 +26,7 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "scripts": { "dev": "vite build --watch", @@ -38,10 +38,10 @@ "lint": "yarn eslint src/**/*.ts" }, "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "devDependencies": { - "@rrweb/types": "^2.0.0-alpha.18", + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@types/puppeteer": "^5.4.4", "@typescript-eslint/eslint-plugin": "^5.23.0", "@typescript-eslint/parser": "^5.23.0", @@ -52,6 +52,6 @@ "vite-plugin-dts": "^3.9.1" }, "dependencies": { - "rrweb-snapshot": "^2.0.0-alpha.18" + "@mixpanel/rrweb-snapshot": "^2.0.0-alpha.18" } } diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index ef376cebe0..3d676b0042 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -27,7 +27,7 @@ "@types/node": "^18.15.11", "jest": "^27.5.1", "ts-jest": "^27.1.3", - "@rrweb/types": "^2.0.0-alpha.18" + "@mixpanel/rrweb-types": "^2.0.0-alpha.18" }, "dependencies": { "@open-tech-world/cli-progress-bar": "^2.0.2", diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index 7ddbadf117..fe9e8da6ba 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -2,7 +2,7 @@ "name": "@mixpanel/rrweb-player", "version": "2.0.0-alpha.18", "devDependencies": { - "@rrweb/types": "^2.0.0-alpha.18", + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/package": "^2.0.0", @@ -20,8 +20,8 @@ }, "dependencies": { "@tsconfig/svelte": "^1.0.0", - "@rrweb/replay": "^2.0.0-alpha.18", - "@rrweb/packer": "^2.0.0-alpha.18" + "@mixpanel/rrweb-replay": "^2.0.0-alpha.18", + "@mixpanel/rrweb-packer": "^2.0.0-alpha.18" }, "scripts": { "dev": "vite build --watch", diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 127be76b94..427e91038d 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -20,7 +20,7 @@ "type": "module", "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb", @@ -50,12 +50,12 @@ "author": "yanzhen@smartx.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/master/packages/rrweb-snapshot#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/master/packages/rrweb-snapshot#readme", "devDependencies": { - "@rrweb/types": "^2.0.0-alpha.18", - "@rrweb/utils": "^2.0.0-alpha.18", + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", + "@mixpanel/rrweb-utils": "^2.0.0-alpha.18", "@types/jsdom": "^20.0.0", "@types/node": "^18.15.11", "@types/puppeteer": "^5.4.4", diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index 66788ccdae..afbcbc365b 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -26,7 +26,7 @@ "type": "module", "repository": { "type": "git", - "url": "git+ssh://git@github.com/rrweb-io/rrweb.git" + "url": "git+ssh://git@github.com/mixpanel/rrweb.git" }, "keywords": [ "rrweb" @@ -56,9 +56,9 @@ "author": "yanzhen@smartx.com", "license": "MIT", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, - "homepage": "https://github.com/rrweb-io/rrweb#readme", + "homepage": "https://github.com/mixpanel/rrweb#readme", "devDependencies": { "@types/dom-mediacapture-transform": "0.1.4", "@types/inquirer": "^8.2.1", @@ -80,13 +80,13 @@ "vite-plugin-dts": "^3.9.1" }, "dependencies": { - "@rrweb/types": "^2.0.0-alpha.18", - "@rrweb/utils": "^2.0.0-alpha.18", + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", + "@mixpanel/rrweb-utils": "^2.0.0-alpha.18", "@types/css-font-loading-module": "0.0.7", "@xstate/fsm": "^1.4.0", "base64-arraybuffer": "^1.0.1", "mitt": "^3.0.0", - "rrdom": "^2.0.0-alpha.18", - "rrweb-snapshot": "^2.0.0-alpha.18" + "@mixpanel/rrdom": "^2.0.0-alpha.18", + "@mixpanel/rrweb-snapshot": "^2.0.0-alpha.18" } } diff --git a/packages/types/package.json b/packages/types/package.json index c4f9926dfc..1e680bbb9a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,5 +1,5 @@ { - "name": "@mixpanel/types", + "name": "@mixpanel/rrweb-types", "version": "2.0.0-alpha.18", "publishConfig": { "access": "public" @@ -15,13 +15,13 @@ "prepublish": "tsc -noEmit && vite build", "lint": "yarn eslint src/**/*.ts" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/types#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/@rrweb/types#readme", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "license": "MIT", "type": "module", diff --git a/packages/utils/package.json b/packages/utils/package.json index a7c0f1d46f..0194a3aaa0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -15,13 +15,13 @@ "prepublish": "npm run build", "lint": "yarn eslint src/**/*.ts" }, - "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/utils#readme", + "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/@rrweb/utils#readme", "bugs": { - "url": "https://github.com/rrweb-io/rrweb/issues" + "url": "https://github.com/mixpanel/rrweb/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/rrweb-io/rrweb.git" + "url": "git+https://github.com/mixpanel/rrweb.git" }, "license": "MIT", "type": "module", diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index f929ff5edc..d44d8c36e3 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -18,7 +18,7 @@ "prepublish": "yarn build" }, "devDependencies": { - "@rrweb/types": "^2.0.0-alpha.18", + "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@types/chrome": "^0.0.287", "@types/react-dom": "^18.0.6", "@types/semver": "^7.5.8", @@ -44,7 +44,7 @@ "react-dom": "^18.2.0", "react-icons": "^4.4.0", "react-router-dom": "^6.4.1", - "rrweb": "^2.0.0-alpha.18", - "rrweb-player": "^2.0.0-alpha.18" + "@mixpanel/rrweb": "^2.0.0-alpha.18", + "@mixpanel/rrweb-player": "^2.0.0-alpha.18" } } From 86162a9d4b720e0ae055d69e51b8edb61871e629 Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> Date: Thu, 14 Aug 2025 22:48:43 +0000 Subject: [PATCH 03/33] mixpanel release changes --- .changeset/config.json | 40 ++++---- package.json | 5 +- packages/all/package.json | 12 +-- packages/all/src/index.ts | 8 +- packages/packer/package.json | 8 +- .../package.json | 2 +- .../package.json | 2 +- .../rrweb-plugin-console-record/package.json | 2 +- .../rrweb-plugin-console-replay/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/record/package.json | 12 +-- packages/replay/package.json | 12 +-- packages/rrdom-nodejs/package.json | 2 +- packages/rrdom/package.json | 2 +- packages/rrvideo/package.json | 2 +- packages/rrvideo/tsconfig.json | 9 +- .../rrweb-player/.svelte-kit/ambient.d.ts | 40 ++++++-- packages/rrweb-player/package.json | 2 +- packages/rrweb-player/tsconfig.node.json | 4 +- packages/rrweb-snapshot/package.json | 4 +- packages/rrweb/package.json | 2 +- packages/types/package.json | 12 +-- packages/utils/package.json | 12 +-- packages/web-extension/package.json | 4 +- tsconfig.base.json | 21 ++++ vite.config.default.ts | 27 ++++- write-mixpanel-version.js | 98 +++++++++++++++++++ yarn.lock | 65 +++++++++++- 29 files changed, 324 insertions(+), 91 deletions(-) create mode 100644 write-mixpanel-version.js diff --git a/.changeset/config.json b/.changeset/config.json index 839d290b43..89ad04bbc7 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,28 +1,28 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "mixpanel/rrweb" }], + "changelog": ["@changesets/changelog-github", { "repo": "rrweb-io/rrweb" }], "commit": false, "fixed": [ [ - "@mixpanel/rrweb", - "@mixpanel/rrweb-snapshot", - "@mixpanel/rrdom", - "@mixpanel/rrdom-nodejs", - "@mixpanel/rrweb-player", - "@mixpanel/rrweb-all", - "@mixpanel/rrweb-replay", - "@mixpanel/rrweb-record", - "@mixpanel/rrweb-types", - "@mixpanel/rrweb-packer", - "@mixpanel/rrweb-utils", - "@mixpanel/rrweb-web-extension", - "@mixpanel/rrvideo", - "@mixpanel/rrweb-plugin-console-record", - "@mixpanel/rrweb-plugin-console-replay", - "@mixpanel/rrweb-plugin-sequential-id-record", - "@mixpanel/rrweb-plugin-sequential-id-replay", - "@mixpanel/rrweb-plugin-canvas-webrtc-record", - "@mixpanel/rrweb-plugin-canvas-webrtc-replay" + "rrweb", + "rrweb-snapshot", + "rrdom", + "rrdom-nodejs", + "rrweb-player", + "@rrweb/all", + "@rrweb/replay", + "@rrweb/record", + "@rrweb/types", + "@rrweb/packer", + "@rrweb/utils", + "@rrweb/web-extension", + "rrvideo", + "@rrweb/rrweb-plugin-console-record", + "@rrweb/rrweb-plugin-console-replay", + "@rrweb/rrweb-plugin-sequential-id-record", + "@rrweb/rrweb-plugin-sequential-id-replay", + "@rrweb/rrweb-plugin-canvas-webrtc-record", + "@rrweb/rrweb-plugin-canvas-webrtc-replay" ] ], "linked": [], diff --git a/package.json b/package.json index e844f868f9..8273426e59 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@mixpanel/rrweb", + "name": "@mixpanel/rrweb_monorepo", "description": "record and replay the web", "repository": { "type": "git", @@ -56,7 +56,8 @@ "live-stream": "cd packages/rrweb && yarn live-stream", "lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'ESLINT_USE_FLAT_CONFIG=false yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'", "lint:report": "ESLINT_USE_FLAT_CONFIG=false yarn eslint --output-file eslint_report.json --format json packages/*/src --ext .ts,.tsx,.js,.jsx", - "release": "yarn build:all && changeset publish" + "release": "yarn build:all && changeset publish", + "mixpanel-version": "node write-mixpanel-version.js" }, "resolutions": { "**/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", diff --git a/packages/all/package.json b/packages/all/package.json index 26a1271f65..a31802a981 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-all", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "publishConfig": { "access": "public" }, @@ -27,19 +27,19 @@ }, "license": "MIT", "type": "module", - "main": "./dist/all.cjs", - "module": "./dist/all.js", - "unpkg": "./dist/all.umd.cjs", + "main": "./dist/rrweb-all.cjs", + "module": "./dist/rrweb-all.js", + "unpkg": "./dist/rrweb-all.umd.cjs", "typings": "dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", - "default": "./dist/all.js" + "default": "./dist/rrweb-all.js" }, "require": { "types": "./dist/index.d.cts", - "default": "./dist/all.cjs" + "default": "./dist/rrweb-all.cjs" } } }, diff --git a/packages/all/src/index.ts b/packages/all/src/index.ts index aa01eeaba9..5f972cdf49 100644 --- a/packages/all/src/index.ts +++ b/packages/all/src/index.ts @@ -1,4 +1,4 @@ -export * from 'rrweb'; -export * from '@rrweb/packer'; -// export * from '@rrweb/rrweb-plugin-console-record'; -// export * from '@rrweb/rrweb-plugin-console-replay'; +export * from '@mixpanel/rrweb'; +export * from '@mixpanel/rrweb-packer'; +// export * from '@mixpanel/rrweb-plugin-console-record'; +// export * from '@mixpanel/rrweb-plugin-console-replay'; diff --git a/packages/packer/package.json b/packages/packer/package.json index 980523994c..8003146635 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-packer", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "publishConfig": { "access": "public" }, @@ -27,9 +27,9 @@ }, "license": "MIT", "type": "module", - "main": "./dist/packer.cjs", - "module": "./dist/packer.js", - "unpkg": "./dist/packer.js", + "main": "./dist/rrweb-packer.cjs", + "module": "./dist/rrweb-packer.js", + "unpkg": "./dist/rrweb-packer.js", "typings": "dist/packer.d.ts", "exports": { ".": { diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index 72292d7bb9..1576724a46 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-record", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index bb1d2c3aae..d9ee4b8aef 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-replay", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index 60babd3734..baf5d5278c 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-record", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index 9183cd4b0d..4723995f6b 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-replay", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index b6bfb8ffb9..8856af0ae4 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-record", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index 082b9851c8..8a94f3b7f4 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-replay", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-replay.umd.cjs", diff --git a/packages/record/package.json b/packages/record/package.json index accd1c4350..4a1f21abaa 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-record", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "publishConfig": { "access": "public" }, @@ -27,19 +27,19 @@ }, "license": "MIT", "type": "module", - "main": "./dist/record.cjs", - "module": "./dist/record.js", - "unpkg": "./dist/record.umd.cjs", + "main": "./dist/rrweb-record.cjs", + "module": "./dist/rrweb-record.js", + "unpkg": "./dist/rrweb-record.umd.cjs", "typings": "dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", - "default": "./dist/record.js" + "default": "./dist/rrweb-record.js" }, "require": { "types": "./dist/index.d.cts", - "default": "./dist/record.cjs" + "default": "./dist/rrweb-record.cjs" } } }, diff --git a/packages/replay/package.json b/packages/replay/package.json index 2919dc9ff8..7fea974a49 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-replay", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "publishConfig": { "access": "public" }, @@ -27,19 +27,19 @@ }, "license": "MIT", "type": "module", - "main": "./dist/replay.cjs", - "module": "./dist/replay.js", - "unpkg": "./dist/replay.umd.cjs", + "main": "./dist/rrweb-replay.cjs", + "module": "./dist/rrweb-replay.js", + "unpkg": "./dist/rrweb-replay.umd.cjs", "typings": "dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", - "default": "./dist/replay.js" + "default": "./dist/rrweb-replay.js" }, "require": { "types": "./dist/index.d.cts", - "default": "./dist/replay.cjs" + "default": "./dist/rrweb-replay.cjs" } }, "./dist/style.css": "./dist/style.css" diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index 5825413d9a..eb941aa444 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom-nodejs", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "scripts": { "dev": "vite build --watch", "build": "yarn turbo run prepublish", diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index dd1135edc6..d2f853dca2 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", "type": "module", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index 3d676b0042..808a980357 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrvideo", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "transform rrweb session into video", "main": "build/index.js", "bin": { diff --git a/packages/rrvideo/tsconfig.json b/packages/rrvideo/tsconfig.json index 95955dda4a..dba56dda29 100644 --- a/packages/rrvideo/tsconfig.json +++ b/packages/rrvideo/tsconfig.json @@ -16,11 +16,12 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, - "exclude": ["build", "node_modules", "test"], + "exclude": [ + "build", + "node_modules", + "test" + ], "references": [ - { - "path": "../rrweb-player" - }, { "path": "../types" } diff --git a/packages/rrweb-player/.svelte-kit/ambient.d.ts b/packages/rrweb-player/.svelte-kit/ambient.d.ts index 66489477b3..db6c9f8761 100644 --- a/packages/rrweb-player/.svelte-kit/ambient.d.ts +++ b/packages/rrweb-player/.svelte-kit/ambient.d.ts @@ -36,13 +36,13 @@ declare module '$env/static/private' { export const TFLINT_OPA_POLICY_DIR: string; export const USER: string; export const SSH_CLIENT: string; + export const npm_config_user_agent: string; export const npm_package_bin_svelte_kit: string; export const npm_package_dependencies_sirv: string; export const npm_package_dependencies_sade: string; export const npm_package_dependencies_mrmime: string; export const npm_package_dependencies_magic_string: string; export const npm_config_version_commit_hooks: string; - export const npm_config_user_agent: string; export const npm_package_scripts_generate_version: string; export const npm_package_dependencies__types_cookie: string; export const npm_config_bin_links: string; @@ -55,16 +55,16 @@ declare module '$env/static/private' { export const npm_config_init_version: string; export const SHLVL: string; export const BROWSER: string; + export const npm_config_noproxy: string; export const npm_package_exports___node_types: string; export const npm_package_files_0: string; export const GO15VENDOREXPERIMENT: string; export const HOME: string; - export const OLDPWD: string; export const npm_package_files_1: string; export const npm_package_repository_directory: string; - export const SKIP_PUPPETEER_DOWNLOAD: string; export const TERM_PROGRAM_VERSION: string; export const VSCODE_IPC_HOOK_CLI: string; + export const npm_package_json: string; export const npm_package_files_2: string; export const PYENV_SHELL: string; export const BASH_DEFAULT_TIMEOUT_MS: string; @@ -79,6 +79,8 @@ declare module '$env/static/private' { export const npm_config_version_tag_prefix: string; export const VSCODE_GIT_ASKPASS_NODE: string; export const SSL_CERT_FILE: string; + export const npm_config_userconfig: string; + export const npm_config_local_prefix: string; export const npm_package_scripts_check: string; export const npm_package_files_5: string; export const npm_package_dependencies_tiny_glob: string; @@ -89,6 +91,7 @@ declare module '$env/static/private' { export const npm_package_files_6: string; export const COLORTERM: string; export const GOOGLE_APPLICATION_CREDENTIALS: string; + export const COLOR: string; export const npm_package_devDependencies_typescript: string; export const npm_package_devDependencies__types_connect: string; export const npm_package_description: string; @@ -103,23 +106,27 @@ declare module '$env/static/private' { export const npm_package_type: string; export const CLAUDE_CODE_USE_VERTEX: string; export const _: string; + export const npm_config_prefix: string; + export const npm_config_npm_version: string; export const XDG_SESSION_CLASS: string; export const npm_package_scripts_lint: string; export const npm_config_registry: string; export const TERM: string; export const XDG_SESSION_ID: string; + export const npm_config_cache: string; export const CLOUD_ML_REGION: string; export const npm_package_exports___import: string; export const npm_package_devDependencies_dts_buddy: string; export const npm_package_dependencies_kleur: string; export const npm_package_dependencies_devalue: string; export const npm_config_ignore_scripts: string; + export const npm_config_node_gyp: string; export const npm_package_exports___package_json: string; export const npm_package_peerDependencies_svelte: string; export const PATH: string; export const NODE: string; - export const npm_package_repository_type: string; export const npm_package_name: string; + export const npm_package_repository_type: string; export const XDG_RUNTIME_DIR: string; export const npm_package_scripts_test_integration: string; export const npm_package_exports___node_polyfills_import: string; @@ -160,6 +167,8 @@ declare module '$env/static/private' { export const npm_package_license: string; export const npm_config_strict_ssl: string; export const VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; + export const npm_config_globalconfig: string; + export const npm_config_init_module: string; export const npm_package_scripts_format: string; export const PWD: string; export const GCP_DEVBOX: string; @@ -169,7 +178,9 @@ declare module '$env/static/private' { export const SSH_CONNECTION: string; export const PYENV_ROOT: string; export const XDG_DATA_DIRS: string; + export const npm_config_global_prefix: string; export const npm_package_exports___types: string; + export const npm_command: string; export const npm_package_peerDependencies_vite: string; export const npm_package_peerDependencies__sveltejs_vite_plugin_svelte: string; export const npm_config_save_prefix: string; @@ -177,6 +188,7 @@ declare module '$env/static/private' { export const MANPATH: string; export const npm_package_exports___node_polyfills_types: string; export const INIT_CWD: string; + export const EDITOR: string; export const npm_package_exports___hooks_import: string; export const npm_package_dependencies_import_meta_resolve: string; } @@ -220,13 +232,13 @@ declare module '$env/dynamic/private' { TFLINT_OPA_POLICY_DIR: string; USER: string; SSH_CLIENT: string; + npm_config_user_agent: string; npm_package_bin_svelte_kit: string; npm_package_dependencies_sirv: string; npm_package_dependencies_sade: string; npm_package_dependencies_mrmime: string; npm_package_dependencies_magic_string: string; npm_config_version_commit_hooks: string; - npm_config_user_agent: string; npm_package_scripts_generate_version: string; npm_package_dependencies__types_cookie: string; npm_config_bin_links: string; @@ -239,16 +251,16 @@ declare module '$env/dynamic/private' { npm_config_init_version: string; SHLVL: string; BROWSER: string; + npm_config_noproxy: string; npm_package_exports___node_types: string; npm_package_files_0: string; GO15VENDOREXPERIMENT: string; HOME: string; - OLDPWD: string; npm_package_files_1: string; npm_package_repository_directory: string; - SKIP_PUPPETEER_DOWNLOAD: string; TERM_PROGRAM_VERSION: string; VSCODE_IPC_HOOK_CLI: string; + npm_package_json: string; npm_package_files_2: string; PYENV_SHELL: string; BASH_DEFAULT_TIMEOUT_MS: string; @@ -263,6 +275,8 @@ declare module '$env/dynamic/private' { npm_config_version_tag_prefix: string; VSCODE_GIT_ASKPASS_NODE: string; SSL_CERT_FILE: string; + npm_config_userconfig: string; + npm_config_local_prefix: string; npm_package_scripts_check: string; npm_package_files_5: string; npm_package_dependencies_tiny_glob: string; @@ -273,6 +287,7 @@ declare module '$env/dynamic/private' { npm_package_files_6: string; COLORTERM: string; GOOGLE_APPLICATION_CREDENTIALS: string; + COLOR: string; npm_package_devDependencies_typescript: string; npm_package_devDependencies__types_connect: string; npm_package_description: string; @@ -287,23 +302,27 @@ declare module '$env/dynamic/private' { npm_package_type: string; CLAUDE_CODE_USE_VERTEX: string; _: string; + npm_config_prefix: string; + npm_config_npm_version: string; XDG_SESSION_CLASS: string; npm_package_scripts_lint: string; npm_config_registry: string; TERM: string; XDG_SESSION_ID: string; + npm_config_cache: string; CLOUD_ML_REGION: string; npm_package_exports___import: string; npm_package_devDependencies_dts_buddy: string; npm_package_dependencies_kleur: string; npm_package_dependencies_devalue: string; npm_config_ignore_scripts: string; + npm_config_node_gyp: string; npm_package_exports___package_json: string; npm_package_peerDependencies_svelte: string; PATH: string; NODE: string; - npm_package_repository_type: string; npm_package_name: string; + npm_package_repository_type: string; XDG_RUNTIME_DIR: string; npm_package_scripts_test_integration: string; npm_package_exports___node_polyfills_import: string; @@ -344,6 +363,8 @@ declare module '$env/dynamic/private' { npm_package_license: string; npm_config_strict_ssl: string; VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; + npm_config_globalconfig: string; + npm_config_init_module: string; npm_package_scripts_format: string; PWD: string; GCP_DEVBOX: string; @@ -353,7 +374,9 @@ declare module '$env/dynamic/private' { SSH_CONNECTION: string; PYENV_ROOT: string; XDG_DATA_DIRS: string; + npm_config_global_prefix: string; npm_package_exports___types: string; + npm_command: string; npm_package_peerDependencies_vite: string; npm_package_peerDependencies__sveltejs_vite_plugin_svelte: string; npm_config_save_prefix: string; @@ -361,6 +384,7 @@ declare module '$env/dynamic/private' { MANPATH: string; npm_package_exports___node_polyfills_types: string; INIT_CWD: string; + EDITOR: string; npm_package_exports___hooks_import: string; npm_package_dependencies_import_meta_resolve: string; [key: `PUBLIC_${string}`]: undefined; diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index fe9e8da6ba..abb63e9666 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-player", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "devDependencies": { "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@sveltejs/adapter-auto": "^3.0.0", diff --git a/packages/rrweb-player/tsconfig.node.json b/packages/rrweb-player/tsconfig.node.json index d02c37dfe5..c0a1eb092a 100644 --- a/packages/rrweb-player/tsconfig.node.json +++ b/packages/rrweb-player/tsconfig.node.json @@ -4,7 +4,7 @@ "skipLibCheck": true, "module": "ESNext", "moduleResolution": "bundler", - "strict": true + "strict": false }, - "include": ["vite.config.ts"] + "include": ["vite.config.ts"], } diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 427e91038d..824a74ec47 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-snapshot", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { "prepare": "npm run prepack", @@ -12,7 +12,7 @@ "test:update": "yarn build && vitest run --update", "bench": "vite build && vitest bench", "dev": "vite build --watch", - "build": "yarn turbo prepublish -F rrweb-snapshot", + "build": "yarn turbo prepublish -F @mixpanel/rrweb-snapshot", "check-types": "tsc --noEmit", "prepublish": "yarn check-types && vite build", "lint": "yarn eslint src" diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index afbcbc365b..38fcb77669 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "record and replay the web", "scripts": { "prepare": "npm run prepack", diff --git a/packages/types/package.json b/packages/types/package.json index 1e680bbb9a..f528e704d7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-types", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "publishConfig": { "access": "public" }, @@ -25,19 +25,19 @@ }, "license": "MIT", "type": "module", - "main": "./dist/types.umd.cjs", - "module": "./dist/types.js", - "unpkg": "./dist/types.umd.cjs", + "main": "./dist/rrweb-types.umd.cjs", + "module": "./dist/rrweb-types.js", + "unpkg": "./dist/rrweb-types.umd.cjs", "typings": "dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", - "default": "./dist/types.js" + "default": "./dist/rrweb-types.js" }, "require": { "types": "./dist/index.d.cts", - "default": "./dist/types.umd.cjs" + "default": "./dist/rrweb-types.umd.cjs" } } }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 0194a3aaa0..c1d14bb72d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-utils", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "publishConfig": { "access": "public" }, @@ -25,19 +25,19 @@ }, "license": "MIT", "type": "module", - "main": "./dist/utils.umd.cjs", - "module": "./dist/utils.js", - "unpkg": "./dist/utils.umd.cjs", + "main": "./dist/rrweb-utils.umd.cjs", + "module": "./dist/rrweb-utils.js", + "unpkg": "./dist/rrweb-utils.umd.cjs", "typings": "dist/index.d.ts", "exports": { ".": { "import": { "types": "./dist/index.d.ts", - "default": "./dist/utils.js" + "default": "./dist/rrweb-utils.js" }, "require": { "types": "./dist/index.d.cts", - "default": "./dist/utils.umd.cjs" + "default": "./dist/rrweb-utils.umd.cjs" } } }, diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index d44d8c36e3..7248984701 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -1,7 +1,7 @@ { "name": "@mixpanel/rrweb-web-extension", "private": true, - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.18.1", "description": "The web extension of rrweb which helps to run rrweb on any website out of box", "author": "rrweb-io", "license": "MIT", @@ -15,7 +15,7 @@ "pack:firefox": "cross-env TARGET_BROWSER=firefox ZIP=true vite build", "check-types": "tsc -noEmit", "build": "npm run pack:chrome && npm run pack:firefox", - "prepublish": "yarn build" + "prepublish": "echo 'Skipping build for extension'" }, "devDependencies": { "@mixpanel/rrweb-types": "^2.0.0-alpha.18", diff --git a/tsconfig.base.json b/tsconfig.base.json index bcee1c7337..6519e50b7c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -8,6 +8,27 @@ "target": "ESNext", "module": "ESNext", "moduleResolution": "Node", + "baseUrl": ".", + "paths": { + "@rrweb/types": ["./packages/types"], + "@rrweb/utils": ["./packages/utils"], + "@rrweb/packer": ["./packages/packer"], + "@rrweb/record": ["./packages/record"], + "@rrweb/replay": ["./packages/replay"], + "@rrweb/all": ["./packages/all"], + "@rrweb/rrweb-plugin-console-record": ["./packages/plugins/rrweb-plugin-console-record"], + "@rrweb/rrweb-plugin-console-replay": ["./packages/plugins/rrweb-plugin-console-replay"], + "@rrweb/rrweb-plugin-sequential-id-record": ["./packages/plugins/rrweb-plugin-sequential-id-record"], + "@rrweb/rrweb-plugin-sequential-id-replay": ["./packages/plugins/rrweb-plugin-sequential-id-replay"], + "@rrweb/rrweb-plugin-canvas-webrtc-record": ["./packages/plugins/rrweb-plugin-canvas-webrtc-record"], + "@rrweb/rrweb-plugin-canvas-webrtc-replay": ["./packages/plugins/rrweb-plugin-canvas-webrtc-replay"], + "rrweb": ["./packages/rrweb"], + "rrweb-snapshot": ["./packages/rrweb-snapshot"], + "rrdom": ["./packages/rrdom"], + "rrdom-nodejs": ["./packages/rrdom-nodejs"], + "rrweb-player": ["./packages/rrweb-player"], + "rrvideo": ["./packages/rrvideo"], + }, "rootDir": "src", "outDir": "dist", "lib": ["es6", "dom"], diff --git a/vite.config.default.ts b/vite.config.default.ts index 46af9327a6..9bcea16025 100644 --- a/vite.config.default.ts +++ b/vite.config.default.ts @@ -146,10 +146,35 @@ export default function ( // }, // }, }, + + resolve: { + alias: { + // Map @rrweb scoped packages to the one in this repo so we don't have to update source imports to reference @mixpanel + "@rrweb/types": resolve(__dirname, "./packages/types"), + "@rrweb/utils": resolve(__dirname, "./packages/utils"), + "@rrweb/packer": resolve(__dirname, "./packages/packer"), + "@rrweb/record": resolve(__dirname, "./packages/record"), + "@rrweb/replay": resolve(__dirname, "./packages/replay"), + "@rrweb/all": resolve(__dirname, "./packages/all"), + "@rrweb/rrweb-plugin-console-record": resolve(__dirname, "./packages/plugins/rrweb-plugin-console-record"), + "@rrweb/rrweb-plugin-console-replay": resolve(__dirname, "./packages/plugins/rrweb-plugin-console-replay"), + "@rrweb/rrweb-plugin-sequential-id-record": resolve(__dirname, "./packages/plugins/rrweb-plugin-sequential-id-record"), + "@rrweb/rrweb-plugin-sequential-id-replay": resolve(__dirname, "./packages/plugins/rrweb-plugin-sequential-id-replay"), + "@rrweb/rrweb-plugin-canvas-webrtc-record": resolve(__dirname, "./packages/plugins/rrweb-plugin-canvas-webrtc-record"), + "@rrweb/rrweb-plugin-canvas-webrtc-replay": resolve(__dirname, "./packages/plugins/rrweb-plugin-canvas-webrtc-replay"), + "rrweb": resolve(__dirname, "./packages/rrweb"), + "rrweb-snapshot": resolve(__dirname, "./packages/rrweb-snapshot"), + "rrdom": resolve(__dirname, "./packages/rrdom"), + "rrdom-nodejs": resolve(__dirname, "./packages/rrdom-nodejs"), + "rrweb-player": resolve(__dirname, "./packages/rrweb-player"), + "rrvideo": resolve(__dirname, "./packages/rrvideo") + }, + }, + plugins: [ dts({ insertTypesEntry: true, - rollupTypes: true, + rollupTypes: false, afterBuild: (emittedFiles: Map) => { // To pass publint (`npm x publint@latest`) and ensure the // package is supported by all consumers, we must export types that are diff --git a/write-mixpanel-version.js b/write-mixpanel-version.js new file mode 100644 index 0000000000..b022ccaa45 --- /dev/null +++ b/write-mixpanel-version.js @@ -0,0 +1,98 @@ +#!/usr/bin/env node +// working around the changesets setup because we want to be able to build and deploy mixpanel's own version of rrweb +// while keeping the core business logic intact. mixpanel doesn't need the changesets, +// so we'll just add an extra "mixpanel patch" number to indicate it's different than the rrweb-io version +// e.g. +// 2.0.0-alpha.18.1 means we have changes that are not in rrweb 2.0.0-alpha.18 +// 2.0.0-alpha.19 means we are 1:1 with upstream rrweb 2.0.0-alpha.19 + +const fs = require('fs'); +const path = require('path'); + +function findPackageJsonFiles(dir, results = []) { + try { + const items = fs.readdirSync(dir, { withFileTypes: true }); + + for (const item of items) { + const fullPath = path.join(dir, item.name); + + if (item.isDirectory() && item.name !== 'node_modules') { + findPackageJsonFiles(fullPath, results); + } else if (item.isFile() && item.name === 'package.json') { + results.push(fullPath); + } + } + } catch (error) { + // Skip directories we can't read + } + + return results; +} + +function bumpVersion(version) { + const versionNum = version.split('alpha.')[1].split('.'); + if (versionNum.length === 1) { + return `${version}.1`; // If no mixpanel patch, add .1 + } + const patchNumber = parseInt(versionNum[1], 10); + return `2.0.0-alpha.${versionNum[0]}.${patchNumber + 1}`; +} + +function processPackageJson(filePath) { + try { + const content = fs.readFileSync(filePath, 'utf8'); + const packageJson = JSON.parse(content); + + if (packageJson.version) { + const oldVersion = packageJson.version; + packageJson.version = bumpVersion(packageJson.version); + console.log(`${path.relative(process.cwd(), filePath)}: ${oldVersion} → ${packageJson.version}`); + + const updatedContent = JSON.stringify(packageJson, null, 2) + '\n'; + fs.writeFileSync(filePath, updatedContent, 'utf8'); + } + } catch (error) { + console.error(`Error processing ${filePath}: ${error.message}`); + } +} + +function main() { + const args = process.argv.slice(2); + + if (args.includes('--help') || args.includes('-h')) { + console.log(` +Usage: node bump-version.js + +Bumps version numbers in all package.json files in the packages directory. +Adds .1 to versions without mixpanel patches, increments existing patches. + +Examples: + 2.0.0-alpha.18 → 2.0.0-alpha.18.1 + 2.0.0-alpha.18.1 → 2.0.0-alpha.18.2 + `); + return; + } + + const packagesDir = path.join(__dirname, 'packages'); + + if (!fs.existsSync(packagesDir)) { + console.error('Error: packages directory not found'); + return; + } + + const packageJsonFiles = findPackageJsonFiles(packagesDir); + + if (packageJsonFiles.length === 0) { + console.log('No package.json files found'); + return; + } + + console.log(`Bumping versions in ${packageJsonFiles.length} packages:\n`); + + packageJsonFiles.forEach(processPackageJson); + + console.log('\nDone!'); +} + +// Run the script +main(); diff --git a/yarn.lock b/yarn.lock index 7d0b8c00de..8799603a80 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,5 +1,5 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 +# yarn lockfile v1 "@ampproject/remapping@^2.2.0", "@ampproject/remapping@^2.2.1": @@ -2375,6 +2375,32 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz#5d694d345ce36b6ecf657349e03eb87297e68da4" integrity sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g== +"@rrweb/packer@^2.0.0-alpha.18": + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/@rrweb/packer/-/packer-2.0.0-alpha.18.tgz#a529be0cf802b2a2c81db595f6933c389d91b0a2" + integrity sha512-rEXltE/gnflEv/NatVNPIp4/6EtVlPLSwzIbd4WPSMtQGvwZe5OfAAk/Y88HkbAwb1nHfdA3PtFGn2Epik4inQ== + dependencies: + "@rrweb/types" "^2.0.0-alpha.18" + fflate "^0.4.4" + +"@rrweb/replay@^2.0.0-alpha.18": + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/@rrweb/replay/-/replay-2.0.0-alpha.18.tgz#8cd2a02e05f3f5036b7ebd0fd491ddb35a35a144" + integrity sha512-EGCdydiQHCEbh1j+EF7OupwRHD1/EnAYYF4ENBz4CReoH+jGsLKu0LT2962CWPnQttMvpxwzhmD5gFGf63Gm0g== + dependencies: + "@rrweb/types" "^2.0.0-alpha.18" + rrweb "^2.0.0-alpha.18" + +"@rrweb/types@^2.0.0-alpha.18": + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/@rrweb/types/-/types-2.0.0-alpha.18.tgz#e1d9af844cebbf30a2be8808f6cf64f5df3e7f50" + integrity sha512-iMH3amHthJZ9x3gGmBPmdfim7wLGygC2GciIkw2A6SO8giSn8PHYtRT8OKNH4V+k3SZ6RSnYHcTQxBA7pSWZ3Q== + +"@rrweb/utils@^2.0.0-alpha.18": + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/@rrweb/utils/-/utils-2.0.0-alpha.18.tgz#7440b425461cf92b8ad9a229db40fa58d456159a" + integrity sha512-qV8azQYo9RuwW4NGRtOiQfTBdHNL1B0Q//uRLMbCSjbaKqJYd88Js17Bdskj65a0Vgp2dwTLPIZ0gK47dfjfaA== + "@rushstack/node-core-library@4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz#e26854a3314b279d57e8abdb4acce7797d02f554" @@ -8906,6 +8932,43 @@ rollup@^4.13.0: "@rollup/rollup-win32-x64-msvc" "4.18.0" fsevents "~2.3.2" +rrdom@^2.0.0-alpha.18: + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/rrdom/-/rrdom-2.0.0-alpha.18.tgz#54726a87053c420ef67b7597a31fef515e372e85" + integrity sha512-fSFzFFxbqAViITyYVA4Z0o5G6p1nEqEr/N8vdgSKie9Rn0FJxDSNJgjV0yiCIzcDs0QR+hpvgFhpbdZ6JIr5Nw== + dependencies: + rrweb-snapshot "^2.0.0-alpha.18" + +rrweb-player@^2.0.0-alpha.18: + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/rrweb-player/-/rrweb-player-2.0.0-alpha.18.tgz#c7db140c695c935247dc5aae7f4fd7de6b6fa512" + integrity sha512-v31QgtjR9Ei3JnyvaN/2THj6a/i+dG49LzHiUtHcfTIFi7ecVExmMq+QDctVxUsuwdPPTtEcslpQh2tbVbi/ow== + dependencies: + "@rrweb/packer" "^2.0.0-alpha.18" + "@rrweb/replay" "^2.0.0-alpha.18" + "@tsconfig/svelte" "^1.0.0" + +rrweb-snapshot@^2.0.0-alpha.18: + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/rrweb-snapshot/-/rrweb-snapshot-2.0.0-alpha.18.tgz#b242d079cb07acadd389a56674465a466b111e20" + integrity sha512-hBHZL/NfgQX6wO1D9mpwqFu1NJPpim+moIcKhFEjVTZVRUfCln+LOugRc4teVTCISYHN8Cw5e2iNTWCSm+SkoA== + dependencies: + postcss "^8.4.38" + +rrweb@^2.0.0-alpha.18: + version "2.0.0-alpha.18" + resolved "https://registry.yarnpkg.com/rrweb/-/rrweb-2.0.0-alpha.18.tgz#19d96bccba44dc1ee37d0b77b9ca1952682e62b5" + integrity sha512-1mjZcB+LVoGSx1+i9E2ZdAP90fS3MghYVix2wvGlZvrgRuLCbTCCOZMztFCkKpgp7/EeCdYM4nIHJkKX5J1Nmg== + dependencies: + "@rrweb/types" "^2.0.0-alpha.18" + "@rrweb/utils" "^2.0.0-alpha.18" + "@types/css-font-loading-module" "0.0.7" + "@xstate/fsm" "^1.4.0" + base64-arraybuffer "^1.0.1" + mitt "^3.0.0" + rrdom "^2.0.0-alpha.18" + rrweb-snapshot "^2.0.0-alpha.18" + run-async@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-3.0.0.tgz#42a432f6d76c689522058984384df28be379daad" From 0e38da5bdbbd0b384d84db030bbe1457e6691070 Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> Date: Fri, 26 Sep 2025 17:35:27 +0000 Subject: [PATCH 04/33] fix test ref --- packages/all/test/cross-origin-iframe-packer.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/all/test/cross-origin-iframe-packer.test.ts b/packages/all/test/cross-origin-iframe-packer.test.ts index 2623285537..f299581f62 100644 --- a/packages/all/test/cross-origin-iframe-packer.test.ts +++ b/packages/all/test/cross-origin-iframe-packer.test.ts @@ -57,7 +57,7 @@ async function injectRecordScript( options?: ExtraOptions, ) { await frame.addScriptTag({ - path: path.resolve(__dirname, '../dist/all.umd.cjs'), + path: path.resolve(__dirname, '../dist/rrweb-all.umd.cjs'), }); options = options || {}; await frame.evaluate((options) => { From c68ae046cd9a64fe87dc29efd372d222ed07b84f Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski Date: Mon, 29 Sep 2025 15:35:51 -0500 Subject: [PATCH 05/33] re-implement fix for hidden input (#4) Co-authored-by: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> --- packages/rrweb-snapshot/src/snapshot.ts | 1 + packages/rrweb-snapshot/src/types.ts | 1 + packages/rrweb/src/record/index.ts | 1 + .../__snapshots__/integration.test.ts.snap | 125 ++++++++++++++---- packages/rrweb/test/html/form.html | 1 + .../cross-origin-iframes.test.ts.snap | 42 +++++- 6 files changed, 142 insertions(+), 29 deletions(-) diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 8c29fa0d7f..05793e1348 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -1283,6 +1283,7 @@ function snapshot( textarea: true, select: true, password: true, + hidden: true, } : maskAllInputs === false ? { diff --git a/packages/rrweb-snapshot/src/types.ts b/packages/rrweb-snapshot/src/types.ts index 83b50e266f..9bdf561378 100644 --- a/packages/rrweb-snapshot/src/types.ts +++ b/packages/rrweb-snapshot/src/types.ts @@ -47,6 +47,7 @@ export type MaskInputOptions = Partial<{ textarea: boolean; select: boolean; password: boolean; + hidden: boolean; }>; export type SlimDOMOptions = Partial<{ diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 65da8ec801..7799d22821 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -155,6 +155,7 @@ function record( textarea: true, select: true, password: true, + hidden: true, } : _maskInputOptions !== undefined ? _maskInputOptions diff --git a/packages/rrweb/test/__snapshots__/integration.test.ts.snap b/packages/rrweb/test/__snapshots__/integration.test.ts.snap index 738f2fe8e2..1bcc1ab635 100644 --- a/packages/rrweb/test/__snapshots__/integration.test.ts.snap +++ b/packages/rrweb/test/__snapshots__/integration.test.ts.snap @@ -2952,8 +2952,23 @@ exports[`record integration tests > can record form interactions 1`] = ` }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"id\\": 63 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"123456\\" + }, + \\"childNodes\\": [], + \\"id\\": 64 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"id\\": 65 } ], \\"id\\": 18 @@ -2961,7 +2976,7 @@ exports[`record integration tests > can record form interactions 1`] = ` { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\", - \\"id\\": 64 + \\"id\\": 66 }, { \\"type\\": 2, @@ -2971,15 +2986,15 @@ exports[`record integration tests > can record form interactions 1`] = ` { \\"type\\": 3, \\"textContent\\": \\"SCRIPT_PLACEHOLDER\\", - \\"id\\": 66 + \\"id\\": 68 } ], - \\"id\\": 65 + \\"id\\": 67 }, { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\", - \\"id\\": 67 + \\"id\\": 69 } ], \\"id\\": 16 @@ -4936,8 +4951,23 @@ exports[`record integration tests > can use maskInputOptions to configure which }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"id\\": 63 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"123456\\" + }, + \\"childNodes\\": [], + \\"id\\": 64 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"id\\": 65 } ], \\"id\\": 18 @@ -4945,7 +4975,7 @@ exports[`record integration tests > can use maskInputOptions to configure which { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\", - \\"id\\": 64 + \\"id\\": 66 }, { \\"type\\": 2, @@ -4955,15 +4985,15 @@ exports[`record integration tests > can use maskInputOptions to configure which { \\"type\\": 3, \\"textContent\\": \\"SCRIPT_PLACEHOLDER\\", - \\"id\\": 66 + \\"id\\": 68 } ], - \\"id\\": 65 + \\"id\\": 67 }, { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\", - \\"id\\": 67 + \\"id\\": 69 } ], \\"id\\": 16 @@ -6763,8 +6793,23 @@ exports[`record integration tests > should mask inputs via function call 1`] = ` }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"id\\": 63 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"******\\" + }, + \\"childNodes\\": [], + \\"id\\": 64 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"id\\": 65 } ], \\"id\\": 18 @@ -6772,7 +6817,7 @@ exports[`record integration tests > should mask inputs via function call 1`] = ` { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\", - \\"id\\": 64 + \\"id\\": 66 }, { \\"type\\": 2, @@ -6782,15 +6827,15 @@ exports[`record integration tests > should mask inputs via function call 1`] = ` { \\"type\\": 3, \\"textContent\\": \\"SCRIPT_PLACEHOLDER\\", - \\"id\\": 66 + \\"id\\": 68 } ], - \\"id\\": 65 + \\"id\\": 67 }, { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\", - \\"id\\": 67 + \\"id\\": 69 } ], \\"id\\": 16 @@ -10591,8 +10636,23 @@ exports[`record integration tests > should not record input values if maskAllInp }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"id\\": 63 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"******\\" + }, + \\"childNodes\\": [], + \\"id\\": 64 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"id\\": 65 } ], \\"id\\": 18 @@ -10600,7 +10660,7 @@ exports[`record integration tests > should not record input values if maskAllInp { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\", - \\"id\\": 64 + \\"id\\": 66 }, { \\"type\\": 2, @@ -10610,15 +10670,15 @@ exports[`record integration tests > should not record input values if maskAllInp { \\"type\\": 3, \\"textContent\\": \\"SCRIPT_PLACEHOLDER\\", - \\"id\\": 66 + \\"id\\": 68 } ], - \\"id\\": 65 + \\"id\\": 67 }, { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\", - \\"id\\": 67 + \\"id\\": 69 } ], \\"id\\": 16 @@ -13705,8 +13765,23 @@ exports[`record integration tests > should record input userTriggered values if }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"id\\": 63 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"123456\\" + }, + \\"childNodes\\": [], + \\"id\\": 64 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"id\\": 65 } ], \\"id\\": 18 @@ -13714,7 +13789,7 @@ exports[`record integration tests > should record input userTriggered values if { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\", - \\"id\\": 64 + \\"id\\": 66 }, { \\"type\\": 2, @@ -13724,15 +13799,15 @@ exports[`record integration tests > should record input userTriggered values if { \\"type\\": 3, \\"textContent\\": \\"SCRIPT_PLACEHOLDER\\", - \\"id\\": 66 + \\"id\\": 68 } ], - \\"id\\": 65 + \\"id\\": 67 }, { \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n \\\\n\\\\n\\", - \\"id\\": 67 + \\"id\\": 69 } ], \\"id\\": 16 diff --git a/packages/rrweb/test/html/form.html b/packages/rrweb/test/html/form.html index 8480259fe0..69c7ce7836 100644 --- a/packages/rrweb/test/html/form.html +++ b/packages/rrweb/test/html/form.html @@ -34,6 +34,7 @@ + diff --git a/packages/rrweb/test/record/__snapshots__/cross-origin-iframes.test.ts.snap b/packages/rrweb/test/record/__snapshots__/cross-origin-iframes.test.ts.snap index 8cd9fce959..97bbd15f1b 100644 --- a/packages/rrweb/test/record/__snapshots__/cross-origin-iframes.test.ts.snap +++ b/packages/rrweb/test/record/__snapshots__/cross-origin-iframes.test.ts.snap @@ -1438,9 +1438,26 @@ exports[`cross origin iframes > form.html > should map input events correctly 1` }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"rootId\\": 11, \\"id\\": 75 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"123456\\" + }, + \\"childNodes\\": [], + \\"rootId\\": 11, + \\"id\\": 76 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"rootId\\": 11, + \\"id\\": 77 } ], \\"rootId\\": 11, @@ -1450,7 +1467,7 @@ exports[`cross origin iframes > form.html > should map input events correctly 1` \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n\\\\n\\", \\"rootId\\": 11, - \\"id\\": 76 + \\"id\\": 78 } ], \\"rootId\\": 11, @@ -2451,9 +2468,26 @@ exports[`cross origin iframes > form.html > should map scroll events correctly 1 }, { \\"type\\": 3, - \\"textContent\\": \\"\\\\n \\", + \\"textContent\\": \\"\\\\n \\", \\"rootId\\": 11, \\"id\\": 75 + }, + { + \\"type\\": 2, + \\"tagName\\": \\"input\\", + \\"attributes\\": { + \\"type\\": \\"hidden\\", + \\"value\\": \\"123456\\" + }, + \\"childNodes\\": [], + \\"rootId\\": 11, + \\"id\\": 76 + }, + { + \\"type\\": 3, + \\"textContent\\": \\"\\\\n \\", + \\"rootId\\": 11, + \\"id\\": 77 } ], \\"rootId\\": 11, @@ -2463,7 +2497,7 @@ exports[`cross origin iframes > form.html > should map scroll events correctly 1 \\"type\\": 3, \\"textContent\\": \\"\\\\n \\\\n\\\\n\\", \\"rootId\\": 11, - \\"id\\": 76 + \\"id\\": 78 } ], \\"rootId\\": 11, From f3e3789bb37ddc0980ed340fd08c1c4b015feca8 Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:42:35 +0000 Subject: [PATCH 06/33] bump mixpanel version --- packages/all/package.json | 2 +- packages/packer/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json | 2 +- packages/plugins/rrweb-plugin-console-record/package.json | 2 +- packages/plugins/rrweb-plugin-console-replay/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-record/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-replay/package.json | 2 +- packages/record/package.json | 2 +- packages/replay/package.json | 2 +- packages/rrdom-nodejs/package.json | 2 +- packages/rrdom/package.json | 2 +- packages/rrvideo/package.json | 2 +- packages/rrweb-player/package.json | 2 +- packages/rrweb-snapshot/package.json | 2 +- packages/rrweb/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- packages/web-extension/package.json | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/all/package.json b/packages/all/package.json index a31802a981..c2790c279e 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-all", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "publishConfig": { "access": "public" }, diff --git a/packages/packer/package.json b/packages/packer/package.json index 8003146635..d7800a5247 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-packer", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "publishConfig": { "access": "public" }, diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index 1576724a46..25dd677ff4 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-record", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index d9ee4b8aef..4e53febfd1 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-replay", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index baf5d5278c..a663ce9dbb 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-record", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index 4723995f6b..2e57143d53 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-replay", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index 8856af0ae4..ce8eec7014 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-record", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index 8a94f3b7f4..d58f36c8de 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-replay", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-replay.umd.cjs", diff --git a/packages/record/package.json b/packages/record/package.json index 4a1f21abaa..fa95a8260c 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-record", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "publishConfig": { "access": "public" }, diff --git a/packages/replay/package.json b/packages/replay/package.json index 7fea974a49..01da30a637 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-replay", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "publishConfig": { "access": "public" }, diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index eb941aa444..431c49bd4a 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom-nodejs", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "scripts": { "dev": "vite build --watch", "build": "yarn turbo run prepublish", diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index d2f853dca2..18d747877a 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", "type": "module", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index 808a980357..394656a04a 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrvideo", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "transform rrweb session into video", "main": "build/index.js", "bin": { diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index abb63e9666..1bd7251e03 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-player", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "devDependencies": { "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@sveltejs/adapter-auto": "^3.0.0", diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 824a74ec47..ab19f4edd1 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-snapshot", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { "prepare": "npm run prepack", diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index 38fcb77669..27318f37b1 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "record and replay the web", "scripts": { "prepare": "npm run prepack", diff --git a/packages/types/package.json b/packages/types/package.json index f528e704d7..d57b58428e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-types", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "publishConfig": { "access": "public" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index c1d14bb72d..914763791d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-utils", - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "publishConfig": { "access": "public" }, diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index 7248984701..085f89048e 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -1,7 +1,7 @@ { "name": "@mixpanel/rrweb-web-extension", "private": true, - "version": "2.0.0-alpha.18.1", + "version": "2.0.0-alpha.18.2", "description": "The web extension of rrweb which helps to run rrweb on any website out of box", "author": "rrweb-io", "license": "MIT", From 10356188701a1cd49756c96e10fefb84468e9393 Mon Sep 17 00:00:00 2001 From: Jakub Grzegorzewski <25271819+jakewski@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:58:09 +0000 Subject: [PATCH 07/33] fix changesets --- .changeset/config.json | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index 89ad04bbc7..844c3277b6 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,25 +4,24 @@ "commit": false, "fixed": [ [ - "rrweb", - "rrweb-snapshot", - "rrdom", - "rrdom-nodejs", - "rrweb-player", - "@rrweb/all", - "@rrweb/replay", - "@rrweb/record", - "@rrweb/types", - "@rrweb/packer", - "@rrweb/utils", - "@rrweb/web-extension", - "rrvideo", - "@rrweb/rrweb-plugin-console-record", - "@rrweb/rrweb-plugin-console-replay", - "@rrweb/rrweb-plugin-sequential-id-record", - "@rrweb/rrweb-plugin-sequential-id-replay", - "@rrweb/rrweb-plugin-canvas-webrtc-record", - "@rrweb/rrweb-plugin-canvas-webrtc-replay" + "@mixpanel/rrweb", + "@mixpanel/rrweb-snapshot", + "@mixpanel/rrdom", + "@mixpanel/rrdom-nodejs", + "@mixpanel/rrweb-player", + "@mixpanel/rrweb-all", + "@mixpanel/rrweb-replay", + "@mixpanel/rrweb-record", + "@mixpanel/rrweb-types", + "@mixpanel/rrweb-packer", + "@mixpanel/rrweb-utils", + "@mixpanel/rrvideo", + "@mixpanel/rrweb-plugin-console-record", + "@mixpanel/rrweb-plugin-console-replay", + "@mixpanel/rrweb-plugin-sequential-id-record", + "@mixpanel/rrweb-plugin-sequential-id-replay", + "@mixpanel/rrweb-plugin-canvas-webrtc-record", + "@mixpanel/rrweb-plugin-canvas-webrtc-replay" ] ], "linked": [], From 8f06cc0c5d050a6ac3d7758fd450559152200ab9 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:52:04 +0000 Subject: [PATCH 08/33] SRFE-8790 include cleanups for mutation observers and stylesheets --- packages/rrweb-snapshot/src/utils.ts | 12 ++++ packages/rrweb/src/record/iframe-manager.ts | 42 +++++++++++++ packages/rrweb/src/record/index.ts | 31 ++++++++-- packages/rrweb/src/record/mutation.ts | 24 +++++++- packages/rrweb/src/record/observer.ts | 9 +++ .../rrweb/src/record/stylesheet-manager.ts | 59 +++++++++++++++++++ packages/rrweb/src/utils.ts | 10 ++++ packages/types/src/index.ts | 2 + 8 files changed, 183 insertions(+), 6 deletions(-) diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index 102787c666..81da0fc38f 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -214,6 +214,18 @@ export class Mirror implements IMirror { ); } } + + removeNodeFromMapPermanently(n: Node) { + const id = this.getId(n); + this.idNodeMap.delete(id); + this.nodeMetaMap.delete(n); + + if (n.childNodes) { + n.childNodes.forEach((childNode) => + this.removeNodeFromMapPermanently(childNode as unknown as Node), + ); + } + } has(id: number): boolean { return this.idNodeMap.has(id); } diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 0451743619..4a24e48140 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -19,6 +19,10 @@ export class IframeManager { public crossOriginIframeStyleMirror: CrossOriginIframeMirror; public crossOriginIframeRootIdMap: WeakMap = new WeakMap(); + private iframeContentDocumentMap: WeakMap = + new WeakMap(); + private iframeObserverCleanupMap: WeakMap void> = + new WeakMap(); private mirror: Mirror; private mutationCb: mutationCallBack; private wrappedEmit: (e: eventWithoutTime, isCheckout?: boolean) => void; @@ -54,6 +58,40 @@ export class IframeManager { this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl); } + public getIframeContentDocument( + iframeEl: HTMLIFrameElement, + ): Document | undefined { + return this.iframeContentDocumentMap.get(iframeEl); + } + + public setObserverCleanup( + iframeEl: HTMLIFrameElement, + cleanup: () => void, + ): void { + this.iframeObserverCleanupMap.set(iframeEl, cleanup); + } + + public getObserverCleanup( + iframeEl: HTMLIFrameElement, + ): (() => void) | undefined { + return this.iframeObserverCleanupMap.get(iframeEl); + } + + public removeIframe(iframeEl: HTMLIFrameElement): void { + this.iframes.delete(iframeEl); + this.iframeContentDocumentMap.delete(iframeEl); + + const observerCleanup = this.iframeObserverCleanupMap.get(iframeEl); + if (observerCleanup) { + try { + observerCleanup(); + } catch (e) { + // Ignore errors during cleanup + } + this.iframeObserverCleanupMap.delete(iframeEl); + } + } + public addLoadListener(cb: (iframeEl: HTMLIFrameElement) => unknown) { this.loadListener = cb; } @@ -76,6 +114,10 @@ export class IframeManager { isAttachIframe: true, }); + if (iframeEl.contentDocument) { + this.iframeContentDocumentMap.set(iframeEl, iframeEl.contentDocument); + } + // Receive messages (events) coming from cross-origin iframes that are nested in this same-origin iframe. if (this.recordCrossOriginIframes) iframeEl.contentWindow?.addEventListener( diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 65da8ec801..fe610a995d 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -4,7 +4,7 @@ import { type SlimDOMOptions, createMirror, } from 'rrweb-snapshot'; -import { initObservers, mutationBuffers } from './observer'; +import { initObservers, mutationBuffers, removeMutationBufferForDoc } from './observer'; import { on, getWindowWidth, @@ -575,7 +575,28 @@ function record( iframeManager.addLoadListener((iframeEl) => { try { - handlers.push(observe(iframeEl.contentDocument!)); + const iframeDoc = iframeEl.contentDocument!; + const iframeHandler = observe(iframeDoc); + handlers.push(iframeHandler); + + const existingCleanup = iframeManager.getObserverCleanup(iframeEl); + iframeManager.setObserverCleanup(iframeEl, () => { + if (existingCleanup) { + try { + existingCleanup(); + } catch (e) { + // Ignore errors during cleanup + } + } + try { + iframeHandler(); + const idx = handlers.indexOf(iframeHandler); + if (idx !== -1) handlers.splice(idx, 1); + removeMutationBufferForDoc(iframeDoc); + } catch (e) { + // Ignore errors during cleanup + } + }); } catch (error) { // TODO: handle internal error console.warn(error); @@ -625,9 +646,9 @@ function record( /** * https://github.com/rrweb-io/rrweb/pull/1695 * This error can occur in a known scenario: - * If an iframe is initially same-origin and observed, but later its - location is changed in an opaque way to a cross-origin URL (perhaps within the iframe via its `document.location` or a redirect) - * attempting to execute the handler in the stop record function will + * If an iframe is initially same-origin and observed, but later its + location is changed in an opaque way to a cross-origin URL (perhaps within the iframe via its `document.location` or a redirect) + * attempting to execute the handler in the stop record function will throw a "cannot access cross-origin frame" error. * This error is expected and can be safely ignored. */ diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 08e927a98f..27b4b990b2 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -256,6 +256,10 @@ export default class MutationBuffer { this.canvasManager.reset(); } + public getDoc(): Document | undefined { + return this.doc; + } + public processMutations = (mutations: mutationRecord[]) => { mutations.forEach(this.processMutation); // adds mutations to the buffer this.emit(); // clears buffer if not locked/frozen @@ -363,7 +367,25 @@ export default class MutationBuffer { }; while (this.mapRemoves.length) { - this.mirror.removeNodeFromMap(this.mapRemoves.shift()!); + const removedNode = this.mapRemoves.shift()!; + + if (removedNode.nodeName === 'IFRAME') { + const iframeEl = removedNode as HTMLIFrameElement; + try { + const storedDoc = this.iframeManager.getIframeContentDocument(iframeEl); + this.stylesheetManager.cleanupStylesheetsForRemovedNode(removedNode, storedDoc); + if (storedDoc) { + this.mirror.removeNodeFromMapPermanently(storedDoc); + } + this.iframeManager.removeIframe(iframeEl); + } catch (e) { + // Ignore errors during iframe cleanup + } + } else { + this.stylesheetManager.cleanupStylesheetsForRemovedNode(removedNode); + } + + this.mirror.removeNodeFromMap(removedNode); } for (const n of this.movedSet) { diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index 8326d79651..23bb433644 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -102,6 +102,15 @@ export function initMutationObserver( return observer; } +export function removeMutationBufferForDoc(doc: Document): void { + for (let i = mutationBuffers.length - 1; i >= 0; i--) { + const buffer = mutationBuffers[i]; + if (buffer.getDoc() === doc) { + mutationBuffers.splice(i, 1); + } + } +} + function initMoveObserver({ mousemoveCb, sampling, diff --git a/packages/rrweb/src/record/stylesheet-manager.ts b/packages/rrweb/src/record/stylesheet-manager.ts index 8656c09c59..728b879b29 100644 --- a/packages/rrweb/src/record/stylesheet-manager.ts +++ b/packages/rrweb/src/record/stylesheet-manager.ts @@ -84,6 +84,65 @@ export class StylesheetManager { this.trackedLinkElements = new WeakSet(); } + /** + * Cleans up stylesheets associated with a removed node. + * + * @param removedNode - The node that was removed from the DOM. + * @param storedDocument - Optional stored document reference for iframes, + * since contentDocument becomes null after removal. + */ + public cleanupStylesheetsForRemovedNode( + removedNode: Node, + storedDocument?: Document, + ): void { + if (removedNode.nodeName === 'IFRAME') { + const iframe = removedNode as HTMLIFrameElement; + try { + const doc = storedDocument || iframe.contentDocument; + if (doc) { + if (doc.adoptedStyleSheets) { + for (const sheet of doc.adoptedStyleSheets) { + this.styleMirror.remove(sheet); + } + } + + const styleElements = doc.querySelectorAll('style, link[rel="stylesheet"]'); + styleElements.forEach((el) => { + const sheet = (el as HTMLStyleElement | HTMLLinkElement).sheet; + if (sheet) { + this.styleMirror.remove(sheet); + } + }); + } + } catch (e) { + // Ignore errors + } + } + + if (removedNode.nodeName === 'STYLE') { + const styleEl = removedNode as HTMLStyleElement; + if (styleEl.sheet) { + this.styleMirror.remove(styleEl.sheet); + } + } + + if ( + removedNode.nodeName === 'LINK' && + (removedNode as HTMLLinkElement).rel === 'stylesheet' + ) { + const linkEl = removedNode as HTMLLinkElement; + if (linkEl.sheet) { + this.styleMirror.remove(linkEl.sheet); + } + } + + if (removedNode.childNodes) { + removedNode.childNodes.forEach((child) => { + this.cleanupStylesheetsForRemovedNode(child); + }); + } + } + // TODO: take snapshot on stylesheet reload by applying event listener private trackStylesheetInLinkElement(_linkEl: HTMLLinkElement) { // linkEl.addEventListener('load', () => { diff --git a/packages/rrweb/src/utils.ts b/packages/rrweb/src/utils.ts index 13b15ec6c1..e68b1eb83a 100644 --- a/packages/rrweb/src/utils.ts +++ b/packages/rrweb/src/utils.ts @@ -501,6 +501,16 @@ export class StyleSheetMirror { generateId(): number { return this.id++; } + + remove(stylesheet: CSSStyleSheet): boolean { + const id = this.styleIDMap.get(stylesheet); + if (id !== undefined) { + this.styleIDMap.delete(stylesheet); + this.idStyleMap.delete(id); + return true; + } + return false; + } } /** diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index bba276e483..5bf967f849 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -830,6 +830,8 @@ export interface IMirror { removeNodeFromMap(n: TNode): void; + removeNodeFromMapPermanently?(n: TNode): void; + has(id: number): boolean; hasNode(node: TNode): boolean; From 2a586e595bbb025b692639fb180748631bd3dcd3 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Wed, 4 Feb 2026 18:36:58 +0000 Subject: [PATCH 09/33] Trigger CI From 21a9de03eeffd1051e62129cac499398e9cafc24 Mon Sep 17 00:00:00 2001 From: dhaval-valotia Date: Wed, 4 Feb 2026 18:38:07 +0000 Subject: [PATCH 10/33] Apply formatting changes --- packages/rrweb/src/record/index.ts | 6 +++++- packages/rrweb/src/record/mutation.ts | 8 ++++++-- packages/rrweb/src/record/stylesheet-manager.ts | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index fe610a995d..124fa6107c 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -4,7 +4,11 @@ import { type SlimDOMOptions, createMirror, } from 'rrweb-snapshot'; -import { initObservers, mutationBuffers, removeMutationBufferForDoc } from './observer'; +import { + initObservers, + mutationBuffers, + removeMutationBufferForDoc, +} from './observer'; import { on, getWindowWidth, diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 27b4b990b2..20c5b3da7e 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -372,8 +372,12 @@ export default class MutationBuffer { if (removedNode.nodeName === 'IFRAME') { const iframeEl = removedNode as HTMLIFrameElement; try { - const storedDoc = this.iframeManager.getIframeContentDocument(iframeEl); - this.stylesheetManager.cleanupStylesheetsForRemovedNode(removedNode, storedDoc); + const storedDoc = + this.iframeManager.getIframeContentDocument(iframeEl); + this.stylesheetManager.cleanupStylesheetsForRemovedNode( + removedNode, + storedDoc, + ); if (storedDoc) { this.mirror.removeNodeFromMapPermanently(storedDoc); } diff --git a/packages/rrweb/src/record/stylesheet-manager.ts b/packages/rrweb/src/record/stylesheet-manager.ts index 728b879b29..c0fbfc84a0 100644 --- a/packages/rrweb/src/record/stylesheet-manager.ts +++ b/packages/rrweb/src/record/stylesheet-manager.ts @@ -106,7 +106,9 @@ export class StylesheetManager { } } - const styleElements = doc.querySelectorAll('style, link[rel="stylesheet"]'); + const styleElements = doc.querySelectorAll( + 'style, link[rel="stylesheet"]', + ); styleElements.forEach((el) => { const sheet = (el as HTMLStyleElement | HTMLLinkElement).sheet; if (sheet) { From 9d6d2f65f2d76b93bd9d4f875d1fc0afefdf7d74 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Wed, 4 Feb 2026 18:58:57 +0000 Subject: [PATCH 11/33] add tests --- packages/rrweb-snapshot/test/utils.test.ts | 127 +++++++++++++++++++++ packages/rrweb/test/util.test.ts | 30 +++++ 2 files changed, 157 insertions(+) diff --git a/packages/rrweb-snapshot/test/utils.test.ts b/packages/rrweb-snapshot/test/utils.test.ts index 0a82d8c16c..41ef2767a8 100644 --- a/packages/rrweb-snapshot/test/utils.test.ts +++ b/packages/rrweb-snapshot/test/utils.test.ts @@ -7,6 +7,7 @@ import { extractFileExtension, fixSafariColons, isNodeMetaEqual, + Mirror, } from '../src/utils'; import { NodeType } from '@rrweb/types'; import type { serializedNode, serializedNodeWithId } from '@rrweb/types'; @@ -280,4 +281,130 @@ describe('utils', () => { expect(out3).toEqual('[data-aa\\:other] { color: red; }'); }); }); + + describe('Mirror', () => { + describe('removeNodeFromMapPermanently', () => { + it('should remove node from both idNodeMap and nodeMetaMap', () => { + const mirror = new Mirror(); + const div = document.createElement('div'); + const meta = { + type: NodeType.Element, + tagName: 'div', + attributes: {}, + childNodes: [], + id: 1, + } as serializedNodeWithId; + + mirror.add(div, meta); + expect(mirror.getId(div)).toBe(1); + expect(mirror.hasNode(div)).toBe(true); + expect(mirror.getNode(1)).toBe(div); + + mirror.removeNodeFromMapPermanently(div); + + expect(mirror.getId(div)).toBe(-1); + expect(mirror.hasNode(div)).toBe(false); + expect(mirror.getNode(1)).toBeNull(); + }); + + it('should recursively remove child nodes', () => { + const mirror = new Mirror(); + + const parent = document.createElement('div'); + const child1 = document.createElement('span'); + const child2 = document.createElement('p'); + const grandchild = document.createElement('a'); + + parent.appendChild(child1); + parent.appendChild(child2); + child1.appendChild(grandchild); + + const parentMeta = { + type: NodeType.Element, + tagName: 'div', + attributes: {}, + childNodes: [], + id: 1, + } as serializedNodeWithId; + const child1Meta = { + type: NodeType.Element, + tagName: 'span', + attributes: {}, + childNodes: [], + id: 2, + } as serializedNodeWithId; + const child2Meta = { + type: NodeType.Element, + tagName: 'p', + attributes: {}, + childNodes: [], + id: 3, + } as serializedNodeWithId; + const grandchildMeta = { + type: NodeType.Element, + tagName: 'a', + attributes: {}, + childNodes: [], + id: 4, + } as serializedNodeWithId; + + mirror.add(parent, parentMeta); + mirror.add(child1, child1Meta); + mirror.add(child2, child2Meta); + mirror.add(grandchild, grandchildMeta); + + expect(mirror.hasNode(parent)).toBe(true); + expect(mirror.hasNode(child1)).toBe(true); + expect(mirror.hasNode(child2)).toBe(true); + expect(mirror.hasNode(grandchild)).toBe(true); + + mirror.removeNodeFromMapPermanently(parent); + + expect(mirror.hasNode(parent)).toBe(false); + expect(mirror.hasNode(child1)).toBe(false); + expect(mirror.hasNode(child2)).toBe(false); + expect(mirror.hasNode(grandchild)).toBe(false); + expect(mirror.getId(parent)).toBe(-1); + expect(mirror.getId(child1)).toBe(-1); + expect(mirror.getId(child2)).toBe(-1); + expect(mirror.getId(grandchild)).toBe(-1); + }); + + it('should differ from removeNodeFromMap by also clearing nodeMetaMap', () => { + const mirror1 = new Mirror(); + const div1 = document.createElement('div'); + const meta1 = { + type: NodeType.Element, + tagName: 'div', + attributes: {}, + childNodes: [], + id: 1, + } as serializedNodeWithId; + + mirror1.add(div1, meta1); + mirror1.removeNodeFromMap(div1); + + // removeNodeFromMap only clears idNodeMap, not nodeMetaMap + expect(mirror1.getNode(1)).toBeNull(); + expect(mirror1.hasNode(div1)).toBe(true); // Still in nodeMetaMap + + const mirror2 = new Mirror(); + const div2 = document.createElement('div'); + const meta2 = { + type: NodeType.Element, + tagName: 'div', + attributes: {}, + childNodes: [], + id: 1, + } as serializedNodeWithId; + + mirror2.add(div2, meta2); + mirror2.removeNodeFromMapPermanently(div2); + + // removeNodeFromMapPermanently clears both maps + expect(mirror2.getNode(1)).toBeNull(); + expect(mirror2.hasNode(div2)).toBe(false); // Also removed from nodeMetaMap + }); + }); + }); }); diff --git a/packages/rrweb/test/util.test.ts b/packages/rrweb/test/util.test.ts index fda0030b67..801e425e8b 100644 --- a/packages/rrweb/test/util.test.ts +++ b/packages/rrweb/test/util.test.ts @@ -80,6 +80,36 @@ describe('Utilities for other modules', () => { for (let i = 0; i < 10; i++) expect(mirror.getStyle(i + 1)).toBeNull(); expect(mirror.add(new CSSStyleSheet())).toBe(1); }); + + it('can remove CSSStyleSheet from the mirror', () => { + const mirror = new StyleSheetMirror(); + const styleSheet = new CSSStyleSheet(); + mirror.add(styleSheet); + expect(mirror.has(styleSheet)).toBeTruthy(); + expect(mirror.remove(styleSheet)).toBe(true); + expect(mirror.has(styleSheet)).toBeFalsy(); + expect(mirror.getId(styleSheet)).toBe(-1); + }); + + it('returns false when removing a non-existent stylesheet', () => { + const mirror = new StyleSheetMirror(); + const styleSheet = new CSSStyleSheet(); + expect(mirror.remove(styleSheet)).toBe(false); + }); + + it('does not affect other stylesheets when removing one', () => { + const mirror = new StyleSheetMirror(); + const styleSheet1 = new CSSStyleSheet(); + const styleSheet2 = new CSSStyleSheet(); + mirror.add(styleSheet1); + mirror.add(styleSheet2); + const id2 = mirror.getId(styleSheet2); + mirror.remove(styleSheet1); + expect(mirror.has(styleSheet1)).toBeFalsy(); + expect(mirror.has(styleSheet2)).toBeTruthy(); + expect(mirror.getId(styleSheet2)).toBe(id2); + expect(mirror.getStyle(id2)).toBe(styleSheet2); + }); }); describe('inDom()', () => { From 21ff38fe7f3574d2a7d994986558e3b3ae3ff687 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:32:57 +0000 Subject: [PATCH 12/33] Address pr comments --- packages/rrdom/src/index.ts | 2 +- packages/rrweb-snapshot/src/utils.ts | 19 ++++--------------- packages/rrweb-snapshot/test/utils.test.ts | 12 ++++++------ packages/rrweb/src/record/iframe-manager.ts | 10 ++++++++++ packages/rrweb/src/record/mutation.ts | 12 +----------- packages/types/src/index.ts | 4 +--- 6 files changed, 23 insertions(+), 36 deletions(-) diff --git a/packages/rrdom/src/index.ts b/packages/rrdom/src/index.ts index e5984e580a..2222e0ed97 100644 --- a/packages/rrdom/src/index.ts +++ b/packages/rrdom/src/index.ts @@ -368,7 +368,7 @@ export class Mirror implements IMirror { // removes the node from idNodeMap // doesn't remove the node from nodeMetaMap - removeNodeFromMap(n: RRNode) { + removeNodeFromMap(n: RRNode, _permanent?: boolean) { const id = this.getId(n); this.idNodeMap.delete(id); diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index 81da0fc38f..4f1ef7f1d8 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -203,26 +203,15 @@ export class Mirror implements IMirror { } // removes the node from idNodeMap - // doesn't remove the node from nodeMetaMap - removeNodeFromMap(n: Node) { + // if permanent is true, also removes from nodeMetaMap + removeNodeFromMap(n: Node, permanent = false) { const id = this.getId(n); this.idNodeMap.delete(id); + if (permanent) this.nodeMetaMap.delete(n); if (n.childNodes) { n.childNodes.forEach((childNode) => - this.removeNodeFromMap(childNode as unknown as Node), - ); - } - } - - removeNodeFromMapPermanently(n: Node) { - const id = this.getId(n); - this.idNodeMap.delete(id); - this.nodeMetaMap.delete(n); - - if (n.childNodes) { - n.childNodes.forEach((childNode) => - this.removeNodeFromMapPermanently(childNode as unknown as Node), + this.removeNodeFromMap(childNode as unknown as Node, permanent), ); } } diff --git a/packages/rrweb-snapshot/test/utils.test.ts b/packages/rrweb-snapshot/test/utils.test.ts index 41ef2767a8..156bac353e 100644 --- a/packages/rrweb-snapshot/test/utils.test.ts +++ b/packages/rrweb-snapshot/test/utils.test.ts @@ -283,7 +283,7 @@ describe('utils', () => { }); describe('Mirror', () => { - describe('removeNodeFromMapPermanently', () => { + describe('removeNodeFromMap with permanent flag', () => { it('should remove node from both idNodeMap and nodeMetaMap', () => { const mirror = new Mirror(); const div = document.createElement('div'); @@ -300,7 +300,7 @@ describe('utils', () => { expect(mirror.hasNode(div)).toBe(true); expect(mirror.getNode(1)).toBe(div); - mirror.removeNodeFromMapPermanently(div); + mirror.removeNodeFromMap(div, true); expect(mirror.getId(div)).toBe(-1); expect(mirror.hasNode(div)).toBe(false); @@ -358,7 +358,7 @@ describe('utils', () => { expect(mirror.hasNode(child2)).toBe(true); expect(mirror.hasNode(grandchild)).toBe(true); - mirror.removeNodeFromMapPermanently(parent); + mirror.removeNodeFromMap(parent, true); expect(mirror.hasNode(parent)).toBe(false); expect(mirror.hasNode(child1)).toBe(false); @@ -370,7 +370,7 @@ describe('utils', () => { expect(mirror.getId(grandchild)).toBe(-1); }); - it('should differ from removeNodeFromMap by also clearing nodeMetaMap', () => { + it('should differ from non-permanent removeNodeFromMap by also clearing nodeMetaMap', () => { const mirror1 = new Mirror(); const div1 = document.createElement('div'); const meta1 = { @@ -399,9 +399,9 @@ describe('utils', () => { } as serializedNodeWithId; mirror2.add(div2, meta2); - mirror2.removeNodeFromMapPermanently(div2); + mirror2.removeNodeFromMap(div2, true); - // removeNodeFromMapPermanently clears both maps + // removeNodeFromMap with permanent=true clears both maps expect(mirror2.getNode(1)).toBeNull(); expect(mirror2.hasNode(div2)).toBe(false); // Also removed from nodeMetaMap }); diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 4a24e48140..ffd29765ac 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -78,6 +78,16 @@ export class IframeManager { } public removeIframe(iframeEl: HTMLIFrameElement): void { + const storedDoc = this.iframeContentDocumentMap.get(iframeEl); + + this.stylesheetManager.cleanupStylesheetsForRemovedNode( + iframeEl, + storedDoc, + ); + if (storedDoc) { + this.mirror.removeNodeFromMap(storedDoc, true); + } + this.iframes.delete(iframeEl); this.iframeContentDocumentMap.delete(iframeEl); diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 20c5b3da7e..0ee168f8a9 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -370,18 +370,8 @@ export default class MutationBuffer { const removedNode = this.mapRemoves.shift()!; if (removedNode.nodeName === 'IFRAME') { - const iframeEl = removedNode as HTMLIFrameElement; try { - const storedDoc = - this.iframeManager.getIframeContentDocument(iframeEl); - this.stylesheetManager.cleanupStylesheetsForRemovedNode( - removedNode, - storedDoc, - ); - if (storedDoc) { - this.mirror.removeNodeFromMapPermanently(storedDoc); - } - this.iframeManager.removeIframe(iframeEl); + this.iframeManager.removeIframe(removedNode as HTMLIFrameElement); } catch (e) { // Ignore errors during iframe cleanup } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 5bf967f849..384d1cd4f3 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -828,9 +828,7 @@ export interface IMirror { getMeta(n: TNode): serializedNodeWithId | null; - removeNodeFromMap(n: TNode): void; - - removeNodeFromMapPermanently?(n: TNode): void; + removeNodeFromMap(n: TNode, permanent?: boolean): void; has(id: number): boolean; From eebcd63a30eb83f352dd9e58eab04e7789519102 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:25:38 +0000 Subject: [PATCH 13/33] remove iframe handling in stylesheet manager --- packages/rrweb/src/record/iframe-manager.ts | 5 +- .../rrweb/src/record/stylesheet-manager.ts | 72 +++++++------------ 2 files changed, 28 insertions(+), 49 deletions(-) diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index ffd29765ac..8bcd6f401b 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -80,11 +80,8 @@ export class IframeManager { public removeIframe(iframeEl: HTMLIFrameElement): void { const storedDoc = this.iframeContentDocumentMap.get(iframeEl); - this.stylesheetManager.cleanupStylesheetsForRemovedNode( - iframeEl, - storedDoc, - ); if (storedDoc) { + this.stylesheetManager.cleanupStylesheetsForRemovedNode(storedDoc); this.mirror.removeNodeFromMap(storedDoc, true); } diff --git a/packages/rrweb/src/record/stylesheet-manager.ts b/packages/rrweb/src/record/stylesheet-manager.ts index c0fbfc84a0..6d49c5beab 100644 --- a/packages/rrweb/src/record/stylesheet-manager.ts +++ b/packages/rrweb/src/record/stylesheet-manager.ts @@ -88,60 +88,42 @@ export class StylesheetManager { * Cleans up stylesheets associated with a removed node. * * @param removedNode - The node that was removed from the DOM. - * @param storedDocument - Optional stored document reference for iframes, - * since contentDocument becomes null after removal. */ - public cleanupStylesheetsForRemovedNode( - removedNode: Node, - storedDocument?: Document, - ): void { - if (removedNode.nodeName === 'IFRAME') { - const iframe = removedNode as HTMLIFrameElement; - try { - const doc = storedDocument || iframe.contentDocument; - if (doc) { - if (doc.adoptedStyleSheets) { - for (const sheet of doc.adoptedStyleSheets) { - this.styleMirror.remove(sheet); - } + public cleanupStylesheetsForRemovedNode(removedNode: Node): void { + try { + if (removedNode.nodeType === Node.DOCUMENT_NODE) { + const doc = removedNode as Document; + if (doc.adoptedStyleSheets) { + for (const sheet of doc.adoptedStyleSheets) { + this.styleMirror.remove(sheet); } - - const styleElements = doc.querySelectorAll( - 'style, link[rel="stylesheet"]', - ); - styleElements.forEach((el) => { - const sheet = (el as HTMLStyleElement | HTMLLinkElement).sheet; - if (sheet) { - this.styleMirror.remove(sheet); - } - }); } - } catch (e) { - // Ignore errors } - } - if (removedNode.nodeName === 'STYLE') { - const styleEl = removedNode as HTMLStyleElement; - if (styleEl.sheet) { - this.styleMirror.remove(styleEl.sheet); + if (removedNode.nodeName === 'STYLE') { + const styleEl = removedNode as HTMLStyleElement; + if (styleEl.sheet) { + this.styleMirror.remove(styleEl.sheet); + } } - } - if ( - removedNode.nodeName === 'LINK' && - (removedNode as HTMLLinkElement).rel === 'stylesheet' - ) { - const linkEl = removedNode as HTMLLinkElement; - if (linkEl.sheet) { - this.styleMirror.remove(linkEl.sheet); + if ( + removedNode.nodeName === 'LINK' && + (removedNode as HTMLLinkElement).rel === 'stylesheet' + ) { + const linkEl = removedNode as HTMLLinkElement; + if (linkEl.sheet) { + this.styleMirror.remove(linkEl.sheet); + } } - } - if (removedNode.childNodes) { - removedNode.childNodes.forEach((child) => { - this.cleanupStylesheetsForRemovedNode(child); - }); + if (removedNode.childNodes) { + removedNode.childNodes.forEach((child) => { + this.cleanupStylesheetsForRemovedNode(child); + }); + } + } catch (e) { + // Ignore errors } } From 66223ba300b0ed45ba1b12cdff8528eca52b27dd Mon Sep 17 00:00:00 2001 From: dhaval-valotia Date: Thu, 19 Feb 2026 16:43:39 +0000 Subject: [PATCH 14/33] Apply formatting changes --- vite.config.default.ts | 54 ++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/vite.config.default.ts b/vite.config.default.ts index 9bcea16025..bd95b5a77e 100644 --- a/vite.config.default.ts +++ b/vite.config.default.ts @@ -150,24 +150,42 @@ export default function ( resolve: { alias: { // Map @rrweb scoped packages to the one in this repo so we don't have to update source imports to reference @mixpanel - "@rrweb/types": resolve(__dirname, "./packages/types"), - "@rrweb/utils": resolve(__dirname, "./packages/utils"), - "@rrweb/packer": resolve(__dirname, "./packages/packer"), - "@rrweb/record": resolve(__dirname, "./packages/record"), - "@rrweb/replay": resolve(__dirname, "./packages/replay"), - "@rrweb/all": resolve(__dirname, "./packages/all"), - "@rrweb/rrweb-plugin-console-record": resolve(__dirname, "./packages/plugins/rrweb-plugin-console-record"), - "@rrweb/rrweb-plugin-console-replay": resolve(__dirname, "./packages/plugins/rrweb-plugin-console-replay"), - "@rrweb/rrweb-plugin-sequential-id-record": resolve(__dirname, "./packages/plugins/rrweb-plugin-sequential-id-record"), - "@rrweb/rrweb-plugin-sequential-id-replay": resolve(__dirname, "./packages/plugins/rrweb-plugin-sequential-id-replay"), - "@rrweb/rrweb-plugin-canvas-webrtc-record": resolve(__dirname, "./packages/plugins/rrweb-plugin-canvas-webrtc-record"), - "@rrweb/rrweb-plugin-canvas-webrtc-replay": resolve(__dirname, "./packages/plugins/rrweb-plugin-canvas-webrtc-replay"), - "rrweb": resolve(__dirname, "./packages/rrweb"), - "rrweb-snapshot": resolve(__dirname, "./packages/rrweb-snapshot"), - "rrdom": resolve(__dirname, "./packages/rrdom"), - "rrdom-nodejs": resolve(__dirname, "./packages/rrdom-nodejs"), - "rrweb-player": resolve(__dirname, "./packages/rrweb-player"), - "rrvideo": resolve(__dirname, "./packages/rrvideo") + '@rrweb/types': resolve(__dirname, './packages/types'), + '@rrweb/utils': resolve(__dirname, './packages/utils'), + '@rrweb/packer': resolve(__dirname, './packages/packer'), + '@rrweb/record': resolve(__dirname, './packages/record'), + '@rrweb/replay': resolve(__dirname, './packages/replay'), + '@rrweb/all': resolve(__dirname, './packages/all'), + '@rrweb/rrweb-plugin-console-record': resolve( + __dirname, + './packages/plugins/rrweb-plugin-console-record', + ), + '@rrweb/rrweb-plugin-console-replay': resolve( + __dirname, + './packages/plugins/rrweb-plugin-console-replay', + ), + '@rrweb/rrweb-plugin-sequential-id-record': resolve( + __dirname, + './packages/plugins/rrweb-plugin-sequential-id-record', + ), + '@rrweb/rrweb-plugin-sequential-id-replay': resolve( + __dirname, + './packages/plugins/rrweb-plugin-sequential-id-replay', + ), + '@rrweb/rrweb-plugin-canvas-webrtc-record': resolve( + __dirname, + './packages/plugins/rrweb-plugin-canvas-webrtc-record', + ), + '@rrweb/rrweb-plugin-canvas-webrtc-replay': resolve( + __dirname, + './packages/plugins/rrweb-plugin-canvas-webrtc-replay', + ), + rrweb: resolve(__dirname, './packages/rrweb'), + 'rrweb-snapshot': resolve(__dirname, './packages/rrweb-snapshot'), + rrdom: resolve(__dirname, './packages/rrdom'), + 'rrdom-nodejs': resolve(__dirname, './packages/rrdom-nodejs'), + 'rrweb-player': resolve(__dirname, './packages/rrweb-player'), + rrvideo: resolve(__dirname, './packages/rrvideo'), }, }, From 3010641cac875d79da02f633f0033ea57392b90c Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:44:42 +0000 Subject: [PATCH 15/33] bump mixpanel version --- packages/all/package.json | 2 +- packages/packer/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json | 2 +- packages/plugins/rrweb-plugin-console-record/package.json | 2 +- packages/plugins/rrweb-plugin-console-replay/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-record/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-replay/package.json | 2 +- packages/record/package.json | 2 +- packages/replay/package.json | 2 +- packages/rrdom-nodejs/package.json | 2 +- packages/rrdom/package.json | 2 +- packages/rrvideo/package.json | 2 +- packages/rrweb-player/package.json | 2 +- packages/rrweb-snapshot/package.json | 2 +- packages/rrweb/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- packages/web-extension/package.json | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/all/package.json b/packages/all/package.json index c2790c279e..9058bbc2e1 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-all", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "publishConfig": { "access": "public" }, diff --git a/packages/packer/package.json b/packages/packer/package.json index d7800a5247..83922bf6ee 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-packer", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "publishConfig": { "access": "public" }, diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index 25dd677ff4..e0a131182b 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-record", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index 4e53febfd1..5fb48ae431 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-replay", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index a663ce9dbb..67f733b5c0 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-record", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index 2e57143d53..d8def1763c 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-replay", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index ce8eec7014..87ceaadfc3 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-record", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index d58f36c8de..e24962eecc 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-replay", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-replay.umd.cjs", diff --git a/packages/record/package.json b/packages/record/package.json index fa95a8260c..da95e2ab99 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-record", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "publishConfig": { "access": "public" }, diff --git a/packages/replay/package.json b/packages/replay/package.json index 01da30a637..f8e441cc38 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-replay", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "publishConfig": { "access": "public" }, diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index 431c49bd4a..13e6f16167 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom-nodejs", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "scripts": { "dev": "vite build --watch", "build": "yarn turbo run prepublish", diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index 18d747877a..64568650fc 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", "type": "module", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index 394656a04a..6de01d16ee 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrvideo", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "transform rrweb session into video", "main": "build/index.js", "bin": { diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index 1bd7251e03..c9174a3ddf 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-player", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "devDependencies": { "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@sveltejs/adapter-auto": "^3.0.0", diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index ab19f4edd1..4b4043bda9 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-snapshot", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { "prepare": "npm run prepack", diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index 27318f37b1..0018878d50 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "record and replay the web", "scripts": { "prepare": "npm run prepack", diff --git a/packages/types/package.json b/packages/types/package.json index d57b58428e..8a7b516dda 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-types", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "publishConfig": { "access": "public" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 914763791d..da0319e1c2 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-utils", - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "publishConfig": { "access": "public" }, diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index 085f89048e..fbcc2573f9 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -1,7 +1,7 @@ { "name": "@mixpanel/rrweb-web-extension", "private": true, - "version": "2.0.0-alpha.18.2", + "version": "2.0.0-alpha.18.3", "description": "The web extension of rrweb which helps to run rrweb on any website out of box", "author": "rrweb-io", "license": "MIT", From dad07de9ddbbda02131b82e8d912deafe22fd83f Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Fri, 27 Feb 2026 22:07:13 +0000 Subject: [PATCH 16/33] Add cross origin support --- .../rrweb/src/record/cross-origin-utils.ts | 32 +++++++ packages/rrweb/src/record/iframe-manager.ts | 7 +- packages/rrweb/src/record/index.ts | 24 ++++- packages/rrweb/src/types.ts | 1 + .../test/record/cross-origin-utils.test.ts | 87 +++++++++++++++++++ 5 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 packages/rrweb/src/record/cross-origin-utils.ts create mode 100644 packages/rrweb/test/record/cross-origin-utils.test.ts diff --git a/packages/rrweb/src/record/cross-origin-utils.ts b/packages/rrweb/src/record/cross-origin-utils.ts new file mode 100644 index 0000000000..b708cd0889 --- /dev/null +++ b/packages/rrweb/src/record/cross-origin-utils.ts @@ -0,0 +1,32 @@ +function toOrigin(url: string): string | null { + try { + const origin = new URL(url).origin; + return origin !== 'null' ? origin : null; + } catch { + return null; + } +} + +export function buildAllowedOriginSet(origins: string[]): ReadonlySet { + if (!Array.isArray(origins) || origins.length === 0) { + throw new Error( + '[rrweb] allowedOrigins must be a non-empty array of origin strings.', + ); + } + + const set = new Set(); + for (let i = 0; i < origins.length; i++) { + const entry = origins[i]; + if (typeof entry !== 'string') { + throw new Error( + `[rrweb] allowedOrigins[${i}] must be a string, got ${typeof entry}.`, + ); + } + const origin = toOrigin(entry); + if (origin) { + set.add(origin); + } + } + + return Object.freeze(set); +} diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 8bcd6f401b..5e78dad438 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -29,6 +29,7 @@ export class IframeManager { private loadListener?: (iframeEl: HTMLIFrameElement) => unknown; private stylesheetManager: StylesheetManager; private recordCrossOriginIframes: boolean; + private allowedOrigins?: ReadonlySet; constructor(options: { mirror: Mirror; @@ -36,11 +37,13 @@ export class IframeManager { stylesheetManager: StylesheetManager; recordCrossOriginIframes: boolean; wrappedEmit: (e: eventWithoutTime, isCheckout?: boolean) => void; + allowedOrigins?: ReadonlySet; }) { this.mutationCb = options.mutationCb; this.wrappedEmit = options.wrappedEmit; this.stylesheetManager = options.stylesheetManager; this.recordCrossOriginIframes = options.recordCrossOriginIframes; + this.allowedOrigins = options.allowedOrigins; this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror( this.stylesheetManager.styleMirror.generateId.bind( this.stylesheetManager.styleMirror, @@ -149,7 +152,9 @@ export class IframeManager { if ( crossOriginMessageEvent.data.type !== 'rrweb' || // To filter out the rrweb messages which are forwarded by some sites. - crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin + crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin || + // Drop messages from origins not in the allowlist. + (this.allowedOrigins && !this.allowedOrigins.has(crossOriginMessageEvent.origin)) ) return; diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index d1410c7956..db25986d0c 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -43,6 +43,7 @@ import { registerErrorHandler, unregisterErrorHandler, } from './error-handler'; +import { buildAllowedOriginSet } from './cross-origin-utils'; import dom from '@rrweb/utils'; let wrappedEmit!: (e: eventWithoutTime, isCheckout?: boolean) => void; @@ -92,7 +93,8 @@ function record( mousemoveWait, recordDOM = true, recordCanvas = false, - recordCrossOriginIframes = false, + recordCrossOriginIframes: _recordCrossOriginIframes = false, + allowedOrigins, recordAfter = options.recordAfter === 'DOMContentLoaded' ? options.recordAfter : 'load', @@ -107,6 +109,19 @@ function record( registerErrorHandler(errorHandler); + let recordCrossOriginIframes = _recordCrossOriginIframes; + let validatedOrigins: ReadonlySet | undefined; + if (recordCrossOriginIframes) { + if (!allowedOrigins || allowedOrigins.length === 0) { + recordCrossOriginIframes = false; + } else { + validatedOrigins = buildAllowedOriginSet(allowedOrigins); + if (validatedOrigins.size === 0) { + recordCrossOriginIframes = false; + } + } + } + const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true; @@ -231,7 +246,11 @@ function record( origin: window.location.origin, isCheckout, }; - window.parent.postMessage(message, '*'); + if (validatedOrigins) { + for (const targetOrigin of validatedOrigins) { + window.parent.postMessage(message, targetOrigin); + } + } } if (e.type === EventType.FullSnapshot) { @@ -304,6 +323,7 @@ function record( stylesheetManager: stylesheetManager, recordCrossOriginIframes, wrappedEmit, + allowedOrigins: validatedOrigins, }); /** diff --git a/packages/rrweb/src/types.ts b/packages/rrweb/src/types.ts index a03e326b6f..99d448370a 100644 --- a/packages/rrweb/src/types.ts +++ b/packages/rrweb/src/types.ts @@ -65,6 +65,7 @@ export type recordOptions = { recordDOM?: boolean; recordCanvas?: boolean; recordCrossOriginIframes?: boolean; + allowedOrigins?: string[]; recordAfter?: 'DOMContentLoaded' | 'load'; userTriggeredOnInput?: boolean; collectFonts?: boolean; diff --git a/packages/rrweb/test/record/cross-origin-utils.test.ts b/packages/rrweb/test/record/cross-origin-utils.test.ts new file mode 100644 index 0000000000..a177d3e493 --- /dev/null +++ b/packages/rrweb/test/record/cross-origin-utils.test.ts @@ -0,0 +1,87 @@ +import { describe, it, expect } from 'vitest'; +import { buildAllowedOriginSet } from '../../src/record/cross-origin-utils'; + +describe('buildAllowedOriginSet', () => { + it('should return a frozen Set for valid origins', () => { + const result = buildAllowedOriginSet([ + 'https://example.com', + 'https://app.example.com', + ]); + expect(result).toBeInstanceOf(Set); + expect(result.size).toBe(2); + expect(result.has('https://example.com')).toBe(true); + expect(result.has('https://app.example.com')).toBe(true); + expect(Object.isFrozen(result)).toBe(true); + }); + + it('should normalize URLs to their origins', () => { + const result = buildAllowedOriginSet([ + 'https://example.com/', + 'https://example.com/path/to/page', + 'https://app.example.com?foo=bar', + 'http://localhost:3000#hash', + ]); + expect(result.size).toBe(3); + expect(result.has('https://example.com')).toBe(true); + expect(result.has('https://app.example.com')).toBe(true); + expect(result.has('http://localhost:3000')).toBe(true); + }); + + it('should normalize default ports away', () => { + const result = buildAllowedOriginSet([ + 'https://example.com:443', + 'http://example.com:80', + ]); + expect(result.size).toBe(2); + expect(result.has('https://example.com')).toBe(true); + expect(result.has('http://example.com')).toBe(true); + }); + + it('should throw for empty array', () => { + expect(() => buildAllowedOriginSet([])).toThrow( + 'allowedOrigins must be a non-empty array', + ); + }); + + it('should throw for non-array', () => { + expect(() => + buildAllowedOriginSet(null as unknown as string[]), + ).toThrow('allowedOrigins must be a non-empty array'); + expect(() => + buildAllowedOriginSet(undefined as unknown as string[]), + ).toThrow('allowedOrigins must be a non-empty array'); + }); + + it('should throw for non-string entries', () => { + expect(() => + buildAllowedOriginSet([123 as unknown as string]), + ).toThrow('must be a string'); + }); + + it('should skip unparseable strings', () => { + const result = buildAllowedOriginSet([ + 'https://example.com', + 'not-a-url', + ]); + expect(result.size).toBe(1); + expect(result.has('https://example.com')).toBe(true); + }); + + it('should deduplicate origins', () => { + const result = buildAllowedOriginSet([ + 'https://example.com', + 'https://example.com', + ]); + expect(result.size).toBe(1); + }); + + it('should deduplicate after normalization', () => { + const result = buildAllowedOriginSet([ + 'https://example.com', + 'https://example.com/path', + 'https://example.com:443', + ]); + expect(result.size).toBe(1); + expect(result.has('https://example.com')).toBe(true); + }); +}); From efa288a4ab037a5a06bbf1eea1ad615645872620 Mon Sep 17 00:00:00 2001 From: dhaval-valotia Date: Fri, 27 Feb 2026 22:08:20 +0000 Subject: [PATCH 17/33] Apply formatting changes --- packages/rrweb/src/record/iframe-manager.ts | 3 ++- .../test/record/cross-origin-utils.test.ts | 17 +++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 5e78dad438..55969c47c3 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -154,7 +154,8 @@ export class IframeManager { // To filter out the rrweb messages which are forwarded by some sites. crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin || // Drop messages from origins not in the allowlist. - (this.allowedOrigins && !this.allowedOrigins.has(crossOriginMessageEvent.origin)) + (this.allowedOrigins && + !this.allowedOrigins.has(crossOriginMessageEvent.origin)) ) return; diff --git a/packages/rrweb/test/record/cross-origin-utils.test.ts b/packages/rrweb/test/record/cross-origin-utils.test.ts index a177d3e493..36de54fd23 100644 --- a/packages/rrweb/test/record/cross-origin-utils.test.ts +++ b/packages/rrweb/test/record/cross-origin-utils.test.ts @@ -44,25 +44,22 @@ describe('buildAllowedOriginSet', () => { }); it('should throw for non-array', () => { - expect(() => - buildAllowedOriginSet(null as unknown as string[]), - ).toThrow('allowedOrigins must be a non-empty array'); + expect(() => buildAllowedOriginSet(null as unknown as string[])).toThrow( + 'allowedOrigins must be a non-empty array', + ); expect(() => buildAllowedOriginSet(undefined as unknown as string[]), ).toThrow('allowedOrigins must be a non-empty array'); }); it('should throw for non-string entries', () => { - expect(() => - buildAllowedOriginSet([123 as unknown as string]), - ).toThrow('must be a string'); + expect(() => buildAllowedOriginSet([123 as unknown as string])).toThrow( + 'must be a string', + ); }); it('should skip unparseable strings', () => { - const result = buildAllowedOriginSet([ - 'https://example.com', - 'not-a-url', - ]); + const result = buildAllowedOriginSet(['https://example.com', 'not-a-url']); expect(result.size).toBe(1); expect(result.has('https://example.com')).toBe(true); }); From f97aa1642560dd452a81317916d23ae2b25ca18d Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:25:14 +0000 Subject: [PATCH 18/33] update tests --- .../test/cross-origin-iframe-packer.test.ts | 63 +++++++----- .../test/record/cross-origin-iframes.test.ts | 95 ++++++++++++------- 2 files changed, 102 insertions(+), 56 deletions(-) diff --git a/packages/all/test/cross-origin-iframe-packer.test.ts b/packages/all/test/cross-origin-iframe-packer.test.ts index f299581f62..d238f18525 100644 --- a/packages/all/test/cross-origin-iframe-packer.test.ts +++ b/packages/all/test/cross-origin-iframe-packer.test.ts @@ -50,35 +50,42 @@ interface IWindow extends Window { } type ExtraOptions = { usePackFn?: boolean; + crossOrigin?: boolean; }; async function injectRecordScript( frame: puppeteer.Frame, options?: ExtraOptions, + allowedOrigins?: string[], ) { await frame.addScriptTag({ path: path.resolve(__dirname, '../dist/rrweb-all.umd.cjs'), }); options = options || {}; - await frame.evaluate((options) => { - (window as unknown as IWindow).snapshots = []; - const { record, pack } = (window as unknown as IWindow).rrweb; - const config: recordOptions = { - recordCrossOriginIframes: true, - recordCanvas: true, - emit(event) { - (window as unknown as IWindow).snapshots.push(event); - (window as unknown as IWindow).emit(event); - }, - }; - if (options.usePackFn) { - config.packFn = pack; - } - record(config); - }, options); + await frame.evaluate( + (options, allowedOrigins) => { + (window as unknown as IWindow).snapshots = []; + const { record, pack } = (window as unknown as IWindow).rrweb; + const config: recordOptions = { + recordCrossOriginIframes: !!allowedOrigins, + recordCanvas: true, + allowedOrigins: allowedOrigins, + emit(event) { + (window as unknown as IWindow).snapshots.push(event); + (window as unknown as IWindow).emit(event); + }, + }; + if (options.usePackFn) { + config.packFn = pack; + } + record(config); + }, + options, + allowedOrigins, + ); for (const child of frame.childFrames()) { - await injectRecordScript(child, options); + await injectRecordScript(child, options, allowedOrigins); } } @@ -87,19 +94,24 @@ const setup = function ( content: string, options?: ExtraOptions, ): ISuite { - const ctx = {} as ISuite; + const ctx = {} as ISuite & { + serverB: http.Server; + serverBURL: string; + }; beforeAll(async () => { ctx.browser = await launchPuppeteer(); ctx.server = await startServer(); ctx.serverURL = getServerURL(ctx.server); + ctx.serverB = await startServer(); + ctx.serverBURL = getServerURL(ctx.serverB); }); beforeEach(async () => { ctx.page = await ctx.browser.newPage(); - await ctx.page.goto('about:blank'); + await ctx.page.goto(`${ctx.serverURL}/html/blank.html`); await ctx.page.setContent( - content.replace(/\{SERVER_URL\}/g, ctx.serverURL), + content.replace(/\{SERVER_URL\}/g, ctx.serverBURL), ); ctx.events = []; await ctx.page.exposeFunction('emit', (e: eventWithTime) => { @@ -110,7 +122,10 @@ const setup = function ( }); ctx.page.on('console', (msg) => console.log('PAGE LOG:', msg.text())); - await injectRecordScript(ctx.page.mainFrame(), options); + const allowedOrigins = options?.crossOrigin + ? [ctx.serverURL, ctx.serverBURL] + : undefined; + await injectRecordScript(ctx.page.mainFrame(), options, allowedOrigins); }); afterEach(async () => { @@ -120,6 +135,7 @@ const setup = function ( afterAll(async () => { await ctx.browser.close(); ctx.server.close(); + ctx.serverB.close(); }); return ctx; @@ -137,7 +153,10 @@ describe('cross origin iframes & packer', function (this: ISuite) { `; - const ctx = setup.call(this, content, { usePackFn: true }); + const ctx = setup.call(this, content, { + usePackFn: true, + crossOrigin: true, + }); describe('should support packFn option in record()', () => { it('', async () => { diff --git a/packages/rrweb/test/record/cross-origin-iframes.test.ts b/packages/rrweb/test/record/cross-origin-iframes.test.ts index cd6738fa78..b803c3dc05 100644 --- a/packages/rrweb/test/record/cross-origin-iframes.test.ts +++ b/packages/rrweb/test/record/cross-origin-iframes.test.ts @@ -40,11 +40,13 @@ interface IWindow extends Window { } type ExtraOptions = { usePackFn?: boolean; + crossOrigin?: boolean; }; async function injectRecordScript( frame: puppeteer.Frame, options?: ExtraOptions, + allowedOrigins?: string[], ) { try { await frame.addScriptTag({ @@ -58,26 +60,31 @@ async function injectRecordScript( !e.message.includes('DOM.describeNode') ) throw e; - await injectRecordScript(frame, options); + await injectRecordScript(frame, options, allowedOrigins); return; } options = options || {}; - await frame.evaluate((options) => { - (window as unknown as IWindow).snapshots = []; - const { record } = (window as unknown as IWindow).rrweb; - const config: recordOptions = { - recordCrossOriginIframes: true, - recordCanvas: true, - emit(event) { - (window as unknown as IWindow).snapshots.push(event); - (window as unknown as IWindow).emit(event); - }, - }; - record(config); - }, options); + await frame.evaluate( + (options, allowedOrigins) => { + (window as unknown as IWindow).snapshots = []; + const { record } = (window as unknown as IWindow).rrweb; + const config: recordOptions = { + recordCrossOriginIframes: !!allowedOrigins, + recordCanvas: true, + allowedOrigins: allowedOrigins, + emit(event) { + (window as unknown as IWindow).snapshots.push(event); + (window as unknown as IWindow).emit(event); + }, + }; + record(config); + }, + options, + allowedOrigins, + ); for (const child of frame.childFrames()) { - await injectRecordScript(child, options); + await injectRecordScript(child, options, allowedOrigins); } } @@ -104,11 +111,10 @@ const setup = function ( beforeEach(async () => { ctx.page = await ctx.browser.newPage(); - await ctx.page.goto('about:blank'); + await ctx.page.goto(`${ctx.serverURL}/html/blank.html`); await ctx.page.setContent( - content.replace(/\{SERVER_URL\}/g, ctx.serverURL), + content.replace(/\{SERVER_URL\}/g, ctx.serverBURL), ); - // await ctx.page.evaluate(ctx.code); ctx.events = []; await ctx.page.exposeFunction('emit', (e: eventWithTime) => { if (e.type === EventType.DomContentLoaded || e.type === EventType.Load) { @@ -118,7 +124,10 @@ const setup = function ( }); ctx.page.on('console', (msg) => console.log('PAGE LOG:', msg.text())); - await injectRecordScript(ctx.page.mainFrame(), options); + const allowedOrigins = options?.crossOrigin + ? [ctx.serverURL, ctx.serverBURL] + : undefined; + await injectRecordScript(ctx.page.mainFrame(), options, allowedOrigins); }); afterEach(async () => { @@ -138,7 +147,7 @@ describe('cross origin iframes', function (this: ISuite) { vi.setConfig({ testTimeout: 100_000 }); describe('form.html', function (this: ISuite) { - const ctx: ISuite = setup.call( + const ctx = setup.call( this, ` @@ -148,7 +157,8 @@ describe('cross origin iframes', function (this: ISuite) { `, - ); + { crossOrigin: true }, + ) as ISuite & { serverBURL: string }; it("won't emit events if it isn't in the top level iframe", async () => { const el = (await ctx.page.$( @@ -214,12 +224,16 @@ describe('cross origin iframes', function (this: ISuite) { await ctx.page.evaluate((url) => { const iframe = document.querySelector('iframe') as HTMLIFrameElement; iframe.src = `${url}/html/empty.html`; - }, ctx.serverURL); + }, ctx.serverBURL); await waitForRAF(ctx.page); // should load iframe (but sometimes doesn't) const frame = ctx.page.mainFrame().childFrames()[0]; await frame.waitForSelector('#one'); // ensure frame has changed - await injectRecordScript(ctx.page.mainFrame().childFrames()[0]); // injects script into new iframe + await injectRecordScript( + ctx.page.mainFrame().childFrames()[0], + undefined, + [ctx.serverURL, ctx.serverBURL], + ); // injects script into new iframe const events: eventWithTime[] = await ctx.page.evaluate( () => (window as unknown as IWindow).snapshots, @@ -277,7 +291,7 @@ describe('cross origin iframes', function (this: ISuite) { }); describe('move-node.html', function (this: ISuite) { - const ctx: ISuite = setup.call( + const ctx = setup.call( this, ` @@ -287,7 +301,8 @@ describe('cross origin iframes', function (this: ISuite) { `, - ); + { crossOrigin: true }, + ) as ISuite & { serverBURL: string }; it('should record DOM node movement', async () => { const frame = ctx.page.mainFrame().childFrames()[0]; @@ -494,7 +509,7 @@ describe('cross origin iframes', function (this: ISuite) { describe('audio.html', function (this: ISuite) { vi.setConfig({ testTimeout: 100_000 }); - const ctx: ISuite = setup.call( + const ctx = setup.call( this, ` @@ -504,7 +519,8 @@ describe('cross origin iframes', function (this: ISuite) { `, - ); + { crossOrigin: true }, + ) as ISuite & { serverBURL: string }; it('should emit contents of iframe once', async () => { const frame = ctx.page.mainFrame().childFrames()[0]; @@ -529,7 +545,7 @@ describe('cross origin iframes', function (this: ISuite) { `; - const ctx = setup.call(this, content) as ISuite & { + const ctx = setup.call(this, content, { crossOrigin: true }) as ISuite & { serverBURL: string; }; @@ -553,7 +569,7 @@ describe('cross origin iframes', function (this: ISuite) { it('should filter out forwarded cross origin rrweb messages', async () => { const frame = ctx.page.mainFrame().childFrames()[0]; - const iframe2URL = `${ctx.serverBURL}/html/blank.html`; + const iframe2URL = `${ctx.serverURL}/html/blank.html?iframe2`; await frame.evaluate((iframe2URL) => { // Add a message proxy to forward messages from child frames to its parent frame. window.addEventListener('message', (event) => { @@ -569,9 +585,16 @@ describe('cross origin iframes', function (this: ISuite) { await ctx.page.waitForFrame(iframe2URL); const iframe2 = frame.childFrames()[0]; // Record iframe2 - await injectRecordScript(iframe2); + await injectRecordScript(iframe2, undefined, [ + ctx.serverURL, + ctx.serverBURL, + ]); + // Wait for the 2-hop postMessage chain (iframe2 → iframe1 → parent). + // Each frame has its own event loop, so wait on each in order. await waitForRAF(iframe2); + await waitForRAF(frame); + await waitForRAF(ctx.page); const snapshots = (await ctx.page.evaluate( 'window.snapshots', )) as eventWithTime[]; @@ -583,7 +606,7 @@ describe('cross origin iframes', function (this: ISuite) { describe('same origin iframes', function (this: ISuite) { vi.setConfig({ testTimeout: 100_000 }); - const ctx: ISuite = setup.call( + const ctx = setup.call( this, ` @@ -593,7 +616,8 @@ describe('same origin iframes', function (this: ISuite) { `, - ); + { crossOrigin: true }, + ) as ISuite & { serverBURL: string }; it('should emit contents of iframe once', async () => { const events = await ctx.page.evaluate( @@ -618,10 +642,13 @@ describe('same origin iframes', function (this: ISuite) { return new Promise((resolve) => { crossOriginIframe.onload = resolve; }); - }, ctx.serverURL); + }, ctx.serverBURL); const crossOriginIframe = sameOriginIframe.childFrames()[0]; // Inject recording script into this cross-origin iframe - await injectRecordScript(crossOriginIframe); + await injectRecordScript(crossOriginIframe, undefined, [ + ctx.serverURL, + ctx.serverBURL, + ]); await waitForRAF(ctx.page); const snapshots = (await ctx.page.evaluate( From dfeeb602d7fa6d0496f9c7d9cc33d6708bc36f61 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Wed, 4 Mar 2026 22:48:34 +0000 Subject: [PATCH 19/33] Ignore media interactions if not a supported media element during replay SR-490 --- packages/rrweb/src/replay/index.ts | 3 +++ packages/rrweb/src/replay/media/index.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index 5f1101cc23..21adec8db9 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -1302,6 +1302,9 @@ export class Replayer { if (!target) { return this.debugNodeNotFound(d, d.id); } + if (!this.mediaManager.isSupportedMediaElement(target)) { + return this.debugNodeNotFound(d, d.id); + } const mediaEl = target as HTMLMediaElement | RRMediaElement; const { events } = this.service.state.context; diff --git a/packages/rrweb/src/replay/media/index.ts b/packages/rrweb/src/replay/media/index.ts index ef577cafa0..93adf6fdd4 100644 --- a/packages/rrweb/src/replay/media/index.ts +++ b/packages/rrweb/src/replay/media/index.ts @@ -285,7 +285,9 @@ export class MediaManager { this.syncTargetWithState(target); } - public isSupportedMediaElement(node: Node): node is HTMLMediaElement { + public isSupportedMediaElement( + node: Node | { nodeName: string }, + ): boolean { return ['AUDIO', 'VIDEO'].includes(node.nodeName); } From 01e8c2962ad40444b80ca03b165314c6b899d0ae Mon Sep 17 00:00:00 2001 From: dhaval-valotia Date: Wed, 4 Mar 2026 22:49:35 +0000 Subject: [PATCH 20/33] Apply formatting changes --- packages/rrweb/src/replay/media/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/rrweb/src/replay/media/index.ts b/packages/rrweb/src/replay/media/index.ts index 93adf6fdd4..01e1b5e080 100644 --- a/packages/rrweb/src/replay/media/index.ts +++ b/packages/rrweb/src/replay/media/index.ts @@ -285,9 +285,7 @@ export class MediaManager { this.syncTargetWithState(target); } - public isSupportedMediaElement( - node: Node | { nodeName: string }, - ): boolean { + public isSupportedMediaElement(node: Node | { nodeName: string }): boolean { return ['AUDIO', 'VIDEO'].includes(node.nodeName); } From 23d0e1f00ce77a22ecd382842992a5e77f106cfb Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 10 Mar 2026 17:39:14 +0000 Subject: [PATCH 21/33] SRFE-8790 cleanup child nodes recursively --- packages/rrweb/src/record/mutation.ts | 32 ++++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 0ee168f8a9..616d257e73 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -368,17 +368,7 @@ export default class MutationBuffer { while (this.mapRemoves.length) { const removedNode = this.mapRemoves.shift()!; - - if (removedNode.nodeName === 'IFRAME') { - try { - this.iframeManager.removeIframe(removedNode as HTMLIFrameElement); - } catch (e) { - // Ignore errors during iframe cleanup - } - } else { - this.stylesheetManager.cleanupStylesheetsForRemovedNode(removedNode); - } - + this.cleanupRemovedNode(removedNode); this.mirror.removeNodeFromMap(removedNode); } @@ -817,6 +807,26 @@ export default class MutationBuffer { } } }; + + private cleanupRemovedNode = (node: Node) => { + if (node.nodeName === 'IFRAME') { + try { + this.iframeManager.removeIframe(node as HTMLIFrameElement); + } catch (e) { + // Ignore errors during iframe cleanup + } + } else { + try { + this.stylesheetManager.cleanupStylesheetsForRemovedNode(node); + } catch (e) { + // Ignore errors during stylesheet cleanup + } + } + + node.childNodes.forEach((child) => { + this.cleanupRemovedNode(child); + }); + }; } /** From 1079fe7b74850c3518d743810e9d15fa1662bcc8 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:57:14 +0000 Subject: [PATCH 22/33] Rename to allowedIframOrigin and fallback to * --- .../rrweb/src/record/cross-origin-utils.ts | 4 ++-- packages/rrweb/src/record/iframe-manager.ts | 10 +++++----- packages/rrweb/src/record/index.ts | 20 +++++++++---------- packages/rrweb/src/types.ts | 2 +- .../test/record/cross-origin-iframes.test.ts | 2 +- .../test/record/cross-origin-utils.test.ts | 6 +++--- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/packages/rrweb/src/record/cross-origin-utils.ts b/packages/rrweb/src/record/cross-origin-utils.ts index b708cd0889..00f17c8f81 100644 --- a/packages/rrweb/src/record/cross-origin-utils.ts +++ b/packages/rrweb/src/record/cross-origin-utils.ts @@ -10,7 +10,7 @@ function toOrigin(url: string): string | null { export function buildAllowedOriginSet(origins: string[]): ReadonlySet { if (!Array.isArray(origins) || origins.length === 0) { throw new Error( - '[rrweb] allowedOrigins must be a non-empty array of origin strings.', + '[rrweb] allowedIframeOrigins must be a non-empty array of origin strings.', ); } @@ -19,7 +19,7 @@ export function buildAllowedOriginSet(origins: string[]): ReadonlySet { const entry = origins[i]; if (typeof entry !== 'string') { throw new Error( - `[rrweb] allowedOrigins[${i}] must be a string, got ${typeof entry}.`, + `[rrweb] allowedIframeOrigins[${i}] must be a string, got ${typeof entry}.`, ); } const origin = toOrigin(entry); diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 55969c47c3..334d4cd3cd 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -29,7 +29,7 @@ export class IframeManager { private loadListener?: (iframeEl: HTMLIFrameElement) => unknown; private stylesheetManager: StylesheetManager; private recordCrossOriginIframes: boolean; - private allowedOrigins?: ReadonlySet; + private allowedIframeOrigins?: ReadonlySet; constructor(options: { mirror: Mirror; @@ -37,13 +37,13 @@ export class IframeManager { stylesheetManager: StylesheetManager; recordCrossOriginIframes: boolean; wrappedEmit: (e: eventWithoutTime, isCheckout?: boolean) => void; - allowedOrigins?: ReadonlySet; + allowedIframeOrigins?: ReadonlySet; }) { this.mutationCb = options.mutationCb; this.wrappedEmit = options.wrappedEmit; this.stylesheetManager = options.stylesheetManager; this.recordCrossOriginIframes = options.recordCrossOriginIframes; - this.allowedOrigins = options.allowedOrigins; + this.allowedIframeOrigins = options.allowedIframeOrigins; this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror( this.stylesheetManager.styleMirror.generateId.bind( this.stylesheetManager.styleMirror, @@ -154,8 +154,8 @@ export class IframeManager { // To filter out the rrweb messages which are forwarded by some sites. crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin || // Drop messages from origins not in the allowlist. - (this.allowedOrigins && - !this.allowedOrigins.has(crossOriginMessageEvent.origin)) + (this.allowedIframeOrigins && + !this.allowedIframeOrigins.has(crossOriginMessageEvent.origin)) ) return; diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index db25986d0c..58db78843c 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -94,7 +94,7 @@ function record( recordDOM = true, recordCanvas = false, recordCrossOriginIframes: _recordCrossOriginIframes = false, - allowedOrigins, + allowedIframeOrigins, recordAfter = options.recordAfter === 'DOMContentLoaded' ? options.recordAfter : 'load', @@ -109,16 +109,12 @@ function record( registerErrorHandler(errorHandler); - let recordCrossOriginIframes = _recordCrossOriginIframes; + const recordCrossOriginIframes = _recordCrossOriginIframes; let validatedOrigins: ReadonlySet | undefined; - if (recordCrossOriginIframes) { - if (!allowedOrigins || allowedOrigins.length === 0) { - recordCrossOriginIframes = false; - } else { - validatedOrigins = buildAllowedOriginSet(allowedOrigins); - if (validatedOrigins.size === 0) { - recordCrossOriginIframes = false; - } + if (recordCrossOriginIframes && allowedIframeOrigins && allowedIframeOrigins.length > 0) { + validatedOrigins = buildAllowedOriginSet(allowedIframeOrigins); + if (validatedOrigins.size === 0) { + validatedOrigins = undefined; } } @@ -250,6 +246,8 @@ function record( for (const targetOrigin of validatedOrigins) { window.parent.postMessage(message, targetOrigin); } + } else { + window.parent.postMessage(message, '*'); } } @@ -323,7 +321,7 @@ function record( stylesheetManager: stylesheetManager, recordCrossOriginIframes, wrappedEmit, - allowedOrigins: validatedOrigins, + allowedIframeOrigins: validatedOrigins, }); /** diff --git a/packages/rrweb/src/types.ts b/packages/rrweb/src/types.ts index 99d448370a..fe77240c68 100644 --- a/packages/rrweb/src/types.ts +++ b/packages/rrweb/src/types.ts @@ -65,7 +65,7 @@ export type recordOptions = { recordDOM?: boolean; recordCanvas?: boolean; recordCrossOriginIframes?: boolean; - allowedOrigins?: string[]; + allowedIframeOrigins?: string[]; recordAfter?: 'DOMContentLoaded' | 'load'; userTriggeredOnInput?: boolean; collectFonts?: boolean; diff --git a/packages/rrweb/test/record/cross-origin-iframes.test.ts b/packages/rrweb/test/record/cross-origin-iframes.test.ts index b803c3dc05..01ec84d693 100644 --- a/packages/rrweb/test/record/cross-origin-iframes.test.ts +++ b/packages/rrweb/test/record/cross-origin-iframes.test.ts @@ -71,7 +71,7 @@ async function injectRecordScript( const config: recordOptions = { recordCrossOriginIframes: !!allowedOrigins, recordCanvas: true, - allowedOrigins: allowedOrigins, + allowedIframeOrigins: allowedOrigins, emit(event) { (window as unknown as IWindow).snapshots.push(event); (window as unknown as IWindow).emit(event); diff --git a/packages/rrweb/test/record/cross-origin-utils.test.ts b/packages/rrweb/test/record/cross-origin-utils.test.ts index 36de54fd23..43be818cfd 100644 --- a/packages/rrweb/test/record/cross-origin-utils.test.ts +++ b/packages/rrweb/test/record/cross-origin-utils.test.ts @@ -39,17 +39,17 @@ describe('buildAllowedOriginSet', () => { it('should throw for empty array', () => { expect(() => buildAllowedOriginSet([])).toThrow( - 'allowedOrigins must be a non-empty array', + 'allowedIframeOrigins must be a non-empty array', ); }); it('should throw for non-array', () => { expect(() => buildAllowedOriginSet(null as unknown as string[])).toThrow( - 'allowedOrigins must be a non-empty array', + 'allowedIframeOrigins must be a non-empty array', ); expect(() => buildAllowedOriginSet(undefined as unknown as string[]), - ).toThrow('allowedOrigins must be a non-empty array'); + ).toThrow('allowedIframeOrigins must be a non-empty array'); }); it('should throw for non-string entries', () => { From 42c8574133411889e4a75e4816e14c10e692d589 Mon Sep 17 00:00:00 2001 From: dhaval-valotia Date: Thu, 12 Mar 2026 18:58:16 +0000 Subject: [PATCH 23/33] Apply formatting changes --- packages/rrweb/src/record/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 58db78843c..1e1f11bd7b 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -111,7 +111,11 @@ function record( const recordCrossOriginIframes = _recordCrossOriginIframes; let validatedOrigins: ReadonlySet | undefined; - if (recordCrossOriginIframes && allowedIframeOrigins && allowedIframeOrigins.length > 0) { + if ( + recordCrossOriginIframes && + allowedIframeOrigins && + allowedIframeOrigins.length > 0 + ) { validatedOrigins = buildAllowedOriginSet(allowedIframeOrigins); if (validatedOrigins.size === 0) { validatedOrigins = undefined; From fea6fa49628897258e8be0e1ac5419e18b9c6561 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:09:48 +0000 Subject: [PATCH 24/33] Remove check on parent side --- packages/all/test/cross-origin-iframe-packer.test.ts | 2 +- packages/rrweb/src/record/iframe-manager.ts | 8 +------- packages/rrweb/src/record/index.ts | 4 +--- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/all/test/cross-origin-iframe-packer.test.ts b/packages/all/test/cross-origin-iframe-packer.test.ts index d238f18525..3fe583fa9f 100644 --- a/packages/all/test/cross-origin-iframe-packer.test.ts +++ b/packages/all/test/cross-origin-iframe-packer.test.ts @@ -69,7 +69,7 @@ async function injectRecordScript( const config: recordOptions = { recordCrossOriginIframes: !!allowedOrigins, recordCanvas: true, - allowedOrigins: allowedOrigins, + allowedIframeOrigins: allowedOrigins, emit(event) { (window as unknown as IWindow).snapshots.push(event); (window as unknown as IWindow).emit(event); diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 334d4cd3cd..8bcd6f401b 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -29,7 +29,6 @@ export class IframeManager { private loadListener?: (iframeEl: HTMLIFrameElement) => unknown; private stylesheetManager: StylesheetManager; private recordCrossOriginIframes: boolean; - private allowedIframeOrigins?: ReadonlySet; constructor(options: { mirror: Mirror; @@ -37,13 +36,11 @@ export class IframeManager { stylesheetManager: StylesheetManager; recordCrossOriginIframes: boolean; wrappedEmit: (e: eventWithoutTime, isCheckout?: boolean) => void; - allowedIframeOrigins?: ReadonlySet; }) { this.mutationCb = options.mutationCb; this.wrappedEmit = options.wrappedEmit; this.stylesheetManager = options.stylesheetManager; this.recordCrossOriginIframes = options.recordCrossOriginIframes; - this.allowedIframeOrigins = options.allowedIframeOrigins; this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror( this.stylesheetManager.styleMirror.generateId.bind( this.stylesheetManager.styleMirror, @@ -152,10 +149,7 @@ export class IframeManager { if ( crossOriginMessageEvent.data.type !== 'rrweb' || // To filter out the rrweb messages which are forwarded by some sites. - crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin || - // Drop messages from origins not in the allowlist. - (this.allowedIframeOrigins && - !this.allowedIframeOrigins.has(crossOriginMessageEvent.origin)) + crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin ) return; diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 1e1f11bd7b..f8f0982b67 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -93,7 +93,7 @@ function record( mousemoveWait, recordDOM = true, recordCanvas = false, - recordCrossOriginIframes: _recordCrossOriginIframes = false, + recordCrossOriginIframes = false, allowedIframeOrigins, recordAfter = options.recordAfter === 'DOMContentLoaded' ? options.recordAfter @@ -109,7 +109,6 @@ function record( registerErrorHandler(errorHandler); - const recordCrossOriginIframes = _recordCrossOriginIframes; let validatedOrigins: ReadonlySet | undefined; if ( recordCrossOriginIframes && @@ -325,7 +324,6 @@ function record( stylesheetManager: stylesheetManager, recordCrossOriginIframes, wrappedEmit, - allowedIframeOrigins: validatedOrigins, }); /** From 0b3f24cc89dd254b8f490d0c033d1cb5f42b5489 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Mon, 16 Mar 2026 16:29:39 +0000 Subject: [PATCH 25/33] Bump mixpanel version --- packages/all/package.json | 2 +- packages/packer/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json | 2 +- packages/plugins/rrweb-plugin-console-record/package.json | 2 +- packages/plugins/rrweb-plugin-console-replay/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-record/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-replay/package.json | 2 +- packages/record/package.json | 2 +- packages/replay/package.json | 2 +- packages/rrdom-nodejs/package.json | 2 +- packages/rrdom/package.json | 2 +- packages/rrvideo/package.json | 2 +- packages/rrweb-player/package.json | 2 +- packages/rrweb-snapshot/package.json | 2 +- packages/rrweb/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- packages/web-extension/package.json | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/all/package.json b/packages/all/package.json index 9058bbc2e1..4642df52da 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-all", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "publishConfig": { "access": "public" }, diff --git a/packages/packer/package.json b/packages/packer/package.json index 83922bf6ee..03b8930988 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-packer", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "publishConfig": { "access": "public" }, diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index e0a131182b..87439e254e 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-record", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index 5fb48ae431..83b043401f 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-replay", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index 67f733b5c0..d041396b49 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-record", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index d8def1763c..c1a1845ea6 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-replay", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index 87ceaadfc3..6d19ef4efd 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-record", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index e24962eecc..f8ddac31f7 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-replay", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-replay.umd.cjs", diff --git a/packages/record/package.json b/packages/record/package.json index da95e2ab99..35851be32b 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-record", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "publishConfig": { "access": "public" }, diff --git a/packages/replay/package.json b/packages/replay/package.json index f8e441cc38..96686f0eb9 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-replay", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "publishConfig": { "access": "public" }, diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index 13e6f16167..b2a7bb87cf 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom-nodejs", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "scripts": { "dev": "vite build --watch", "build": "yarn turbo run prepublish", diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index 64568650fc..ec2c1198bf 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", "type": "module", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index 6de01d16ee..079534b42f 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrvideo", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "transform rrweb session into video", "main": "build/index.js", "bin": { diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index c9174a3ddf..995e6011e3 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-player", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "devDependencies": { "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@sveltejs/adapter-auto": "^3.0.0", diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 4b4043bda9..83482c1f42 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-snapshot", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { "prepare": "npm run prepack", diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index 0018878d50..6ca3c64897 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "record and replay the web", "scripts": { "prepare": "npm run prepack", diff --git a/packages/types/package.json b/packages/types/package.json index 8a7b516dda..f63796d6ab 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-types", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "publishConfig": { "access": "public" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index da0319e1c2..57531c4ee4 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-utils", - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "publishConfig": { "access": "public" }, diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index fbcc2573f9..988304e95c 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -1,7 +1,7 @@ { "name": "@mixpanel/rrweb-web-extension", "private": true, - "version": "2.0.0-alpha.18.3", + "version": "2.0.0-alpha.18.4", "description": "The web extension of rrweb which helps to run rrweb on any website out of box", "author": "rrweb-io", "license": "MIT", From 54985bfb680cc9d7db63f6caa89d83f12e848348 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Mon, 22 Jun 2026 16:04:24 +0000 Subject: [PATCH 26/33] MULTI-656 add null check --- packages/rrweb/src/replay/index.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index 21adec8db9..cecd84b471 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -2051,11 +2051,13 @@ export class Replayer { styleSheet.rules, data.index, ) as unknown as CSSStyleRule; - rule.style.setProperty( - data.set.property, - data.set.value, - data.set.priority, - ); + if (rule?.style) { + rule.style.setProperty( + data.set.property, + data.set.value, + data.set.priority, + ); + } } if (data.remove) { @@ -2063,7 +2065,9 @@ export class Replayer { styleSheet.rules, data.index, ) as unknown as CSSStyleRule; - rule.style.removeProperty(data.remove.property); + if (rule?.style) { + rule.style.removeProperty(data.remove.property); + } } } From 19a53b7df000bc157c6ddde585c138da35bbbdb3 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Mon, 29 Jun 2026 17:49:26 +0000 Subject: [PATCH 27/33] update yaml --- .github/workflows/ci-cd.yml | 8 ++++---- .github/workflows/release.yml | 8 ++++---- .github/workflows/style-check.yml | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f51b628367..35dd847462 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,13 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - name: Setup Node.js lts/* - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -39,7 +39,7 @@ jobs: run: PUPPETEER_HEADLESS=true xvfb-run --server-args="-screen 0 1920x1080x24" yarn test - name: Check bundle sizes - uses: preactjs/compressed-size-action@v2 + uses: preactjs/compressed-size-action@f322c295dde06a1cb7ccaef105732dd8a726d1d9 with: install-script: 'yarn install --frozen-lockfile' build-script: 'build:all' @@ -49,7 +49,7 @@ jobs: PUPPETEER_SKIP_DOWNLOAD: true - name: Upload diff images to GitHub - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 if: failure() with: name: image-diff diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a351521391..8ae3ed4b85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 - name: Setup Node.js lts/* - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* @@ -27,7 +27,7 @@ jobs: - name: Create Release Pull Request or Publish to npm id: changesets - uses: changesets/action@v1 + uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d with: publish: yarn run release env: @@ -40,7 +40,7 @@ jobs: run: NODE_OPTIONS='--max-old-space-size=4096' DISABLE_WORKER_INLINING=true yarn turbo run prepublish --filter=@rrweb/web-extension - name: Publish Chrome Extension - uses: mnao305/chrome-extension-upload@v5.0.0 + uses: mnao305/chrome-extension-upload@4008e29e13c144d0f6725462cbd49b7c291b4928 if: steps.changesets.outputs.published == 'true' with: extension-id: 'pdaldeopoccdhlkabbkcjmecmmoninhe' diff --git a/.github/workflows/style-check.yml b/.github/workflows/style-check.yml index a37b1a45a7..4362d9568d 100644 --- a/.github/workflows/style-check.yml +++ b/.github/workflows/style-check.yml @@ -10,12 +10,12 @@ jobs: name: ESLint Check and Report Upload steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -32,7 +32,7 @@ jobs: # Continue to the next step even if this fails continue-on-error: true - name: Upload ESLint Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: eslint_report.json path: eslint_report.json @@ -46,11 +46,11 @@ jobs: runs-on: ubuntu-latest name: ESLint Annotation steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: eslint_report.json - name: Annotate Code Linting Results - uses: ataylorme/eslint-annotate-action@v2 + uses: ataylorme/eslint-annotate-action@5f4dc2e3af8d3c21b727edb597e5503510b1dc9c with: repo-token: '${{ secrets.GITHUB_TOKEN }}' report-json: 'eslint_report.json' @@ -63,12 +63,12 @@ jobs: runs-on: ubuntu-latest name: Format Check steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -87,12 +87,12 @@ jobs: contents: write name: Format Code steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -103,7 +103,7 @@ jobs: - name: Prettify Code run: yarn prettier --write '**/*.{ts,md}' - name: Commit Changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a with: commit_message: Apply formatting changes branch: ${{ github.head_ref }} From 189e52837becfcdeffe4a3ea0cba51dcfaf468f3 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Mon, 29 Jun 2026 19:29:03 +0000 Subject: [PATCH 28/33] MULTI-656 fix ci --- .github/workflows/ci-cd.yml | 8 ++++---- .github/workflows/release.yml | 8 ++++---- .github/workflows/style-check.yml | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f51b628367..35dd847462 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,13 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - name: Setup Node.js lts/* - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -39,7 +39,7 @@ jobs: run: PUPPETEER_HEADLESS=true xvfb-run --server-args="-screen 0 1920x1080x24" yarn test - name: Check bundle sizes - uses: preactjs/compressed-size-action@v2 + uses: preactjs/compressed-size-action@f322c295dde06a1cb7ccaef105732dd8a726d1d9 with: install-script: 'yarn install --frozen-lockfile' build-script: 'build:all' @@ -49,7 +49,7 @@ jobs: PUPPETEER_SKIP_DOWNLOAD: true - name: Upload diff images to GitHub - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 if: failure() with: name: image-diff diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a351521391..8ae3ed4b85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 - name: Setup Node.js lts/* - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* @@ -27,7 +27,7 @@ jobs: - name: Create Release Pull Request or Publish to npm id: changesets - uses: changesets/action@v1 + uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d with: publish: yarn run release env: @@ -40,7 +40,7 @@ jobs: run: NODE_OPTIONS='--max-old-space-size=4096' DISABLE_WORKER_INLINING=true yarn turbo run prepublish --filter=@rrweb/web-extension - name: Publish Chrome Extension - uses: mnao305/chrome-extension-upload@v5.0.0 + uses: mnao305/chrome-extension-upload@4008e29e13c144d0f6725462cbd49b7c291b4928 if: steps.changesets.outputs.published == 'true' with: extension-id: 'pdaldeopoccdhlkabbkcjmecmmoninhe' diff --git a/.github/workflows/style-check.yml b/.github/workflows/style-check.yml index a37b1a45a7..4362d9568d 100644 --- a/.github/workflows/style-check.yml +++ b/.github/workflows/style-check.yml @@ -10,12 +10,12 @@ jobs: name: ESLint Check and Report Upload steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -32,7 +32,7 @@ jobs: # Continue to the next step even if this fails continue-on-error: true - name: Upload ESLint Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: eslint_report.json path: eslint_report.json @@ -46,11 +46,11 @@ jobs: runs-on: ubuntu-latest name: ESLint Annotation steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 with: name: eslint_report.json - name: Annotate Code Linting Results - uses: ataylorme/eslint-annotate-action@v2 + uses: ataylorme/eslint-annotate-action@5f4dc2e3af8d3c21b727edb597e5503510b1dc9c with: repo-token: '${{ secrets.GITHUB_TOKEN }}' report-json: 'eslint_report.json' @@ -63,12 +63,12 @@ jobs: runs-on: ubuntu-latest name: Format Check steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -87,12 +87,12 @@ jobs: contents: write name: Format Code steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e with: node-version: lts/* cache: 'yarn' @@ -103,7 +103,7 @@ jobs: - name: Prettify Code run: yarn prettier --write '**/*.{ts,md}' - name: Commit Changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a with: commit_message: Apply formatting changes branch: ${{ github.head_ref }} From 52ffd37baa678101302dfa6c91ca2a5e973fa500 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 7 Jul 2026 15:16:04 +0000 Subject: [PATCH 29/33] re-trigger ci From df60c04cce3ad929e4f63b214c552c1b8e03ab24 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 7 Jul 2026 16:57:05 +0000 Subject: [PATCH 30/33] re-trigger ci From d2eddb2acb82c1e6f8e7dea20330926f7e90d2d8 Mon Sep 17 00:00:00 2001 From: no value <163026311+dhaval-valotia@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:12:50 +0000 Subject: [PATCH 31/33] incr version --- packages/all/package.json | 2 +- packages/packer/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json | 2 +- packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json | 2 +- packages/plugins/rrweb-plugin-console-record/package.json | 2 +- packages/plugins/rrweb-plugin-console-replay/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-record/package.json | 2 +- packages/plugins/rrweb-plugin-sequential-id-replay/package.json | 2 +- packages/record/package.json | 2 +- packages/replay/package.json | 2 +- packages/rrdom-nodejs/package.json | 2 +- packages/rrdom/package.json | 2 +- packages/rrvideo/package.json | 2 +- packages/rrweb-player/package.json | 2 +- packages/rrweb-snapshot/package.json | 2 +- packages/rrweb/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- packages/web-extension/package.json | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/all/package.json b/packages/all/package.json index 4642df52da..697f3cdbd3 100644 --- a/packages/all/package.json +++ b/packages/all/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-all", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "publishConfig": { "access": "public" }, diff --git a/packages/packer/package.json b/packages/packer/package.json index 03b8930988..c83838b370 100644 --- a/packages/packer/package.json +++ b/packages/packer/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-packer", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "publishConfig": { "access": "public" }, diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json index 87439e254e..fbab4c8b33 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-record", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json index 83b043401f..28b8a20bd9 100644 --- a/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json +++ b/packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-canvas-webrtc-replay", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "", "type": "module", "main": "./dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-record/package.json b/packages/plugins/rrweb-plugin-console-record/package.json index d041396b49..e7ced0ffbc 100644 --- a/packages/plugins/rrweb-plugin-console-record/package.json +++ b/packages/plugins/rrweb-plugin-console-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-record", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-console-replay/package.json b/packages/plugins/rrweb-plugin-console-replay/package.json index c1a1845ea6..236d4c14a7 100644 --- a/packages/plugins/rrweb-plugin-console-replay/package.json +++ b/packages/plugins/rrweb-plugin-console-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-console-replay", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "", "type": "module", "main": "./dist/rrweb-plugin-console-replay.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-record/package.json b/packages/plugins/rrweb-plugin-sequential-id-record/package.json index 6d19ef4efd..b3f6ccad22 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-record/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-record", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-record.umd.cjs", diff --git a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json index f8ddac31f7..7d9a30c6e8 100644 --- a/packages/plugins/rrweb-plugin-sequential-id-replay/package.json +++ b/packages/plugins/rrweb-plugin-sequential-id-replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-plugin-sequential-id-replay", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "", "type": "module", "main": "./dist/rrweb-plugin-sequential-id-replay.umd.cjs", diff --git a/packages/record/package.json b/packages/record/package.json index 35851be32b..c3cc861974 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-record", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "publishConfig": { "access": "public" }, diff --git a/packages/replay/package.json b/packages/replay/package.json index 96686f0eb9..2cd19e0c40 100644 --- a/packages/replay/package.json +++ b/packages/replay/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-replay", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "publishConfig": { "access": "public" }, diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index b2a7bb87cf..95825903c3 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom-nodejs", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "scripts": { "dev": "vite build --watch", "build": "yarn turbo run prepublish", diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index ec2c1198bf..7cea3cac8d 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrdom", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "homepage": "https://github.com/mixpanel/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", "type": "module", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index 079534b42f..2a56b805f7 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrvideo", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "transform rrweb session into video", "main": "build/index.js", "bin": { diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index 995e6011e3..7f5c0d3b36 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-player", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "devDependencies": { "@mixpanel/rrweb-types": "^2.0.0-alpha.18", "@sveltejs/adapter-auto": "^3.0.0", diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 83482c1f42..a53053d0ec 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-snapshot", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { "prepare": "npm run prepack", diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index 6ca3c64897..cdd701bfc8 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "record and replay the web", "scripts": { "prepare": "npm run prepack", diff --git a/packages/types/package.json b/packages/types/package.json index f63796d6ab..edf3e74783 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-types", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "publishConfig": { "access": "public" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 57531c4ee4..3a5810eae7 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@mixpanel/rrweb-utils", - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "publishConfig": { "access": "public" }, diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index 988304e95c..4696fd32d7 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -1,7 +1,7 @@ { "name": "@mixpanel/rrweb-web-extension", "private": true, - "version": "2.0.0-alpha.18.4", + "version": "2.0.0-alpha.18.5", "description": "The web extension of rrweb which helps to run rrweb on any website out of box", "author": "rrweb-io", "license": "MIT", From 2a8326d0899363854340bbe73e716708ba32729d Mon Sep 17 00:00:00 2001 From: Carlos Trevino Date: Thu, 6 Aug 2026 10:42:10 -0700 Subject: [PATCH 32/33] [MULTI-798] Mask placeholder attributes when input masking is enabled (#18) * fix: mask placeholder attributes when input masking is enabled When maskAllInputs or maskInputOptions is enabled, only input values were masked while placeholder attributes were left in plain text. This could leak PII if apps set placeholder text dynamically with user data. Now placeholder attributes on input and textarea elements are masked through the same maskInputValue() path, respecting maskInputOptions granularity and custom maskInputFn callbacks. Co-Authored-By: Claude Opus 4.6 * fix: update cross-origin iframe test snapshots for placeholder attributes Co-Authored-By: Claude Opus 4.6 * ci: pin GitHub Actions to full-length commit SHAs Required by mixpanel org policy. All actions now reference commit SHAs with version comments for readability. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Carlos Trevino Co-authored-by: Claude Opus 4.6 --- packages/rrweb-snapshot/src/snapshot.ts | 13 ++++++ packages/rrweb/src/record/mutation.ts | 2 +- .../__snapshots__/integration.test.ts.snap | 30 ++++++++----- packages/rrweb/test/html/form.html | 4 +- packages/rrweb/test/integration.test.ts | 44 ++++++++++++++++++- .../cross-origin-iframes.test.ts.snap | 12 +++-- 6 files changed, 87 insertions(+), 18 deletions(-) diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 05793e1348..1028d065b4 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -638,6 +638,19 @@ function serializeElementNode( attributes.checked = checked; } } + if ( + (tagName === 'input' || tagName === 'textarea') && + attributes.placeholder + ) { + attributes.placeholder = maskInputValue({ + element: n, + type: getInputType(n), + tagName, + value: attributes.placeholder as string, + maskInputOptions, + maskInputFn, + }); + } if (tagName === 'option') { if ((n as HTMLOptionElement).selected && !maskInputOptions['select']) { attributes.selected = true; diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 616d257e73..58369129da 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -587,7 +587,7 @@ export default class MutationBuffer { let attributeName = m.attributeName as string; let value = (m.target as HTMLElement).getAttribute(attributeName); - if (attributeName === 'value') { + if (attributeName === 'value' || attributeName === 'placeholder') { const type = getInputType(target); value = maskInputValue({ diff --git a/packages/rrweb/test/__snapshots__/integration.test.ts.snap b/packages/rrweb/test/__snapshots__/integration.test.ts.snap index 1bcc1ab635..b6a4fa887b 100644 --- a/packages/rrweb/test/__snapshots__/integration.test.ts.snap +++ b/packages/rrweb/test/__snapshots__/integration.test.ts.snap @@ -2665,7 +2665,8 @@ exports[`record integration tests > can record form interactions 1`] = ` \\"type\\": 2, \\"tagName\\": \\"input\\", \\"attributes\\": { - \\"type\\": \\"text\\" + \\"type\\": \\"text\\", + \\"placeholder\\": \\"Enter your email\\" }, \\"childNodes\\": [], \\"id\\": 22 @@ -2806,7 +2807,8 @@ exports[`record integration tests > can record form interactions 1`] = ` \\"id\\": \\"\\", \\"cols\\": \\"30\\", \\"rows\\": \\"10\\", - \\"data-unmask-example\\": \\"true\\" + \\"data-unmask-example\\": \\"true\\", + \\"placeholder\\": \\"Tell us about yourself\\" }, \\"childNodes\\": [], \\"id\\": 42 @@ -4664,7 +4666,8 @@ exports[`record integration tests > can use maskInputOptions to configure which \\"type\\": 2, \\"tagName\\": \\"input\\", \\"attributes\\": { - \\"type\\": \\"text\\" + \\"type\\": \\"text\\", + \\"placeholder\\": \\"Enter your email\\" }, \\"childNodes\\": [], \\"id\\": 22 @@ -4805,7 +4808,8 @@ exports[`record integration tests > can use maskInputOptions to configure which \\"id\\": \\"\\", \\"cols\\": \\"30\\", \\"rows\\": \\"10\\", - \\"data-unmask-example\\": \\"true\\" + \\"data-unmask-example\\": \\"true\\", + \\"placeholder\\": \\"Tell us about yourself\\" }, \\"childNodes\\": [], \\"id\\": 42 @@ -6507,7 +6511,8 @@ exports[`record integration tests > should mask inputs via function call 1`] = ` \\"type\\": 2, \\"tagName\\": \\"input\\", \\"attributes\\": { - \\"type\\": \\"text\\" + \\"type\\": \\"text\\", + \\"placeholder\\": \\"****************\\" }, \\"childNodes\\": [], \\"id\\": 22 @@ -6648,7 +6653,8 @@ exports[`record integration tests > should mask inputs via function call 1`] = ` \\"id\\": \\"\\", \\"cols\\": \\"30\\", \\"rows\\": \\"10\\", - \\"data-unmask-example\\": \\"true\\" + \\"data-unmask-example\\": \\"true\\", + \\"placeholder\\": \\"Tell us about yourself\\" }, \\"childNodes\\": [], \\"id\\": 42 @@ -10350,7 +10356,8 @@ exports[`record integration tests > should not record input values if maskAllInp \\"type\\": 2, \\"tagName\\": \\"input\\", \\"attributes\\": { - \\"type\\": \\"text\\" + \\"type\\": \\"text\\", + \\"placeholder\\": \\"****************\\" }, \\"childNodes\\": [], \\"id\\": 22 @@ -10491,7 +10498,8 @@ exports[`record integration tests > should not record input values if maskAllInp \\"id\\": \\"\\", \\"cols\\": \\"30\\", \\"rows\\": \\"10\\", - \\"data-unmask-example\\": \\"true\\" + \\"data-unmask-example\\": \\"true\\", + \\"placeholder\\": \\"**********************\\" }, \\"childNodes\\": [], \\"id\\": 42 @@ -13478,7 +13486,8 @@ exports[`record integration tests > should record input userTriggered values if \\"type\\": 2, \\"tagName\\": \\"input\\", \\"attributes\\": { - \\"type\\": \\"text\\" + \\"type\\": \\"text\\", + \\"placeholder\\": \\"Enter your email\\" }, \\"childNodes\\": [], \\"id\\": 22 @@ -13619,7 +13628,8 @@ exports[`record integration tests > should record input userTriggered values if \\"id\\": \\"\\", \\"cols\\": \\"30\\", \\"rows\\": \\"10\\", - \\"data-unmask-example\\": \\"true\\" + \\"data-unmask-example\\": \\"true\\", + \\"placeholder\\": \\"Tell us about yourself\\" }, \\"childNodes\\": [], \\"id\\": 42 diff --git a/packages/rrweb/test/html/form.html b/packages/rrweb/test/html/form.html index 69c7ce7836..d930e106bc 100644 --- a/packages/rrweb/test/html/form.html +++ b/packages/rrweb/test/html/form.html @@ -10,7 +10,7 @@