fix(tracker): 3.4.8: webpack 5 fully specified
This commit is contained in:
parent
bc2cfad694
commit
31fc3cc07e
23 changed files with 85 additions and 101 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "3.4.7",
|
||||
"version": "3.4.8",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { timestamp, log, warn } from '../utils';
|
||||
import { Timestamp, PageClose } from '../../messages';
|
||||
import Message from '../../messages/message';
|
||||
import Nodes from './nodes';
|
||||
import Observer from './observer';
|
||||
import Ticker from './ticker';
|
||||
import { timestamp, log, warn } from "../utils.js";
|
||||
import { Timestamp, PageClose } from "../../messages/index.js";
|
||||
import Message from "../../messages/message.js";
|
||||
import Nodes from "./nodes.js";
|
||||
import Observer from "./observer.js";
|
||||
import Ticker from "./ticker.js";
|
||||
|
||||
import { deviceMemory, jsHeapSizeLimit } from '../modules/performance';
|
||||
import { deviceMemory, jsHeapSizeLimit } from "../modules/performance.js";
|
||||
|
||||
import type { Options as ObserverOptions } from './observer';
|
||||
import type { Options as ObserverOptions } from "./observer.js";
|
||||
|
||||
import type { Options as WebworkerOptions, WorkerMessageData } from '../../messages/webworker';
|
||||
import type { Options as WebworkerOptions, WorkerMessageData } from "../../messages/webworker.js";
|
||||
|
||||
interface OnStartInfo {
|
||||
sessionID: string,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { stars, hasOpenreplayAttribute } from '../utils';
|
||||
import { stars, hasOpenreplayAttribute } from "../utils.js";
|
||||
import {
|
||||
CreateDocument,
|
||||
CreateElementNode,
|
||||
|
|
@ -11,8 +11,8 @@ import {
|
|||
MoveNode,
|
||||
RemoveNode,
|
||||
CreateIFrameDocument,
|
||||
} from '../../messages';
|
||||
import App from './index';
|
||||
} from "../../messages/index.js";
|
||||
import App from "./index.js";
|
||||
|
||||
interface Window extends WindowProxy {
|
||||
HTMLInputElement: typeof HTMLInputElement,
|
||||
|
|
@ -292,6 +292,7 @@ export default class Observer {
|
|||
? NodeFilter.FILTER_REJECT
|
||||
: NodeFilter.FILTER_ACCEPT,
|
||||
},
|
||||
// @ts-ignore
|
||||
false,
|
||||
);
|
||||
while (walker.nextNode()) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import App from './index';
|
||||
import App from "./index.js";
|
||||
|
||||
type Callback = () => void;
|
||||
function wrap(callback: Callback, n: number): Callback {
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
import App, { DEFAULT_INGEST_POINT } from './app';
|
||||
export { default as App } from './app';
|
||||
import App, { DEFAULT_INGEST_POINT } from "./app/index.js";
|
||||
export { default as App } from './app/index.js';
|
||||
|
||||
import { UserID, UserAnonymousID, Metadata, RawCustomEvent, CustomIssue } from '../messages';
|
||||
import * as _Messages from '../messages';
|
||||
import { UserID, UserAnonymousID, Metadata, RawCustomEvent, CustomIssue } from "../messages/index.js";
|
||||
import * as _Messages from "../messages/index.js";
|
||||
export const Messages = _Messages;
|
||||
|
||||
import Connection from './modules/connection';
|
||||
import Console from './modules/console';
|
||||
import Exception, { getExceptionMessageFromEvent, getExceptionMessage } from './modules/exception';
|
||||
import Img from './modules/img';
|
||||
import Input from './modules/input';
|
||||
import Mouse from './modules/mouse';
|
||||
import Timing from './modules/timing';
|
||||
import Performance from './modules/performance';
|
||||
import Scroll from './modules/scroll';
|
||||
import Viewport from './modules/viewport';
|
||||
import Longtasks from './modules/longtasks';
|
||||
import CSSRules from './modules/cssrules';
|
||||
import { IN_BROWSER, deprecationWarn, DOCS_HOST } from './utils';
|
||||
import Connection from "./modules/connection.js";
|
||||
import Console from "./modules/console.js";
|
||||
import Exception, { getExceptionMessageFromEvent, getExceptionMessage } from "./modules/exception.js";
|
||||
import Img from "./modules/img.js";
|
||||
import Input from "./modules/input.js";
|
||||
import Mouse from "./modules/mouse.js";
|
||||
import Timing from "./modules/timing.js";
|
||||
import Performance from "./modules/performance.js";
|
||||
import Scroll from "./modules/scroll.js";
|
||||
import Viewport from "./modules/viewport.js";
|
||||
import Longtasks from "./modules/longtasks.js";
|
||||
import CSSRules from "./modules/cssrules.js";
|
||||
import { IN_BROWSER, deprecationWarn, DOCS_HOST } from "./utils.js";
|
||||
|
||||
import { Options as AppOptions } from './app';
|
||||
import { Options as ConsoleOptions } from './modules/console';
|
||||
import { Options as ExceptionOptions } from './modules/exception';
|
||||
import { Options as InputOptions } from './modules/input';
|
||||
import { Options as PerformanceOptions } from './modules/performance';
|
||||
import { Options as TimingOptions } from './modules/timing';
|
||||
import { Options as AppOptions } from "./app/index.js";
|
||||
import { Options as ConsoleOptions } from "./modules/console.js";
|
||||
import { Options as ExceptionOptions } from "./modules/exception.js";
|
||||
import { Options as InputOptions } from "./modules/input.js";
|
||||
import { Options as PerformanceOptions } from "./modules/performance.js";
|
||||
import { Options as TimingOptions } from "./modules/timing.js";
|
||||
|
||||
export type Options = Partial<
|
||||
AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions
|
||||
|
|
@ -78,7 +78,10 @@ export default class API {
|
|||
console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.")
|
||||
return;
|
||||
}
|
||||
const doNotTrack = options.respectDoNotTrack && (navigator.doNotTrack == '1' || window.doNotTrack == '1');
|
||||
const doNotTrack = options.respectDoNotTrack &&
|
||||
(navigator.doNotTrack == '1'
|
||||
// @ts-ignore
|
||||
|| window.doNotTrack == '1');
|
||||
this.app = doNotTrack ||
|
||||
!('Map' in window) ||
|
||||
!('Set' in window) ||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import App from '../app';
|
||||
import { ConnectionInformation } from '../../messages';
|
||||
import App from "../app/index.js";
|
||||
import { ConnectionInformation } from "../../messages/index.js";
|
||||
|
||||
export default function(app: App): void {
|
||||
const connection:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import App from '../app';
|
||||
import { IN_BROWSER } from '../utils';
|
||||
import { ConsoleLog } from '../../messages';
|
||||
import App from "../app/index.js";
|
||||
import { IN_BROWSER } from "../utils.js";
|
||||
import { ConsoleLog } from "../../messages/index.js";
|
||||
|
||||
const printError: (e: Error) => string =
|
||||
IN_BROWSER && 'InstallTrigger' in window // detect Firefox
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import App from '../app';
|
||||
import { CSSInsertRuleURLBased, CSSDeleteRule, TechnicalInfo } from '../../messages';
|
||||
import App from "../app/index.js";
|
||||
import { CSSInsertRuleURLBased, CSSDeleteRule, TechnicalInfo } from "../../messages/index.js";
|
||||
|
||||
export default function(app: App | null) {
|
||||
if (app === null) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import App from '../app';
|
||||
import { JSException } from '../../messages';
|
||||
import Message from '../../messages/message';
|
||||
import App from "../app/index.js";
|
||||
import { JSException } from "../../messages/index.js";
|
||||
import Message from "../../messages/message.js";
|
||||
import ErrorStackParser from 'error-stack-parser';
|
||||
|
||||
export interface Options {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { timestamp, isURL } from '../utils';
|
||||
import App from '../app';
|
||||
import { ResourceTiming, SetNodeAttributeURLBased } from '../../messages';
|
||||
import { timestamp, isURL } from "../utils.js";
|
||||
import App from "../app/index.js";
|
||||
import { ResourceTiming, SetNodeAttributeURLBased } from "../../messages/index.js";
|
||||
|
||||
export default function (app: App): void {
|
||||
const sendImgSrc = app.safe(function (this: HTMLImageElement): void {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { normSpaces, IN_BROWSER, getLabelAttribute, hasOpenreplayAttribute } from '../utils';
|
||||
import App from '../app';
|
||||
import { SetInputTarget, SetInputValue, SetInputChecked } from '../../messages';
|
||||
import { normSpaces, IN_BROWSER, getLabelAttribute, hasOpenreplayAttribute } from "../utils.js";
|
||||
import App from "../app/index.js";
|
||||
import { SetInputTarget, SetInputValue, SetInputChecked } from "../../messages/index.js";
|
||||
|
||||
function isInput(node: any): node is HTMLInputElement {
|
||||
if (!(node instanceof HTMLInputElement)) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import App from '../app';
|
||||
import { LongTask } from '../../messages';
|
||||
import App from "../app/index.js";
|
||||
import { LongTask } from "../../messages/index.js";
|
||||
|
||||
// https://w3c.github.io/performance-timeline/#the-performanceentry-interface
|
||||
interface TaskAttributionTiming extends PerformanceEntry {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { normSpaces, hasOpenreplayAttribute, getLabelAttribute } from '../utils';
|
||||
import App from '../app';
|
||||
import { MouseMove, MouseClick } from '../../messages';
|
||||
import { getInputLabel } from './input';
|
||||
import { normSpaces, hasOpenreplayAttribute, getLabelAttribute } from "../utils.js";
|
||||
import App from "../app/index.js";
|
||||
import { MouseMove, MouseClick } from "../../messages/index.js";
|
||||
import { getInputLabel } from "./input.js";
|
||||
|
||||
function _getSelector(target: Element): string {
|
||||
let el: Element | null = target
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import App from '../app';
|
||||
import { IN_BROWSER } from '../utils';
|
||||
import { PerformanceTrack } from '../../messages';
|
||||
import App from "../app/index.js";
|
||||
import { IN_BROWSER } from "../utils.js";
|
||||
import { PerformanceTrack } from "../../messages/index.js";
|
||||
|
||||
|
||||
type Perf = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import App from '../app';
|
||||
import { SetViewportScroll, SetNodeScroll } from '../../messages';
|
||||
import App from "../app/index.js";
|
||||
import { SetViewportScroll, SetNodeScroll } from "../../messages/index.js";
|
||||
|
||||
export default function (app: App): void {
|
||||
let documentScroll = false;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { isURL } from '../utils';
|
||||
import App from '../app';
|
||||
import { ResourceTiming, PageLoadTiming, PageRenderTiming } from '../../messages';
|
||||
import type Message from '../../messages/message';
|
||||
import { isURL } from "../utils.js";
|
||||
import App from "../app/index.js";
|
||||
import { ResourceTiming, PageLoadTiming, PageRenderTiming } from "../../messages/index.js";
|
||||
import type Message from "../../messages/message.js";
|
||||
|
||||
// Inspired by https://github.com/WPO-Foundation/RUM-SpeedIndex/blob/master/src/rum-speedindex.js
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import App from '../app';
|
||||
import App from "../app/index.js";
|
||||
import {
|
||||
SetPageLocation,
|
||||
SetViewportSize,
|
||||
SetPageVisibility,
|
||||
} from '../../messages';
|
||||
} from "../../messages/index.js";
|
||||
|
||||
export default function (app: App): void {
|
||||
let url: string, width: number, height: number;
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
},
|
||||
"references": [
|
||||
{ "path": "../messages" }
|
||||
]
|
||||
],
|
||||
"exclude": ["app/observer"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Auto-generated, do not edit
|
||||
import Message from './message';
|
||||
import Writer from './writer';
|
||||
import Message from "./message.js";
|
||||
import Writer from "./writer.js";
|
||||
|
||||
function bindNew<C extends { new(...args: A): T }, A extends any[], T>(
|
||||
Class: C & { new(...args: A): T }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import Writer from './writer';
|
||||
import Writer from "./writer.js";
|
||||
|
||||
export default interface Message {
|
||||
encode(w: Writer): boolean;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { classes, BatchMeta, Timestamp, SetPageVisibility, CreateDocument } from '../messages';
|
||||
import Message from '../messages/message';
|
||||
import Writer from '../messages/writer';
|
||||
import { classes, BatchMeta, Timestamp, SetPageVisibility, CreateDocument } from "../messages/index.js";
|
||||
import Message from "../messages/message.js";
|
||||
import Writer from "../messages/writer.js";
|
||||
|
||||
import type { WorkerMessageData } from '../messages/webworker';
|
||||
import type { WorkerMessageData } from "../messages/webworker.js";
|
||||
|
||||
|
||||
const SEND_INTERVAL = 20 * 1000;
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
import Message from '../messages/message';
|
||||
|
||||
|
||||
|
||||
|
||||
class MessageTransformer {
|
||||
private urlRewriter?: URLRewriter
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
transform(m: Message): Message {
|
||||
if (m instanceof SetNodeAttribute) {
|
||||
if (m.name == "src" || m.name == "href") {
|
||||
sendAssetForCache
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -9,6 +9,6 @@
|
|||
"alwaysStrict": true,
|
||||
"target": "es6",
|
||||
"module": "es6",
|
||||
"moduleResolution": "node"
|
||||
"moduleResolution": "nodenext"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue