Skip to content

Commit 3fb10bd

Browse files
authored
Merge pull request #1814 from rosahbruno/remove-webext
Remove current webext implementation
2 parents 566bf94 + 43c9a83 commit 3fb10bd

40 files changed

+8
-16801
lines changed

.circleci/config.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,29 +101,6 @@ jobs:
101101
name: Build docs
102102
command: npm --prefix ./glean run build:docs
103103

104-
sample-webext-test:
105-
docker:
106-
- image: cimg/python:<< pipeline.parameters.python-version >>
107-
steps:
108-
- checkout
109-
- install-node
110-
- run:
111-
name: Install JavaScript dependencies for Glean
112-
command: npm --prefix ./glean install
113-
- run:
114-
name: Install Typescript dependencies for the TS web extension sample
115-
command: |
116-
npm --prefix ./samples/browser/webext install
117-
npm --prefix ./samples/browser/webext run link:glean
118-
- run:
119-
name: Build the TS web extension sample
120-
command: |
121-
npm --prefix ./samples/browser/webext run build
122-
- run:
123-
name: Run TS web extension sample test
124-
command: |
125-
export PATH=.:$PATH && npm --prefix ./samples/browser/webext run test
126-
127104
browser-compat-smoke-tests:
128105
docker:
129106
- image: cimg/python:<< pipeline.parameters.python-version >>
@@ -235,16 +212,12 @@ workflows:
235212
- test:
236213
requires:
237214
- build
238-
- sample-webext-test:
239-
requires:
240-
- test
241215
- hold:
242216
type: approval
243217
requires:
244218
- lint
245219
- build
246220
- test
247-
- sample-webext-test
248221
filters:
249222
branches:
250223
ignore:

.github/dependabot.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,7 @@ updates:
88
directory: "/automation"
99
schedule:
1010
interval: "monthly"
11-
- package-ecosystem: "npm"
12-
directory: "/samples/browser/webext"
13-
schedule:
14-
interval: "monthly"
1511
- package-ecosystem: "npm"
1612
directory: "/samples/browser/web"
1713
schedule:
1814
interval: "monthly"
19-
- package-ecosystem: "npm"
20-
directory: "/glean/tests/unit/platform/utils/webext/sample"
21-
schedule:
22-
interval: "monthly"

ARCHITECTURE.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ An end-to-end data collection platform developed by Mozilla and primarily target
1515

1616
Glean provides multiple client SDKs for different programming languages and platforms.
1717
One of the aspects that guide Glean SDK development is cross-platform consistency and the Glean
18-
JavaScript SDK is no exception to that. It is built to work on multiple JavaScript platforms --
19-
websites, and web extensions as of the time of writing -- and to be easily extendable
18+
JavaScript SDK is no exception to that. It is built to work on websites -- and to be easily extendable
2019
to other platforms as well.
2120

2221
The Glean JavaScript SDK is the latest addition to the family of Glean SDKs. The other Glean SDKs,
@@ -39,9 +38,7 @@ When data is submitted, the Glean SDK is responsible for assembling the correct
3938
storage. Each metric can have different [lifetimes](https://mozilla.github.io/glean/book/user/metrics/adding-new-metrics.html#a-lifetime-example)
4039
and the SDK will manage its storage so that data does not remain in storage after it's lifetime is expired.
4140

42-
The Glean SDK tries to do all of this is the least disruptive way possible to users. There are two separate
43-
implementations for the SDK based on the platform: async (web extensions) and sync (browser). The implementation
44-
is set inside of Glean itself and is not configurable by the user.
41+
The Glean SDK tries to do all of this is the least disruptive way possible to users.
4542

4643
### async (Web Extensions)
4744

@@ -104,7 +101,7 @@ To see all the exposed entry points, check out Glean.js' `package.json` file.
104101
### `entry/`
105102

106103
The `entry/` folder contains the main entry points for the Glean.js package per platform.
107-
For example, when a user does `import Glean from @mozilla/glean/webext` it's the `entry/webext.ts`
104+
For example, when a user does `import Glean from @mozilla/glean/web` it's the `entry/web.ts`
108105
file that they are getting and not `core/glean.ts`.
109106

110107
The main difference between each platform's file is that a different `Platform` implementation is
@@ -123,7 +120,6 @@ It also makes testing easier, because the exact same suite of tests can be run f
123120

124121
The storage module varies for each platform. The storage mechanism used by each platform is as follows:
125122
- `web` - [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
126-
- `webext` - [`storage`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage)
127123

128124
### `plugins/`
129125

automation/size/report.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ import {
1414

1515
async function buildStatsMap() {
1616
return [
17-
{
18-
name: "Web Extension",
19-
max: await getCustomLibSize("webext", METRIC_TYPES, PLUGINS),
20-
min: await getCustomLibSize("webext")
21-
},
2217
{
2318
name: "Website",
2419
max: await getCustomLibSize("web", METRIC_TYPES, PLUGINS),

automation/size/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const METRIC_TYPES = [
3434

3535
export const PLUGINS = [ "encryption" ];
3636

37-
export const PLATFORMS = [ "web", "webext" ];
37+
export const PLATFORMS = [ "web" ];
3838

3939
const UNITS = ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
4040
/**
@@ -81,7 +81,7 @@ export function executeCmd(cmd) {
8181
*
8282
* Note: This function will use whatever `@mozilla/glean` package is linked at its runtime.
8383
*
84-
* @param {string} platform The platform to build for, supported platforms are: `web`, and `webext`.
84+
* @param {string} platform The platform to build for, supported platforms are: `web`.
8585
* @param {[string]} metrics An array of metric types. Supported metrics types are listed in `METRIC_TYPES`.
8686
* If not provided the final bundle won't contain any additional metric types.
8787
* @param {[string]} plugins An array of plugins. Supported plugins are listed in `PLUGINS`.

automation/size/webpack.config.js

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

55
export default (platform, entry) => {
6-
const target = ["webext", "web"].includes(platform) ? "web" : null;
6+
const target = platform === "web" ? "web" : null;
77

88
return {
99
target,

docs/reference/ci.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ Runs all necessary lints on the code. This includes:
3737

3838
Runs unit and integration test on the `@mozilla/glean` library.
3939

40-
### `sample-webext-test`
41-
42-
Runs unit tests on the Glean.js sample apps.
43-
4440
### `check-size`
4541

4642
_Requires approval_.

docs/reference/compat.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,3 @@ All of the listed versions are explicitly tested.
1919

2020
The Opera and Brave browsers are not explicitly tested, however are unofficially supported
2121
as Chromium based browsers.
22-
23-
## Web Extensions
24-
25-
> TODO: see [Bug 1752549](https://bugzilla.mozilla.org/show_bug.cgi?id=1752549)

glean/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@
1212
"./plugins/*": "./dist/plugins/*.js",
1313
"./uploader": "./dist/core/upload/uploader.js",
1414
"./testing": "./dist/core/testing/index.js",
15-
"./webext": "./dist/entry/webext.js",
1615
"./web": "./dist/entry/web.js"
1716
},
1817
"typesVersions": {
1918
"*": {
20-
"webext": [
21-
"./dist/types/entry/webext.d.ts"
22-
],
2319
"web": [
2420
"./dist/types/entry/web.d.ts"
2521
],
@@ -58,8 +54,7 @@
5854
"test:unit": "run-s test:unit:core test:unit:platform test:unit:plugins",
5955
"test:unit:core": "npm run test:base -- \"tests/unit/core/**/*.spec.ts\" --recursive",
6056
"test:unit:plugins": "npm run test:base -- \"tests/unit/plugins/**/*.spec.ts\" --recursive",
61-
"test:unit:platform": "npm run test:base -- \"tests/unit/platform/**/*.spec.ts\" --recursive --timeout 0 --exclude tests/unit/platform/utils/webext/sample/node_modules/**/*.spec.ts",
62-
"pretest:unit:platform": "cd tests/unit/platform/utils/webext/sample/ && npm install && npm run build:xpi",
57+
"test:unit:platform": "npm run test:base -- \"tests/unit/platform/**/*.spec.ts\" --recursive --timeout 0",
6358
"test:base": "node --experimental-modules --experimental-specifier-resolution=node --loader=ts-node/esm node_modules/mocha/lib/cli/cli.js",
6459
"lint": "run-s lint:eslint lint:circular-deps lint:glinter",
6560
"lint:eslint": "eslint . --ext .ts,.js,.json --max-warnings=0",

glean/src/entry/webext.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)