Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(bundler-plugin): merge latest main #944

Merged
merged 36 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
02229af
Codeowners update: add gdi-js-web-* teams (#872)
t2t2 Oct 17, 2024
2a58d98
feat: attach `browser.instance.id` and `browser.instance.visibility_s…
Joozty Nov 6, 2024
7d1171f
chore: update eslint (#879)
Joozty Nov 6, 2024
fbdd616
chore: use prettier (#882)
Joozty Nov 6, 2024
c3c3838
chore: enable `@typescript-eslint/member-ordering` rule (#883)
Joozty Nov 6, 2024
fe64d05
chore: update dependencies in todolist example (#884)
Joozty Nov 7, 2024
1f20457
chore: release 0.19.2 (#885)
Joozty Nov 7, 2024
adc7496
chore: postrelease 0.19.2 (#886)
Joozty Nov 7, 2024
9526093
chore: create setup action (#888)
Joozty Nov 7, 2024
c205f18
chore: check size of artifacts (#889)
Joozty Nov 7, 2024
314e922
fix(session-replay): id increment (#892)
Joozty Nov 12, 2024
caa98cd
chore(release): v0.19.3 (#893)
Joozty Nov 12, 2024
d963222
chore(postrelease): v0.19.3 (#894)
Joozty Nov 12, 2024
c9b430c
chore: bump chromedriver (#897)
Joozty Nov 22, 2024
767d36e
feat: add option to save session data to local storage (#900)
potty Dec 4, 2024
21d836c
feat: add `_experimental_longtaskNoStartSession` flag (#899)
Joozty Dec 9, 2024
11b2511
feat: add `persistence` flag (#904)
Joozty Dec 9, 2024
22dbf70
chore: release 0.20.0-beta.0 (#905)
Joozty Dec 10, 2024
16570e7
chore: replace integration-tests karma with playwright (#887)
Joozty Dec 11, 2024
ebdc6c5
Bump actions/upload-artifact from 3.1.2 to 4.4.3 (#860)
dependabot[bot] Dec 11, 2024
368cf93
Bump actions/checkout from 4.2.1 to 4.2.2 (#890)
dependabot[bot] Dec 11, 2024
0931f2e
build(deps): bump lycheeverse/lychee-action from 2.1.0 to 2.2.0 (#915)
dependabot[bot] Jan 8, 2025
44b86db
chore(internal): update license headers to reflect 2025 (#920)
Joozty Jan 10, 2025
dd97226
build(deps): bump actions/upload-artifact from 4.4.3 to 4.6.0 (#921)
dependabot[bot] Jan 10, 2025
ca0ce8b
build(deps-dev): bump cross-spawn from 6.0.5 to 6.0.6 (#911)
dependabot[bot] Jan 10, 2025
74ed1a2
fix: add 'http.response.status_code' to documentFetch span. (#928)
amertak Jan 20, 2025
ea9fd4a
chore(release): 0.20.0-beta.1 (#930)
Joozty Jan 20, 2025
f6de57f
chore: explicitly set packages for release (#931)
Joozty Jan 20, 2025
c6d7edb
chore(release): 0.20.0-beta.2 (#932)
Joozty Jan 20, 2025
c08ac29
fix: use old tag name for compatibility - http.status_code (#934)
amertak Jan 22, 2025
323b941
chore(release): 0.20.0-beta.3 (#935)
Joozty Jan 22, 2025
e5f4672
feat: add responseStatus to all resources (#936)
amertak Jan 24, 2025
d05a8bc
fix(resource-fetch): ignore status 0 (#940)
amertak Jan 27, 2025
7fb034b
fix: do not extend session from discarded session replay spans (#939)
Joozty Jan 27, 2025
f0360d7
chore(release): 0.20.0-beta.4 (#941)
Joozty Jan 27, 2025
b23b57d
Merge remote-tracking branch 'origin/main' into merge-main-2
mvirgil Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: enable @typescript-eslint/member-ordering rule (#883)
Joozty authored Nov 6, 2024
commit c3c383810337d6d3c494f2c353ea7676140e5331
147 changes: 73 additions & 74 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -82,80 +82,79 @@ export default [
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
// '@typescript-eslint/member-ordering': [
// 'error',
// {
// default: {
// memberTypes: [
// // Index signature
// 'signature',
//
// // Fields
// 'public-static-field',
// 'protected-static-field',
// 'private-static-field',
//
// 'public-decorated-field',
// 'protected-decorated-field',
// 'private-decorated-field',
//
// 'public-instance-field',
// 'protected-instance-field',
// 'private-instance-field',
//
// 'public-abstract-field',
// 'protected-abstract-field',
//
// 'public-field',
// 'protected-field',
// 'private-field',
//
// 'static-field',
// 'instance-field',
// 'abstract-field',
//
// 'decorated-field',
//
// 'field',
//
// // Constructors
// 'public-constructor',
// 'protected-constructor',
// 'private-constructor',
//
// 'constructor',
//
// // Methods
// 'public-decorated-method',
// 'public-static-method',
// 'public-instance-method',
// 'protected-decorated-method',
// 'protected-static-method',
// 'protected-instance-method',
// 'private-decorated-method',
// 'private-static-method',
// 'private-instance-method',
//
// 'public-abstract-method',
// 'protected-abstract-method',
//
// 'public-method',
// 'protected-method',
// 'private-method',
//
// 'static-method',
// 'instance-method',
// 'abstract-method',
//
// 'decorated-method',
//
// 'method',
// ],
// order: 'alphabetically',
// },
// },
// ],
'@typescript-eslint/member-ordering': 'off', // TODO: temporarily disabled
'@typescript-eslint/member-ordering': [
'error',
{
default: {
memberTypes: [
// Index signature
'signature',

// Fields
'public-static-field',
'protected-static-field',
'private-static-field',

'public-decorated-field',
'protected-decorated-field',
'private-decorated-field',

'public-instance-field',
'protected-instance-field',
'private-instance-field',

'public-abstract-field',
'protected-abstract-field',

'public-field',
'protected-field',
'private-field',

'static-field',
'instance-field',
'abstract-field',

'decorated-field',

'field',

// Constructors
'public-constructor',
'protected-constructor',
'private-constructor',

'constructor',

// Methods
'public-decorated-method',
'public-static-method',
'public-instance-method',
'protected-decorated-method',
'protected-static-method',
'protected-instance-method',
'private-decorated-method',
'private-static-method',
'private-instance-method',

'public-abstract-method',
'protected-abstract-method',

'public-method',
'protected-method',
'private-method',

'static-method',
'instance-method',
'abstract-method',

'decorated-method',

'method',
],
order: 'alphabetically',
},
},
],
'@typescript-eslint/naming-convention': ['error', { format: ['UPPER_CASE'], selector: ['enumMember'] }],
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-empty-interface': 'off',
26 changes: 13 additions & 13 deletions packages/session-recorder/src/BatchLogProcessor.ts
Original file line number Diff line number Diff line change
@@ -26,15 +26,15 @@ export interface BatchLogProcessorConfig {
}

export class BatchLogProcessor {
private logs: Log[] = []
exporter: LogExporter

lastBatchSent: number

scheduledDelayMillis: number

timeout: NodeJS.Timeout | undefined

exporter: LogExporter

lastBatchSent: number
private logs: Log[] = []

constructor(exporter: LogExporter, config: BatchLogProcessorConfig) {
this.scheduledDelayMillis = config?.scheduledDelayMillis || 5000
@@ -45,6 +45,15 @@ export class BatchLogProcessor {
})
}

_flushAll(): void {
this.lastBatchSent = Date.now()

context.with(suppressTracing(context.active()), () => {
const logsToExport = this.logs.splice(0, this.logs.length)
this.exporter.export(logsToExport)
})
}

onLog(log: Log): void {
this.logs.push(log)

@@ -55,15 +64,6 @@ export class BatchLogProcessor {
}, this.scheduledDelayMillis)
}
}

_flushAll(): void {
this.lastBatchSent = Date.now()

context.with(suppressTracing(context.active()), () => {
const logsToExport = this.logs.splice(0, this.logs.length)
this.exporter.export(logsToExport)
})
}
}

export function convert(body: JsonValue, timeUnixNano: number, attributes?: JsonObject): Log {
4 changes: 2 additions & 2 deletions packages/session-recorder/src/OTLPLogExporter.ts
Original file line number Diff line number Diff line change
@@ -23,10 +23,10 @@ import { IAnyValue, Log } from './types'
import { VERSION } from './version.js'

interface OTLPLogExporterConfig {
headers?: Record<string, string>
beaconUrl: string
getResourceAttributes: () => JsonObject
debug?: boolean
getResourceAttributes: () => JsonObject
headers?: Record<string, string>
}

const defaultHeaders = {
16 changes: 8 additions & 8 deletions packages/session-recorder/src/index.ts
Original file line number Diff line number Diff line change
@@ -33,6 +33,11 @@ interface BasicTracerProvider extends TracerProvider {
type RRWebOptions = Parameters<typeof record>[0]

export type SplunkRumRecorderConfig = RRWebOptions & {
/**
* @deprecated Use RUM token in rumAccessToken
*/
apiToken?: string

/** Destination for the captured data */
beaconEndpoint?: string

@@ -41,6 +46,9 @@ export type SplunkRumRecorderConfig = RRWebOptions & {
*/
beaconUrl?: string

/** Debug mode */
debug?: boolean

/**
* The name of your organization’s realm. Automatically configures beaconUrl with correct URL
*/
@@ -58,14 +66,6 @@ export type SplunkRumRecorderConfig = RRWebOptions & {
* @deprecated Renamed to `rumAccessToken`
**/
rumAuth?: string

/**
* @deprecated Use RUM token in rumAccessToken
*/
apiToken?: string

/** Debug mode */
debug?: boolean
}

function migrateConfigOption(
20 changes: 10 additions & 10 deletions packages/session-recorder/src/types.ts
Original file line number Diff line number Diff line change
@@ -19,9 +19,9 @@
import type { JsonObject, JsonValue } from 'type-fest'

export interface Log {
attributes?: JsonObject
body?: JsonValue
timeUnixNano: number
attributes?: JsonObject
}

export interface LogExporter {
@@ -36,28 +36,28 @@ export interface LogExporter {

// OTLP Logs Interfaces
export interface IAnyValue {
/** AnyValue stringValue */
stringValue?: string | null
/** AnyValue arrayValue */

arrayValue?: IArrayValue | null

/** AnyValue boolValue */
boolValue?: boolean | null

/** AnyValue intValue */
intValue?: number | null
/** AnyValue bytesValue */
bytesValue?: Uint8Array | null

/** AnyValue doubleValue */
doubleValue?: number | null

/** AnyValue arrayValue */

arrayValue?: IArrayValue | null
/** AnyValue intValue */
intValue?: number | null

/** AnyValue kvlistValue */

kvlistValue?: IKeyValueList | null

/** AnyValue bytesValue */
bytesValue?: Uint8Array | null
/** AnyValue stringValue */
stringValue?: string | null
}

export interface IArrayValue {
Original file line number Diff line number Diff line change
@@ -18,20 +18,40 @@
const { Transform } = require('stream')

exports.HtmlInjectorTransform = class HtmlInjectorTransform extends Transform {
__scriptInjected = false

__wordIdx = 0
__content = []

__contentIdx = 0

__content = []
__scriptInjected = false

__wordIdx = 0

constructor({ matchingSuffix, contentToInject }) {
super()
this.__word = matchingSuffix
this.__injectable = contentToInject
}

__runPartialOnlineMatch() {
while (true) {
if (this.__contentIdx === this.__content.length) {
return false
} else if (this.__wordIdx === this.__word.length) {
return true
} else if (this.__contentIdx + this.__wordIdx === this.__content.length) {
return false
} else if (this.__content[this.__contentIdx + this.__wordIdx] === this.__word[this.__wordIdx]) {
this.__wordIdx += 1
} else if (this.__wordIdx === 0) {
this.__contentIdx += 1
} else {
// TODO: speed up using KMP failure function
this.__wordIdx = 0
this.__contentIdx += 1
}
}
}

_transform(chunk, enc, callback) {
if (this.__scriptInjected) {
this.push(chunk)
@@ -63,24 +83,4 @@ exports.HtmlInjectorTransform = class HtmlInjectorTransform extends Transform {
callback()
}
}

__runPartialOnlineMatch() {
while (true) {
if (this.__contentIdx === this.__content.length) {
return false
} else if (this.__wordIdx === this.__word.length) {
return true
} else if (this.__contentIdx + this.__wordIdx === this.__content.length) {
return false
} else if (this.__content[this.__contentIdx + this.__wordIdx] === this.__word[this.__wordIdx]) {
this.__wordIdx += 1
} else if (this.__wordIdx === 0) {
this.__contentIdx += 1
} else {
// TODO: speed up using KMP failure function
this.__wordIdx = 0
this.__contentIdx += 1
}
}
}
}
Loading