@keyframerdev/vitals 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,6 +60,7 @@ Before your store release, declare it in the stores' privacy forms (App Store: D
60
60
  | `device` | none | `{ model, memoryBytes, memoryGb, tier, displayHz }`, read by the app (for example from `expo-device`) |
61
61
  | `appId` | none | The bundle id or package name |
62
62
  | `endpoint` | `https://vitals.keyframer.dev` | The ingest server |
63
+ | `debug` | `false` | Logs what the SDK decides, measures and sends: the session and its sampling, frames a second per thread, each report against the server's limits. Lines are tagged `[Keyframer.dev]` and go through `console.debug`, so Metro shows them as `DEBUG` (a note for you, such as development builds being off, is `INFO`; a refused report is `WARN`). For development builds |
63
64
 
64
65
  ## Call sites with file and line
65
66
 
package/dist/index.js CHANGED
@@ -624,7 +624,7 @@ var MAX_FRAME_MS = 10 * 60 * 1000;
624
624
 
625
625
  // src/version.ts
626
626
  var SDK_NAME = "@keyframerdev/vitals";
627
- var SDK_VERSION = "0.1.4";
627
+ var SDK_VERSION = "0.1.5";
628
628
 
629
629
  // src/controller.ts
630
630
  var STORAGE_KEYS = {
@@ -684,6 +684,7 @@ async function write(storage, key, value) {
684
684
  await storage.setItem(key, JSON.stringify(value));
685
685
  } catch {}
686
686
  }
687
+ var TAG = "[Keyframer.dev]";
687
688
 
688
689
  class VitalsController {
689
690
  env;
@@ -813,7 +814,7 @@ class VitalsController {
813
814
  }
814
815
  }
815
816
  this.sampled = sampled;
816
- this.debug(`session ${this.nonce.slice(0, 6)}: ${sampled ? "sampled" : "not sampled"} (rate ${this.sampleRate}, environment ${env}` + `${devOk ? "" : ", the project does not collect development builds"})`);
817
+ this.debug(`Motion Vitals ${SDK_VERSION}, session ${this.nonce.slice(0, 6)}: ${sampled ? "sampled" : "not sampled"} (rate ${this.sampleRate}, environment ${env}` + `${devOk ? "" : ", the project does not collect development builds"})`);
817
818
  if (!sampled)
818
819
  return;
819
820
  this.collector.clear();
@@ -1258,7 +1259,7 @@ class VitalsController {
1258
1259
  if (kept)
1259
1260
  this.debug("this project keeps development builds: this build's reports show in the dashboard's Development view");
1260
1261
  else
1261
- this.env.log?.("[keyframer vitals] This project does not keep reports from development builds, so this build sends nothing. " + `To test here, turn on "Development builds" in the project's setup on keyframer.dev, then reload. Release builds are not affected.`, "info");
1262
+ this.env.log?.(`${TAG} This project does not keep reports from development builds, so this build sends nothing. ` + `To test here, turn on "Development builds" in the project's setup on keyframer.dev, then reload. Release builds are not affected.`, "info");
1262
1263
  }
1263
1264
  if (!kept && this.sampled)
1264
1265
  this.endSampling();
@@ -1295,11 +1296,11 @@ class VitalsController {
1295
1296
  }
1296
1297
  }
1297
1298
  log(message) {
1298
- this.env.log?.(`[keyframer vitals] ${message}`);
1299
+ this.env.log?.(`${TAG} ${message}`, "warn");
1299
1300
  }
1300
1301
  debug(message) {
1301
1302
  if (this.opts?.debug)
1302
- this.env.log?.(`[keyframer vitals] ${message}`, "debug");
1303
+ this.env.log?.(`${TAG} ${message}`, "debug");
1303
1304
  }
1304
1305
  }
1305
1306
 
@@ -1450,7 +1451,7 @@ var env = {
1450
1451
  setTimeout: (fn, ms) => setTimeout(fn, ms),
1451
1452
  clearTimeout: (h) => clearTimeout(h),
1452
1453
  platform: { os: Platform.OS === "ios" ? "ios" : "android", osMajor: osMajor() },
1453
- log: (m, level) => level === "debug" || level === "info" ? console.log(m) : console.warn(m)
1454
+ log: (m, level) => level === "debug" ? console.debug(m) : level === "info" ? console.info(m) : console.warn(m)
1454
1455
  };
1455
1456
  var controller = new VitalsController(env);
1456
1457
  var jsHook = createJsHook(controller, () => checkScreen());
@@ -1,3 +1,3 @@
1
1
  /** This package's version: sent in every report's `sdk`, and compared with the config's `minSdk`. Keep it in step with package.json. */
2
2
  export declare const SDK_NAME = "@keyframerdev/vitals";
3
- export declare const SDK_VERSION = "0.1.4";
3
+ export declare const SDK_VERSION = "0.1.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyframerdev/vitals",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Motion Vitals for React Native: slow frames and janky animations from production, by screen and call site",
5
5
  "keywords": [
6
6
  "react-native",