Skip to content

Commit

Permalink
Update CHANGELOG and tests for removal of bigint (#35)
Browse files Browse the repository at this point in the history
* Update CHANGELOG and tests
* Point to new openrpc branch
* Update package-lock.json
* Update package.json
  • Loading branch information
jlacivita authored Jun 15, 2022
1 parent 96ca908 commit bf8ae65
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions test/typescript/declarations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -23,7 +23,7 @@ test('Able to get resolution', () => {
test('purchaseContent', () => {
return Discovery.purchasedContent({
expires: '',
totalCount: BigInt(5),
totalCount: 5,
entries: [
]
}).then(() => {
Expand Down

0 comments on commit bf8ae65

Please sign in to comment.