From bf8ae6594df2f4cc4dcf6e12d89cb872512b7335 Mon Sep 17 00:00:00 2001 From: Jeremy LaCivita Date: Wed, 15 Jun 2022 17:20:48 -0400 Subject: [PATCH] Update CHANGELOG and tests for removal of bigint (#35) * Update CHANGELOG and tests * Point to new openrpc branch * Update package-lock.json * Update package.json --- CHANGELOG.md | 23 +++++++++++++++++++++++ package-lock.json | 8 ++++---- test/typescript/declarations.test.ts | 8 ++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9f6457ee..e1f21d731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Release Notes +## 0.7.0 + +- Removed all `bigint` types from TypeScript declarations, in favor of `number`, since bigint is not widely supported across browsers. This changes impacts: + - Device.screenResolution + - Device.videoResolution + - Discovery.purchasedContent + - Metrics.mediaProgress + - Metrics.mediaSeeking + - Metrics.mediaSeeked + - Parameters.initialization + +To upgrade to 0.7.0 simply change the type of any Firebolt Promise resolutions from `bigint` to `number`, e.g.: + +```typescript +const res:[bigint, bigint] = await Device.screenResolution() +``` + +Should become: + +```typescript +const res:[number, number] = await Device.screenResolution() +``` + ## 0.6.2 - Fixed incompatibility with Jest 26 due to [jest/issues/10565](https://github.com/facebook/jest/issues/10565) diff --git a/package-lock.json b/package-lock.json index 0b6e54817..24d9a01da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.6.1", "license": "Apache-2.0", "devDependencies": { - "@firebolt-js/openrpc": "git://github.com/rdkcentral/firebolt-openrpc.git", + "@firebolt-js/openrpc": "rdkcentral/firebolt-openrpc#fix/bigint", "@firebolt-js/schemas": "git://github.com/rdkcentral/firebolt-schemas.git", "ajv": "^6.12.6", "jest": "^28.1.0", @@ -511,7 +511,7 @@ }, "node_modules/@firebolt-js/openrpc": { "version": "1.4.1", - "resolved": "git+ssh://git@github.com/rdkcentral/firebolt-openrpc.git#3ce57b6d2679c57b29e9840b005e16ff3c0894ba", + "resolved": "git+ssh://git@github.com/rdkcentral/firebolt-openrpc.git#61a50e9f14c2b9128119be79cf7c56f44c3d138b", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -7952,9 +7952,9 @@ "dev": true }, "@firebolt-js/openrpc": { - "version": "git+ssh://git@github.com/rdkcentral/firebolt-openrpc.git#3ce57b6d2679c57b29e9840b005e16ff3c0894ba", + "version": "git+ssh://git@github.com/rdkcentral/firebolt-openrpc.git#61a50e9f14c2b9128119be79cf7c56f44c3d138b", "dev": true, - "from": "@firebolt-js/openrpc@git://github.com/rdkcentral/firebolt-openrpc.git", + "from": "@firebolt-js/openrpc@rdkcentral/firebolt-openrpc#fix/bigint", "requires": { "ajv": "^8.3.0", "ajv-formats": "^2.1.0", diff --git a/test/typescript/declarations.test.ts b/test/typescript/declarations.test.ts index 458fc105f..0c76120ea 100644 --- a/test/typescript/declarations.test.ts +++ b/test/typescript/declarations.test.ts @@ -4,17 +4,17 @@ import { sent } from "../Setup" import { test, expect } from "@jest/globals" import { Lifecycle, Device, Discovery } from "../../dist/lib/firebolt"; -let listenerId:bigint +let listenerId:number test('Able to get TypeScript listenerId', () => { - return Lifecycle.listen('inactive', () => {}).then((id:bigint) => { + return Lifecycle.listen('inactive', () => {}).then((id:number) => { listenerId = id expect(listenerId > 0).toBe(true) }) }) test('Able to get resolution', () => { - return Device.screenResolution().then( (res:[bigint, bigint]) => { + return Device.screenResolution().then( (res:[number, number]) => { expect(res[0]>0).toBe(true) expect(res[1]>0).toBe(true) }) @@ -23,7 +23,7 @@ test('Able to get resolution', () => { test('purchaseContent', () => { return Discovery.purchasedContent({ expires: '', - totalCount: BigInt(5), + totalCount: 5, entries: [ ] }).then(() => {