Skip to content

Commit c138e71

Browse files
committed
Merge branch 'release-v4.0.0-pre.0' into release
2 parents ce6fabf + e41374a commit c138e71

File tree

121 files changed

+2527
-8711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2527
-8711
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Unreleased changes
22

3-
[Full changelog](https://github.com/mozilla/glean.js/compare/v3.0.0...main)
3+
[Full changelog](https://github.com/mozilla/glean.js/compare/v4.0.0-pre.0...main)
4+
5+
# v4.0.0-pre.0 (2023-11-27)
6+
7+
[Full changelog](https://github.com/mozilla/glean.js/compare/v3.0.0...v4.0.0-pre.0)
48

59
# v3.0.0 (2023-11-16)
610

glean/package-lock.json

Lines changed: 8 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glean/package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mozilla/glean",
3-
"version": "3.0.0",
3+
"version": "4.0.0-pre.0",
44
"description": "An implementation of the Glean SDK, a modern cross-platform telemetry client, for JavaScript environments.",
55
"type": "module",
66
"sideEffects": false,
@@ -9,7 +9,6 @@
99
"./package.json": "./package.json",
1010
"./private/metrics/*": "./dist/core/metrics/types/*.js",
1111
"./private/ping": "./dist/core/pings/ping_type.js",
12-
"./plugins/*": "./dist/plugins/*.js",
1312
"./uploader": "./dist/core/upload/uploader.js",
1413
"./testing": "./dist/core/testing/index.js",
1514
"./web": "./dist/entry/web.js"
@@ -25,9 +24,6 @@
2524
"private/metrics/*": [
2625
"./dist/types/core/metrics/types/*"
2726
],
28-
"plugins/*": [
29-
"./dist/types/plugins/*"
30-
],
3127
"uploader": [
3228
"./dist/types/core/upload/uploader.d.ts"
3329
],
@@ -51,9 +47,8 @@
5147
"test": "run-s test:unit test:integration",
5248
"test:integration": "npm run test:base -- \"tests/integration/**/*.spec.ts\" --recursive",
5349
"pretest:integration": "../bin/parser-for-schema-testing.sh && ../bin/python-env-vars-test.sh",
54-
"test:unit": "run-s test:unit:core test:unit:platform test:unit:plugins",
50+
"test:unit": "run-s test:unit:core test:unit:platform",
5551
"test:unit:core": "npm run test:base -- \"tests/unit/core/**/*.spec.ts\" --recursive",
56-
"test:unit:plugins": "npm run test:base -- \"tests/unit/plugins/**/*.spec.ts\" --recursive",
5752
"test:unit:platform": "npm run test:base -- \"tests/unit/platform/**/*.spec.ts\" --recursive --timeout 0",
5853
"test:base": "node --experimental-modules --experimental-specifier-resolution=node --loader=ts-node/esm node_modules/mocha/lib/cli/cli.js",
5954
"lint": "run-s lint:eslint lint:circular-deps lint:glinter",
@@ -129,7 +124,6 @@
129124
},
130125
"dependencies": {
131126
"fflate": "^0.8.0",
132-
"jose": "^4.0.4",
133127
"tslib": "^2.3.1",
134128
"uuid": "^9.0.0"
135129
},

glean/src/core/config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import { DEFAULT_TELEMETRY_ENDPOINT, GLEAN_MAX_SOURCE_TAGS } from "./constants.js";
6-
import type Plugin from "../plugins/index.js";
76
import { validateHeader, validateURL } from "./utils.js";
87
import type Uploader from "./upload/uploader.js";
98
import log, { LoggingLevel } from "./log.js";
@@ -41,8 +40,6 @@ export interface ConfigurationInterface {
4140
readonly serverEndpoint?: string,
4241
// The maximum number of events to store before submitting the events ping.
4342
readonly maxEvents?: number,
44-
// Optional list of plugins to include in current Glean instance.
45-
plugins?: Plugin[],
4643
// The HTTP client implementation to use for uploading pings.
4744
httpClient?: Uploader,
4845
// The build date, provided by glean_parser

glean/src/core/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const GLEAN_SCHEMA_VERSION = 1;
88
//
99
// PACKAGE_VERSION is defined as a global by webpack,
1010
// we need a default here for testing when the app is not build with webpack.
11-
export const GLEAN_VERSION = "3.0.0";
11+
export const GLEAN_VERSION = "4.0.0-pre.0";
1212

1313
// The name of a "ping" that will include Glean ping_info metrics,
1414
// such as ping sequence numbers.

glean/src/core/context.ts

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,18 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import type MetricsDatabase from "./metrics/database/async.js";
6-
import type MetricsDatabaseSync from "./metrics/database/sync.js";
7-
8-
import type EventsDatabase from "./metrics/events_database/async.js";
9-
import type { EventsDatabaseSync } from "./metrics/events_database/sync.js";
10-
11-
import type PingsDatabase from "./pings/database/async.js";
12-
import type PingsDatabaseSync from "./pings/database/sync.js";
13-
14-
import type ErrorManager from "./error/async.js";
15-
import type ErrorManagerSync from "./error/sync.js";
16-
17-
import type Platform from "../platform/async.js";
18-
import type PlatformSync from "../platform/sync.js";
19-
20-
import type { CoreMetrics } from "./internal_metrics/async.js";
21-
import type { CoreMetricsSync } from "./internal_metrics/sync.js";
5+
import type MetricsDatabase from "./metrics/database.js";
6+
import type EventsDatabase from "./metrics/events_database/index.js";
7+
import type PingsDatabase from "./pings/database.js";
8+
import type ErrorManager from "./error/index.js";
9+
import type Platform from "../platform/index.js";
10+
import type { CoreMetrics } from "./internal_metrics.js";
2211

2312
import type { Configuration } from "./config.js";
2413
import type CorePings from "./internal_pings.js";
2514
import type { Metric } from "./metrics/metric.js";
2615
import type { JSONValue } from "./utils.js";
2716

28-
import Dispatcher from "./dispatcher.js";
2917
import log, { LoggingLevel } from "./log.js";
3018

3119
const LOG_TAG = "core.Context";
@@ -45,20 +33,17 @@ const LOG_TAG = "core.Context";
4533
export class Context {
4634
private static _instance?: Context;
4735

48-
// The dispatcher is only used with the non-web (async) implementation.
49-
private dispatcher: Dispatcher;
50-
51-
private platform!: Platform | PlatformSync;
36+
private platform!: Platform;
5237
private corePings!: CorePings;
53-
private coreMetrics!: CoreMetrics | CoreMetricsSync;
38+
private coreMetrics!: CoreMetrics;
5439

5540
// The following group of properties are all set on Glean.initialize
5641
// Attempting to get them before they are set will log an error.
5742
private uploadEnabled!: boolean;
58-
private metricsDatabase!: MetricsDatabase | MetricsDatabaseSync;
59-
private eventsDatabase!: EventsDatabase | EventsDatabaseSync;
60-
private pingsDatabase!: PingsDatabase | PingsDatabaseSync;
61-
private errorManager!: ErrorManager | ErrorManagerSync;
43+
private metricsDatabase!: MetricsDatabase;
44+
private eventsDatabase!: EventsDatabase;
45+
private pingsDatabase!: PingsDatabase;
46+
private errorManager!: ErrorManager;
6247
private applicationId!: string;
6348
private config!: Configuration;
6449

@@ -79,7 +64,6 @@ export class Context {
7964

8065
private constructor() {
8166
this.startTime = new Date();
82-
this.dispatcher = new Dispatcher();
8367
}
8468

8569
static get instance(): Context {
@@ -99,10 +83,6 @@ export class Context {
9983
Context._instance = undefined;
10084
}
10185

102-
static get dispatcher(): Dispatcher {
103-
return Context.instance.dispatcher;
104-
}
105-
10686
static get uploadEnabled(): boolean {
10787
if (typeof Context.instance.uploadEnabled === "undefined") {
10888
log(
@@ -121,7 +101,7 @@ export class Context {
121101
Context.instance.uploadEnabled = upload;
122102
}
123103

124-
static get metricsDatabase(): MetricsDatabase | MetricsDatabaseSync {
104+
static get metricsDatabase(): MetricsDatabase {
125105
if (typeof Context.instance.metricsDatabase === "undefined") {
126106
log(
127107
LOG_TAG,
@@ -135,11 +115,11 @@ export class Context {
135115
return Context.instance.metricsDatabase;
136116
}
137117

138-
static set metricsDatabase(db: MetricsDatabase | MetricsDatabaseSync) {
118+
static set metricsDatabase(db: MetricsDatabase) {
139119
Context.instance.metricsDatabase = db;
140120
}
141121

142-
static get eventsDatabase(): EventsDatabase | EventsDatabaseSync {
122+
static get eventsDatabase(): EventsDatabase {
143123
if (typeof Context.instance.eventsDatabase === "undefined") {
144124
log(
145125
LOG_TAG,
@@ -153,11 +133,11 @@ export class Context {
153133
return Context.instance.eventsDatabase;
154134
}
155135

156-
static set eventsDatabase(db: EventsDatabase | EventsDatabaseSync) {
136+
static set eventsDatabase(db: EventsDatabase) {
157137
Context.instance.eventsDatabase = db;
158138
}
159139

160-
static get pingsDatabase(): PingsDatabase | PingsDatabaseSync {
140+
static get pingsDatabase(): PingsDatabase {
161141
if (typeof Context.instance.pingsDatabase === "undefined") {
162142
log(
163143
LOG_TAG,
@@ -171,11 +151,11 @@ export class Context {
171151
return Context.instance.pingsDatabase;
172152
}
173153

174-
static set pingsDatabase(db: PingsDatabase | PingsDatabaseSync) {
154+
static set pingsDatabase(db: PingsDatabase) {
175155
Context.instance.pingsDatabase = db;
176156
}
177157

178-
static get errorManager(): ErrorManager | ErrorManagerSync {
158+
static get errorManager(): ErrorManager {
179159
if (typeof Context.instance.errorManager === "undefined") {
180160
log(
181161
LOG_TAG,
@@ -189,7 +169,7 @@ export class Context {
189169
return Context.instance.errorManager;
190170
}
191171

192-
static set errorManager(db: ErrorManager | ErrorManagerSync) {
172+
static set errorManager(db: ErrorManager) {
193173
Context.instance.errorManager = db;
194174
}
195175

@@ -257,19 +237,19 @@ export class Context {
257237
Context.instance.corePings = pings;
258238
}
259239

260-
static get coreMetrics(): CoreMetrics | CoreMetricsSync {
240+
static get coreMetrics(): CoreMetrics {
261241
return Context.instance.coreMetrics;
262242
}
263243

264-
static set coreMetrics(metrics: CoreMetrics | CoreMetricsSync) {
244+
static set coreMetrics(metrics: CoreMetrics) {
265245
Context.instance.coreMetrics = metrics;
266246
}
267247

268-
static set platform(platform: Platform | PlatformSync) {
248+
static set platform(platform: Platform) {
269249
Context.instance.platform = platform;
270250
}
271251

272-
static get platform(): Platform | PlatformSync {
252+
static get platform(): Platform {
273253
if (typeof Context.instance.platform === "undefined") {
274254
log(
275255
LOG_TAG,
@@ -287,10 +267,6 @@ export class Context {
287267
return !!Context.instance.platform;
288268
}
289269

290-
static isPlatformSync(): boolean {
291-
return Context.instance.platform?.name === "web";
292-
}
293-
294270
static getSupportedMetric(
295271
type: string
296272
): (new (v: unknown) => Metric<JSONValue, JSONValue>) | undefined {

0 commit comments

Comments
 (0)