Skip to content

Commit

Permalink
Add bundled analytics support in Inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
zikaari committed Oct 7, 2022
1 parent 503bea2 commit 67b324d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-shirts-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-next': minor
---

Bundled analytics support in Inspector
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"size-limit": [
{
"path": "dist/umd/index.js",
"limit": "26.02 KB"
"limit": "26.05 KB"
}
],
"dependencies": {
Expand All @@ -61,7 +61,7 @@
},
"devDependencies": {
"@internal/config": "0.0.0",
"@segment/inspector-webext": "^1.1.0",
"@segment/inspector-webext": "^2.0.0",
"@size-limit/preset-big-lib": "^7.0.8",
"@types/flat": "^5.0.1",
"@types/fs-extra": "^9.0.2",
Expand Down
3 changes: 3 additions & 0 deletions packages/browser/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
flushOn,
} from '../core/buffer'
import { popSnippetWindowBuffer } from '../core/buffer/snippet'
import { inspectorHost } from '../core/inspector'

export interface LegacyIntegrationConfiguration {
/* @deprecated - This does not indicate browser types anymore */
Expand Down Expand Up @@ -247,6 +248,8 @@ async function loadAnalytics(
const opts: InitOptions = { retryQueue, ...options }
const analytics = new Analytics(settings, opts)

inspectorHost.attach?.(analytics as any, settings as any, options)

const plugins = settings.plugins ?? []
Context.initMetrics(legacySettings.metrics)

Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ __metadata:
"@segment/analytics-core": 1.0.1
"@segment/analytics.js-video-plugins": ^0.2.1
"@segment/facade": ^3.4.9
"@segment/inspector-webext": ^1.1.0
"@segment/inspector-webext": ^2.0.0
"@segment/tsub": ^0.1.12
"@size-limit/preset-big-lib": ^7.0.8
"@types/flat": ^5.0.1
Expand Down Expand Up @@ -1618,19 +1618,19 @@ __metadata:
languageName: node
linkType: hard

"@segment/inspector-core@npm:^1.1.0":
version: 1.1.0
resolution: "@segment/inspector-core@npm:1.1.0"
checksum: 447733b76b9ab645c6ec1d765d907d92def3e8c1e20ded6c06df3406d98d7f63baac1fecd552ebd4afdf8f8bd53c51fb9266c48fe3f18a2f560af46633729a7c
"@segment/inspector-core@npm:^2.0.0":
version: 2.0.0
resolution: "@segment/inspector-core@npm:2.0.0"
checksum: 5096fccd95cff6c7145997a7f334852d4a760a1e6508dfbb25fbb486279c0eacfe5ec656e5ac7723bcc2e7bc5008d84f436860e584e576504a978c255a89f978
languageName: node
linkType: hard

"@segment/inspector-webext@npm:^1.1.0":
version: 1.1.0
resolution: "@segment/inspector-webext@npm:1.1.0"
"@segment/inspector-webext@npm:^2.0.0":
version: 2.0.0
resolution: "@segment/inspector-webext@npm:2.0.0"
dependencies:
"@segment/inspector-core": ^1.1.0
checksum: 65aacfdb535c10d0954150bb74e54c1cd139ccae8f21d110399bd5e1b6ccee562cdd3d3966228de8d2e3433d169f727d1b31f6a6d59b010e3b8dbb3f1f27d8d3
"@segment/inspector-core": ^2.0.0
checksum: 42cb0e0a1953a95dd5d8294bfa0bfa187dd9d3a96c10f71e86f4f17d22adb92c01bb1839c0ee888401b70c6aeb2fa7ac8845307f5fa6b92e332e17acb9b2b56a
languageName: node
linkType: hard

Expand Down

0 comments on commit 67b324d

Please sign in to comment.