зеркало из https://github.com/mozilla/glean.git
EXTRA: Replace all occurances of Javascript with JavaScript
To prevent @badboy from dying on this hill.
This commit is contained in:
Родитель
f50008cfe7
Коммит
11488226df
|
@ -38,7 +38,6 @@ JNI
|
|||
JSON
|
||||
JUnit
|
||||
JWE
|
||||
Javascript
|
||||
JetBrains
|
||||
Karlton
|
||||
Kotlin
|
||||
|
@ -65,6 +64,7 @@ Rkv's
|
|||
Robolectric
|
||||
SDK
|
||||
SDK's
|
||||
SDKs
|
||||
Solaris
|
||||
TLDs
|
||||
TODO
|
||||
|
|
|
@ -24,7 +24,7 @@ file a bug in [Bugzilla in Data Platform & Tools :: Glean: SDK](https://bugzilla
|
|||
|
||||
### [Glean.js](https://github.com/mozilla/glean.js)
|
||||
|
||||
Glean.js is an implementation of Glean in **Javascript**. Currently, it only has support
|
||||
Glean.js is an implementation of Glean in **JavaScript**. Currently, it only has support
|
||||
for usage in web extensions.
|
||||
|
||||
For development documentation on `Glean.js`,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
- [Kotlin](user/adding-glean-to-your-project/kotlin.md)
|
||||
- [Swift](user/adding-glean-to-your-project/swift.md)
|
||||
- [Python](user/adding-glean-to-your-project/python.md)
|
||||
- [Javascript](user/adding-glean-to-your-project/javascript.md)
|
||||
- [JavaScript](user/adding-glean-to-your-project/javascript.md)
|
||||
- [Qt/QML](user/adding-glean-to-your-project/qt.md)
|
||||
- [Integrating Glean for project managers](user/integrating-glean-for-product-managers.md)
|
||||
- [Metrics](user/metrics/adding-new-metrics.md)
|
||||
|
@ -27,7 +27,7 @@
|
|||
- [Android](user/debugging/android.md)
|
||||
- [iOS](user/debugging/ios.md)
|
||||
- [Python](user/debugging/python.md)
|
||||
- [Javascript](user/debugging/javascript.md)
|
||||
- [JavaScript](user/debugging/javascript.md)
|
||||
# API Reference
|
||||
|
||||
- [YAML Registry Format](reference/yaml/index.md)
|
||||
|
@ -66,7 +66,7 @@
|
|||
- [Android build configuration options](language-bindings/android/android-build-configuration-options.md)
|
||||
- [Android offline builds](language-bindings/android/android-offline-builds.md)
|
||||
- [Instrumenting Android crashes with the Glean SDK](language-bindings/android/instrument-android-crashes-example.md)
|
||||
- [Javascript](language-bindings/javascript/index.md)
|
||||
- [JavaScript](language-bindings/javascript/index.md)
|
||||
# Appendix
|
||||
|
||||
- [Glossary](appendix/glossary.md)
|
||||
|
|
|
@ -116,7 +116,7 @@ These are the tabs every tab section is expected to contain, in order:
|
|||
- Swift
|
||||
- Python
|
||||
- Rust
|
||||
- Javascript
|
||||
- JavaScript
|
||||
- Firefox Desktop
|
||||
|
||||
Finally, here is an example code for a tabs sections:
|
||||
|
@ -139,10 +139,10 @@ Finally, here is an example code for a tabs sections:
|
|||
Rust information...
|
||||
</div>
|
||||
<!--
|
||||
In this example, Javascript and Firefox Desktop
|
||||
In this example, JavaScript and Firefox Desktop
|
||||
would show up as disabled in the final page.
|
||||
-->
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
\{{#include ../../shared/tab_footer.md}}
|
||||
```
|
||||
|
@ -165,7 +165,7 @@ And this is how those tabs will look like:
|
|||
<div data-lang="Rust" class="tab">
|
||||
Rust information...
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
@ -197,7 +197,7 @@ This is how you can use the above attributes.
|
|||
<!-- No attribute, default text will show up. -->
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
<!-- data-bug attribute, default text will show up + link to bug. -->
|
||||
<div data-lang="Javascript" class="tab" data-bug="000000"></div>
|
||||
<div data-lang="JavaScript" class="tab" data-bug="000000"></div>
|
||||
<!-- data-info attribute, free form text will show up. -->
|
||||
<div data-lang="Firefox Desktop" class="tab" data-info="Hello, Glean world!"></div>
|
||||
\{{#include ../../shared/tab_footer.md}}
|
||||
|
@ -207,7 +207,7 @@ And this is how each tool tip is rendered.
|
|||
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
<div data-lang="Javascript" class="tab" data-bug="000000"></div>
|
||||
<div data-lang="JavaScript" class="tab" data-bug="000000"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab" data-info="Hello, Glean world!"></div>
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
|
|
|
@ -576,7 +576,7 @@ function formatNumber(number) {
|
|||
|
||||
|
||||
/**
|
||||
* Arbitrary base log function, Javascript doesn't have one
|
||||
* Arbitrary base log function, JavaScript doesn't have one
|
||||
*
|
||||
* @param {Number} number A numeric expression
|
||||
* @param {base} base The log base
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Glean Javascript SDK
|
||||
# Glean JavaScript SDK
|
||||
|
||||
The Glean Javascript SDK is not based on the same [Rust component](../../../dev/core/index.html)
|
||||
as the other Glean SDKs. Instead it is a full re-implementation of the Glean APIs in Javascript.
|
||||
The Glean JavaScript SDK is not based on the same [Rust component](../../../dev/core/index.html)
|
||||
as the other Glean SDKs. Instead it is a full re-implementation of the Glean APIs in JavaScript.
|
||||
|
||||
It can be used in:
|
||||
|
||||
- **Browser extensions**: available as `@mozilla/glean` [on npm](https://www.npmjs.com/package/@mozilla/glean);
|
||||
- **Qt/QML applications**: available for download on [glean.js/releases page](https://github.com/mozilla/glean.js/releases).
|
||||
|
||||
Support for other Javascript environments such as websites, Electron apps and Node.js applications
|
||||
Support for other JavaScript environments such as websites, Electron apps and Node.js applications
|
||||
is not out of the question and if you would like to use the SDK in one of these environments
|
||||
[reach out](../../README/md#contact) to our team.
|
||||
|
|
|
@ -42,7 +42,7 @@ use glean;
|
|||
glean.set_debug_view_tag("my-tag");
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import Glean from "@mozilla/glean/<platform>";
|
||||
|
@ -86,7 +86,7 @@ $ GLEAN_DEBUG_VIEW_TAG="my-tag" python my_application.py
|
|||
$ GLEAN_DEBUG_VIEW_TAG="my-tag" cargo run
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab" data-info="It is not possible to access environment variables from the currently supported Javascript platforms: Qt and browsers."></div>
|
||||
<div data-lang="JavaScript" class="tab" data-info="It is not possible to access environment variables from the currently supported JavaScript platforms: Qt and browsers."></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
```bash
|
||||
|
|
|
@ -14,7 +14,7 @@ Check out the platform specific guides on how to use Glean's debug functionaliti
|
|||
1. [Debugging Android applications using the Glean SDK](../../user/debugging/android.md)
|
||||
2. [Debugging iOS applications using the Glean SDK](../../user/debugging/ios.md)
|
||||
3. [Debugging Python applications using the Glean SDK](../../user/debugging/python.md)
|
||||
4. [Debugging Javascript applications using Glean.js](../../user/debugging/javascript.md)
|
||||
4. [Debugging JavaScript applications using Glean.js](../../user/debugging/javascript.md)
|
||||
|
||||
## Features
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ use glean;
|
|||
glean.set_log_pings(true);
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import Glean from "@mozilla/glean/<platform>";
|
||||
|
@ -89,7 +89,7 @@ $ GLEAN_LOG_PINGS=true python my_application.py
|
|||
$ GLEAN_LOG_PINGS=true cargo run
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab" data-info="It is not possible to access environment variables from the currently supported Javascript platforms: Qt and browsers."></div>
|
||||
<div data-lang="JavaScript" class="tab" data-info="It is not possible to access environment variables from the currently supported JavaScript platforms: Qt and browsers."></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
```bash
|
||||
|
|
|
@ -46,7 +46,7 @@ use glean;
|
|||
glean.set_source_tags(["my-tag", "your-tag", "our-tag"]);
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import Glean from "@mozilla/glean/<platform>";
|
||||
|
@ -90,7 +90,7 @@ $ GLEAN_SOURCE_TAGS=my-tag,your-tag,our-tag python my_application.py
|
|||
$ GLEAN_SOURCE_TAGS=my-tag,your-tag,our-tag cargo run
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab" data-info="It is not possible to access environment variables from the currently supported Javascript platforms: Qt and browsers."></div>
|
||||
<div data-lang="JavaScript" class="tab" data-info="It is not possible to access environment variables from the currently supported JavaScript platforms: Qt and browsers."></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
```bash
|
||||
|
|
|
@ -197,7 +197,7 @@ See [`PingUploader`](../../../docs/glean/net/trait.PingUploader.html) for detail
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
The main control for Glean is on the `Glean` singleton.
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ glean::initialize(cfg, client_info);
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab" data-info="On Firefox Desktop all custom pings are registered automatically."></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
`Glean.setUploadEnabled()` should be called in response to the user enabling or disabling telemetry.
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ flags::a11y_enabled.set(system.is_accessibility_enabled());
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as flags from "./path/to/generated/files/flags.js";
|
||||
|
@ -79,7 +79,7 @@ flags.a11yEnabled.set(this.isAccessibilityEnabled());
|
|||
mozilla::glean::flags::a11y_enabled.Set(false);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Glean.flags.a11yEnabled.set(false);
|
||||
|
@ -153,7 +153,7 @@ assert!(flags::a11y_enabled.test_get_value(None).unwrap());
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as flags from "./path/to/generated/files/flags.js";
|
||||
|
@ -172,7 +172,7 @@ assert(await flags.a11yEnabled.testGetValue());
|
|||
ASSERT_EQ(false, mozilla::glean::flags::a11y_enabled.TestGetValue().value());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Assert.equal(false, Glean.flags.a11yEnabled.testGetValue());
|
||||
|
@ -232,7 +232,7 @@ assert True is metrics.flags.a11y_enabled.test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -274,4 +274,4 @@ N/A
|
|||
* [Swift API docs](../../../swift/Classes/BooleanMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/boolean.html)
|
||||
* [Rust API docs](../../../docs/glean/private/boolean/struct.BooleanMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_boolean.default.html)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_boolean.default.html)
|
||||
|
|
|
@ -69,7 +69,7 @@ Increases the counter by a certain amount. If no amount is passed it defaults to
|
|||
controls::refresh_pressed.add(5); // Adds 5 to the counter.
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as controls from "./path/to/generated/files/controls.js";
|
||||
|
@ -89,7 +89,7 @@ Increases the counter by a certain amount. If no amount is passed it defaults to
|
|||
mozilla::glean::controls::refresh_pressed.Add(5);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Glean.controls.refreshPressed.add(1);
|
||||
|
@ -167,7 +167,7 @@ assert_eq!(6, controls::refresh_pressed.test_get_value(None).unwrap());
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as controls from "./path/to/generated/files/controls.js";
|
||||
|
@ -186,7 +186,7 @@ assert_eq!(6, controls::refresh_pressed.test_get_value(None).unwrap());
|
|||
ASSERT_EQ(6, mozilla::glean::controls::refresh_pressed.TestGetValue().value());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Assert.equal(6, Glean.controls.refreshPressed.testGetValue());
|
||||
|
@ -246,7 +246,7 @@ assert metrics.controls.refresh_pressed.test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -322,7 +322,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as controls from "./path/to/generated/files/controls.js";
|
||||
|
@ -371,4 +371,4 @@ N/A
|
|||
* [Swift API docs](../../../swift/Classes/CounterMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/counter.html)
|
||||
* [Rust API docs](../../../docs/glean/private/counter/struct.CounterMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_counter.default.html)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_counter.default.html)
|
||||
|
|
|
@ -40,7 +40,7 @@ graphics::checkerboard_peak.accumulate_samples_signed(vec![23]);
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
**C++**
|
||||
|
@ -109,7 +109,7 @@ assert_eq!(23, graphics::checkerboard_peak.test_get_value(None).unwrap().sum);
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
**C++**
|
||||
|
@ -153,7 +153,7 @@ assertTrue(Graphics.checkerboardPeak.testHasValue())
|
|||
<div data-lang="Swift" class="tab"></div>
|
||||
<div data-lang="Python" class="tab"></div>
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
@ -191,7 +191,7 @@ assert_eq!(
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
|
|
@ -78,7 +78,7 @@ install::first_run.set(Some(custom_date)); // Records a custom datetime
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as install from "./path/to/generated/files/install.js";
|
||||
|
@ -99,7 +99,7 @@ PRExplodedTime date = {0, 35, 10, 12, 6, 10, 2020, 0, 0, {5 * 60 * 60, 0}};
|
|||
mozilla::glean::install::first_run.Set(&date);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
const value = new Date("2020-06-11T12:00:00");
|
||||
|
@ -179,7 +179,7 @@ assert_eq!(expected_date, metrics.install.first_run.test_get_value(None));
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as install from "./path/to/generated/files/install.js";
|
||||
|
@ -267,7 +267,7 @@ assert "2019-03-25-05:00" == metrics.install.first_run.test_get_value_as_str()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as install from "./path/to/generated/files/install.js";
|
||||
|
@ -328,7 +328,7 @@ assert metrics.install.first_run.test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -397,7 +397,7 @@ assert_eq!(0, install::first_run.test_get_num_recorded_errors(
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as install from "./path/to/generated/files/install.js";
|
||||
|
|
|
@ -428,7 +428,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as views from "./path/to/generated/files/views.js";
|
||||
|
@ -497,4 +497,4 @@ Each extra key contains additional metadata:
|
|||
* [Swift API docs](../../../swift/Classes/EventMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/event.html)
|
||||
* [Rust API docs](../../../docs/glean/private/event/struct.EventMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_event.default.html)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_event.default.html)
|
||||
|
|
|
@ -59,7 +59,7 @@ accessibility::features.get("high_contrast").set(is_high_contrast_enabled());
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as acessibility from "./path/to/generated/files/acessibility.js";
|
||||
|
@ -79,7 +79,7 @@ mozilla::glean::accessibility::features.Get("screen_reader"_ns).Set(true);
|
|||
mozilla::glean::accessibility::features.Get("high_contrast"_ns).Set(false);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Glean.accessibility.features.screen_reader.set(true);
|
||||
Glean.accessibility.features["high_contrast"].set(false);
|
||||
|
@ -158,7 +158,7 @@ assert!(!accessibility::features.get("high_contrast").test_get_value(None).unwra
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as accessibility from "./path/to/generated/files/acessibility.js";
|
||||
|
@ -182,7 +182,7 @@ ASSERT_EQ(
|
|||
mozilla::glean::accessibility::features.Get("high_contrast"_ns).TestGetValue().ref());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Assert.equal(true, Glean.accessibility.features["screen_reader"].testGetValue());
|
||||
Assert.equal(false, Glean.accessibility.features.high_contrast.testGetValue());
|
||||
|
@ -245,7 +245,7 @@ assert metrics.accessibility.features["high_contrast"].test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -317,7 +317,7 @@ assert_eq!(
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as accessibility from "./path/to/generated/files/acessibility.js";
|
||||
|
@ -367,4 +367,4 @@ accessibility:
|
|||
* Swift API docs: [`LabeledMetricType`](../../../swift/Classes/LabeledMetricType.html), [`BooleanMetricType`](../../../swift/Classes/BooleanMetricType.html)
|
||||
* Python API docs: [`LabeledMetricBase`](../../../python/glean/metrics/labeled.html), [`BooleanMetricType`](../../../python/glean/metrics/boolean.html)
|
||||
* Rust API docs: [`LabeledMetric`](../../../docs/glean/private/struct.LabeledMetric.html), [`BooleanMetricType`](../../../docs/glean/private/struct.BooleanMetric.html)
|
||||
* Javascript API docs: [`LabeledMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_labeled.default.html), [`BooleanMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_boolean.default.html)
|
||||
* JavaScript API docs: [`LabeledMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_labeled.default.html), [`BooleanMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_boolean.default.html)
|
||||
|
|
|
@ -66,7 +66,7 @@ stability::crash_count.get("native_code_crash").add(3); // Adds 3 to the "native
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as stability from "./path/to/generated/files/stability.js";
|
||||
|
@ -88,7 +88,7 @@ mozilla::glean::stability::crash_count.Get("uncaught_exception"_ns).Add(1);
|
|||
mozilla::glean::stability::crash_count.Get("native_code_crash"_ns).Add(3);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Glean.stability.crashCount.uncaught_exception.add(1);
|
||||
Glean.stability.crashCount["native_code_crash"].add(3);
|
||||
|
@ -173,7 +173,7 @@ assert_eq!(3, stability::crash_count.get("native_code_crash").test_get_value().u
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as stability from "./path/to/generated/files/stability.js";
|
||||
|
@ -198,7 +198,7 @@ ASSERT_EQ(
|
|||
mozilla::glean::stability::crash_count.Get("native_code_crash"_ns).TestGetValue().ref());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Assert.equal(1, Glean.stability.crashCount["uncaught_exception"].testGetValue());
|
||||
Assert.equal(3, Glean.stability.crashCount.native_code_crash.testGetValue());
|
||||
|
@ -260,7 +260,7 @@ assert metrics.stability.crash_count["native_code_crash"].test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -332,7 +332,7 @@ assert_eq!(
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as stability from "./path/to/generated/files/stability.js";
|
||||
|
@ -383,4 +383,4 @@ accessibility:
|
|||
* Swift API docs: [`LabeledMetricType`](../../../swift/Classes/LabeledMetricType.html), [`CounterMetricType`](../../../swift/Classes/CounterMetricType.html)
|
||||
* Python API docs: [`LabeledMetricBase`](../../../python/glean/metrics/labeled.html), [`CounterMetricType`](../../../python/glean/metrics/counter.html)
|
||||
* Rust API docs: [`LabeledMetric`](../../../docs/glean/private/struct.LabeledMetric.html), [`CounterMetricType`](../../../docs/glean/private/struct.CounterMetric.html)
|
||||
* Javascript API docs: [`LabeledMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_labeled.default.html), [`CounterMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_counter.default.html)
|
||||
* JavaScript API docs: [`LabeledMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_labeled.default.html), [`CounterMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_counter.default.html)
|
||||
|
|
|
@ -54,7 +54,7 @@ login::errors_by_stage.get("server_auth").set("Invalid password");
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as login from "./path/to/generated/files/login.js";
|
||||
|
@ -72,7 +72,7 @@ login.errorsByStage["server_auth"].set("Invalid password");
|
|||
mozilla::glean::login::errors_by_stage.Get("server_auth"_ns).Set("Invalid password"_ns);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Glean.login.errorsByStage["server_auth"].set("Invalid password");
|
||||
```
|
||||
|
@ -151,7 +151,7 @@ assert!(login::errors_by_stage.get("server_auth").test_get_value());
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as login from "./path/to/generated/files/login.js";
|
||||
|
@ -174,7 +174,7 @@ ASSERT_STREQ("Invalid password",
|
|||
.get());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Assert.equal("Invalid password", Glean.login.errorsByStage["server_auth"].testGetValue());
|
||||
```
|
||||
|
@ -228,7 +228,7 @@ assert metrics.login.errors_by_stage["server_auth"].test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -301,7 +301,7 @@ assert_eq!(
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as login from "./path/to/generated/files/login.js";
|
||||
|
@ -351,4 +351,4 @@ login:
|
|||
* Swift API docs: [`LabeledMetricType`](../../../swift/Classes/LabeledMetricType.html), [`StringMetricType`](../../../swift/Classes/StringMetricType.html)
|
||||
* Python API docs: [`LabeledMetricBase`](../../../python/glean/metrics/labeled.html), [`StringMetricType`](../../../python/glean/metrics/string.html)
|
||||
* Rust API docs: [`LabeledMetric`](../../../docs/glean/private/struct.LabeledMetric.html), [`StringMetricType`](../../../docs/glean/private/struct.StringMetric.html)
|
||||
* Javascript API docs: [`LabeledMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_labeled.default.html), [`StringMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_string.default.html)
|
||||
* JavaScript API docs: [`LabeledMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_labeled.default.html), [`StringMetricType`](https://mozilla.github.io/glean.js/classes/core_metrics_types_string.default.html)
|
||||
|
|
|
@ -54,7 +54,7 @@ metrics.display.width.set(width)
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as display from "./path/to/generated/files/display.js";
|
||||
|
@ -82,7 +82,7 @@ display::width.set(width);
|
|||
mozilla::glean::display::width.Set(innerHeight);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Glean.display.width.set(innerHeight);
|
||||
|
@ -151,7 +151,7 @@ assert 6 == metrics.display.width.test_get_value()
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as display from "./path/to/generated/files/display.js";
|
||||
|
@ -181,7 +181,7 @@ assert!(display::width.test_get_value(None).is_some());
|
|||
ASSERT_EQ(433, mozilla::glean::display::width.TestGetValue().value());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Assert.equal(433, Glean.display.width.testGetValue());
|
||||
|
@ -239,7 +239,7 @@ assert metrics.display.width.test_has_value()
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
|
@ -300,7 +300,7 @@ assert 1 == metrics.display.width.test_get_num_recorded_errors(
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as display from "./path/to/generated/files/display.js";
|
||||
|
@ -369,4 +369,4 @@ Quantities have the required `unit` parameter, which is a free-form string for d
|
|||
* [Swift API docs](../../../swift/Classes/QuantityMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/quantity.html)
|
||||
* [Rust API docs](../../../docs/glean/private/quantity/struct.QuantityMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_quantity.default.html#set)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_quantity.default.html#set)
|
||||
|
|
|
@ -81,7 +81,7 @@ search_default::name.set("wikipedia");
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as searchDefault from "./path/to/generated/files/searchDefault.js";
|
||||
|
@ -103,7 +103,7 @@ searchDefault.name.set("wikipedia");
|
|||
mozilla::glean::search_default::name.Set("wikipedia"_ns);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
Glean.searchDefault.name.set("wikipedia");
|
||||
|
@ -187,7 +187,7 @@ assert_eq!(6, search_default::name.test_get_value(None).unwrap());
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as searchDefault from "./path/to/generated/files/searchDefault.js";
|
||||
|
@ -210,7 +210,7 @@ ASSERT_STREQ(
|
|||
);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
// Does it have the expected value?
|
||||
|
@ -274,7 +274,7 @@ assert metrics.search_default.name.test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -355,7 +355,7 @@ assert_eq!(
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as searchDefault from "./path/to/generated/files/searchDefault.js";
|
||||
|
@ -407,4 +407,4 @@ N/A
|
|||
* [Swift API docs](../../../swift/Classes/StringMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/string.html)
|
||||
* [Rust API docs](../../../docs/glean/private/struct.StringMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_string.default.html#set)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_string.default.html#set)
|
||||
|
|
|
@ -64,7 +64,7 @@ search::engines.add("duck duck go".to_string());
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
**C++**
|
||||
|
@ -145,7 +145,7 @@ search::engines.set(vec!["wikipedia".to_string(), "duck duck go".to_string()])
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
**C++**
|
||||
|
@ -234,7 +234,7 @@ assert_eq!(
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab">
|
||||
|
||||
**C++**
|
||||
|
@ -301,7 +301,7 @@ assert metrics.search.engines.test_has_value()
|
|||
|
||||
</div>
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
|
@ -365,7 +365,7 @@ assert_eq!(
|
|||
```
|
||||
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab" data-bug="1683171"></div>
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ fn show_login() {
|
|||
}
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as auth from "./path/to/generated/files/auth.js";
|
||||
|
@ -90,7 +90,7 @@ void OnShowLogin() {
|
|||
// ...
|
||||
}
|
||||
```
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
function onShowLogin() {
|
||||
Glean.auth.loginTime.start();
|
||||
|
@ -183,7 +183,7 @@ fn login() {
|
|||
}
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as auth from "./path/to/generated/files/auth.js";
|
||||
|
@ -204,7 +204,7 @@ void OnLogin() {
|
|||
// ...
|
||||
}
|
||||
```
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
function onLogin() {
|
||||
Glean.auth.loginTime.stop();
|
||||
|
@ -278,7 +278,7 @@ fn login_cancel() {
|
|||
}
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as auth from "./path/to/generated/files/auth.js";
|
||||
|
@ -299,7 +299,7 @@ void OnLoginCancel() {
|
|||
// ...
|
||||
}
|
||||
```
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
function onLoginCancel() {
|
||||
Glean.auth.loginTime.cancel();
|
||||
|
@ -356,7 +356,7 @@ with metrics.auth.login_time.measure():
|
|||
```
|
||||
</div>
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
@ -430,7 +430,7 @@ fn after_login(login_elapsed: Duration) {
|
|||
}
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as auth from "./path/to/generated/files/auth.js";
|
||||
|
@ -460,7 +460,7 @@ void AfterLogin(uint32_t aDuration) {
|
|||
// ...
|
||||
}
|
||||
```
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
function afterLogin(aDuration) {
|
||||
Glean.auth.loginTime.setRaw(aDuration);
|
||||
|
@ -525,7 +525,7 @@ use fog::metrics;
|
|||
assert!(metrics::login_time.test_get_value().unwrap() > 0);
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as auth from "./path/to/generated/files/auth.js";
|
||||
|
@ -541,7 +541,7 @@ assert(await auth.loginTime.testGetValue() > 0);
|
|||
|
||||
ASSERT_TRUE(mozilla::glean::auth::login_time.TestGetValue().value() > 0);
|
||||
```
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
```js
|
||||
Assert.ok(Glean.auth.loginTime.testGetValue() > 0);
|
||||
```
|
||||
|
@ -594,7 +594,7 @@ use fog::metrics;
|
|||
assert!(metrics::login_time.test_has_value().unwrap() > 0);
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
@ -652,7 +652,7 @@ use fog::metrics;
|
|||
assert_eq!(1, login_time.test_get_num_recorded_errors(ErrorType::InvalidValue));
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as auth from "./path/to/generated/files/auth.js";
|
||||
|
@ -725,4 +725,4 @@ and use the largest possible value that will provide useful information so as to
|
|||
* [Swift API docs](../../../swift/Classes/TimespanMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/timespan.html)
|
||||
* [Rust API docs](../../../docs/glean/private/struct.TimespanMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_timespan.default.html)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_timespan.default.html)
|
||||
|
|
|
@ -65,7 +65,7 @@ user::client_id.generate_and_set();
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as user from "./path/to/generated/files/user.js";
|
||||
|
@ -85,7 +85,7 @@ user.clientId.generateAndSet();
|
|||
mozilla::glean::user::client_id.GenerateAndSet();
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
// Generate a new UUID and record it.
|
||||
|
@ -157,7 +157,7 @@ user::client_id.set(Uuid::new_v4());
|
|||
```
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as user from "./path/to/generated/files/user.js";
|
||||
|
@ -179,7 +179,7 @@ nsCString kUuid("decafdec-afde-cafd-ecaf-decafdecafde");
|
|||
mozilla::glean::user::client_id.Set(kUuid);
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
// Set a specific value.
|
||||
|
@ -260,7 +260,7 @@ assert_eq!(u, user::client_id.test_get_value(None).unwrap());
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as user from "./path/to/generated/files/user.js";
|
||||
|
@ -281,7 +281,7 @@ assert(uuid, await user.clientId.testGetValue());
|
|||
ASSERT_STREQ(kUuid.get(), mozilla::glean::user::client_id.TestGetValue().value().get());
|
||||
```
|
||||
|
||||
**Javascript**
|
||||
**JavaScript**
|
||||
|
||||
```js
|
||||
const uuid = "decafdec-afde-cafd-ecaf-decafdecafde";
|
||||
|
@ -346,7 +346,7 @@ assert metrics.user.client_id.test_has_value()
|
|||
|
||||
<div data-lang="Rust" class="tab"></div>
|
||||
|
||||
<div data-lang="Javascript" class="tab"></div>
|
||||
<div data-lang="JavaScript" class="tab"></div>
|
||||
|
||||
<div data-lang="Firefox Desktop" class="tab"></div>
|
||||
|
||||
|
@ -422,7 +422,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as user from "./path/to/generated/files/user.js";
|
||||
|
@ -472,4 +472,4 @@ N/A
|
|||
* [Swift API docs](../../../swift/Classes/UuidMetricType.html)
|
||||
* [Python API docs](../../../python/glean/metrics/uuid.html)
|
||||
* [Rust API docs](../../../docs/glean/private/uuid/struct.UuidMetric.html)
|
||||
* [Javascript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_uuid.default.html#set)
|
||||
* [JavaScript API docs](https://mozilla.github.io/glean.js/classes/core_metrics_types_uuid.default.html#set)
|
||||
|
|
|
@ -55,7 +55,7 @@ pings::search.submit(pings::SearchReasonCodes::Performed);
|
|||
|
||||
</div>
|
||||
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
```js
|
||||
import * as pings from "./path/to/generated/files/pings.js";
|
||||
|
|
|
@ -33,7 +33,7 @@ Additionally, applications (but not libraries) **must**:
|
|||
> Step-by-step tutorials for each supported language/platform,
|
||||
> can be found on the specific integration guides:
|
||||
>
|
||||
> - [Javascript](./javascript.md)
|
||||
> - [JavaScript](./javascript.md)
|
||||
> - [Kotlin](./kotlin.md)
|
||||
> - [Python](./python.md)
|
||||
> - [Swift](./swift.md)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Adding Glean to your Javascript project
|
||||
# Adding Glean to your JavaScript project
|
||||
|
||||
This page provides a step-by-step guide on how to integrate the [Glean.js](https://github.com/mozilla/glean.js/) library into a Javascript project.
|
||||
This page provides a step-by-step guide on how to integrate the [Glean.js](https://github.com/mozilla/glean.js/) library into a JavaScript project.
|
||||
|
||||
Nevertheless this is just one of the required steps for integrating Glean successfully into a project. Check you the full [Glean integration checklist](./index.md) for a comprehensive list of all the steps involved in doing so.
|
||||
|
||||
|
@ -19,7 +19,7 @@ Currently, these bindings support collecting data from [Browser Extensions](http
|
|||
|
||||
The Glean.js package is distributed as an npm package [`@mozilla/glean`](https://www.npmjs.com/package/@mozilla/glean).
|
||||
|
||||
Install Glean.js in your Javascript project, by running:
|
||||
Install Glean.js in your JavaScript project, by running:
|
||||
|
||||
```bash
|
||||
npm install @mozilla/glean
|
||||
|
@ -69,7 +69,7 @@ Please make sure that you are using a supported Node.js runtime and also make su
|
|||
|
||||
## Setting up metrics and pings code generation
|
||||
|
||||
In Javascript, the metrics and pings definitions must be parsed at build time.
|
||||
In JavaScript, the metrics and pings definitions must be parsed at build time.
|
||||
The `@mozilla/glean` package exposes [glean_parser](https://github.com/mozilla/glean_parser) through the `glean` script.
|
||||
|
||||
To parse your YAML registry files using this script, define a new script in your `package.json` file:
|
||||
|
|
|
@ -62,7 +62,7 @@ glean_parser translate path/to/metrics.yaml path/to/pings.yaml \
|
|||
```
|
||||
|
||||
The `translate` command will takes a list of YAML registry file paths and an output path and parse
|
||||
the given YAML registry files into QML Javascript files.
|
||||
the given YAML registry files into QML JavaScript files.
|
||||
|
||||
The generated folder will be a QML module. Make sure wherever the generated module is placed is also
|
||||
part of the [QML Import Path](https://doc.qt.io/qt-5/qtqml-syntax-imports.html#qml-import-path).
|
||||
|
@ -71,7 +71,7 @@ Notice that when building for Qt/QML it is mandatory to give the `translate` com
|
|||
|
||||
#### `--option platform=qt`
|
||||
|
||||
This option is what changes the output file from standard Javascript to QML Javascript.
|
||||
This option is what changes the output file from standard JavaScript to QML JavaScript.
|
||||
|
||||
#### `--option version=<version>`
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ For method 3. please refer to the platform specific pages on how to debug produc
|
|||
1. [Debugging Android applications using the Glean SDK](./android.md)
|
||||
2. [Debugging iOS applications using the Glean SDK](./ios.md)
|
||||
3. [Debugging Python applications using the Glean SDK](./python.md)
|
||||
4. [Debugging Javascript applications using Glean.js](./javascript.md)
|
||||
4. [Debugging JavaScript applications using Glean.js](./javascript.md)
|
||||
|
||||
### Available debugging methods per platform
|
||||
|
||||
|
@ -63,7 +63,7 @@ For method 3. please refer to the platform specific pages on how to debug produc
|
|||
| Swift | ✅ | ✅ | ✅ [^2] |
|
||||
| Python | | ✅ | |
|
||||
| Rust | ✅ | ✅ | |
|
||||
| Javascript | ✅ | | |
|
||||
| JavaScript | ✅ | | |
|
||||
| Firefox Desktop | | ✅ | ✅ [^3] |
|
||||
|
||||
[^1]: In Kotlin, the Glean SDK exposes the [`GleanDebugActivity`](./android.md) for interacting with debug features. Although it is technically possible to also use environment variables in Android, the Glean team is not aware of a proper way to set environment variables in Android devices or emulators.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Debugging Javascript applications using Glean.js
|
||||
# Debugging JavaScript applications using Glean.js
|
||||
|
||||
Debugging features in Python can be enabled through APIs exposed on the Glean object.
|
||||
For more information on the available features and how to enable them,
|
||||
|
|
|
@ -280,7 +280,7 @@ use fog::metrics;
|
|||
metrics::compound_category::metric_name...
|
||||
```
|
||||
</div>
|
||||
<div data-lang="Javascript" class="tab">
|
||||
<div data-lang="JavaScript" class="tab">
|
||||
|
||||
JavaScript identifiers are customarily `camelCase`.
|
||||
This requires transforming a metric defined in the `metrics.yaml` as:
|
||||
|
|
|
@ -6,7 +6,7 @@ This ping is intended to provide metrics that are managed by the Glean SDK itsel
|
|||
|
||||
### Platform availability
|
||||
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | Javascript | Firefox Desktop |
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | JavaScript | Firefox Desktop |
|
||||
|-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
||||
| [`baseline` ping](baseline.md) | ✅ | ✅ | | ✅ | | ✅ |
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ As such it attempts to send itself at the moment the user opts out of data colle
|
|||
|
||||
### Platform availability
|
||||
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | Javascript | Firefox Desktop |
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | JavaScript | Firefox Desktop |
|
||||
|-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
||||
| [`deletion-request` ping](deletion_request.md) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ If the application crashes, an `events` ping is generated next time the applicat
|
|||
|
||||
### Platform availability
|
||||
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | Javascript | Firefox Desktop |
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | JavaScript | Firefox Desktop |
|
||||
|-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
||||
| [`events` ping](events.md) | ✅ | ✅ | ✅ | ✅ | | ✅ |
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ Additionally, it is undesirable to mix metric recording from different versions
|
|||
|
||||
### Platform availability
|
||||
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | Javascript | Firefox Desktop |
|
||||
| Language Binding | Kotlin | Swift | Python | Rust | JavaScript | Firefox Desktop |
|
||||
|-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
||||
| [`metrics` ping](metrics.md) | ✅ | ✅ | | ✅ | | ✅ |
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ There is also a [high-level overview](ping-schedules-and-timings.html) of how th
|
|||
| Swift | ✅ | ✅ | ✅ | ✅ |
|
||||
| Python | | ✅ | | |
|
||||
| Rust | ✅ | ✅ | ✅ | ✅ |
|
||||
| Javascript | | ✅ | | |
|
||||
| JavaScript | | ✅ | | |
|
||||
| Firefox Desktop | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
## Defining foreground and background state
|
||||
|
|
Загрузка…
Ссылка в новой задаче