From fe2e5198d3be8c64759b2c7457fb0fab6e8932ba Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 9 Oct 2023 16:10:48 +0200 Subject: [PATCH 1/6] Fix import type issue --- posthog-react-native/src/posthog-rn.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog-react-native/src/posthog-rn.ts b/posthog-react-native/src/posthog-rn.ts index 735348ca..87b5668a 100644 --- a/posthog-react-native/src/posthog-rn.ts +++ b/posthog-react-native/src/posthog-rn.ts @@ -6,7 +6,7 @@ import { PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, -} from '../../posthog-core' +} from '../../posthog-core/src' import { PostHogMemoryStorage } from '../../posthog-core/src/storage-memory' import { getLegacyValues } from './legacy' import { SemiAsyncStorage } from './storage' From 6919cec1d8a121f925ba862fc4932dc91810e984 Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 9 Oct 2023 16:16:57 +0200 Subject: [PATCH 2/6] Added ci check --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48ce3cf9..f93284f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,3 +34,16 @@ jobs: - run: yarn compile - run: yarn lint - run: yarn prettier:check + + type-check: + timeout-minutes: 3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 16 + - run: | + cd examples/example-expo + yarn + yarn tsc From a404c2fefea0b1eaa059f796ea62b6e568cb89a1 Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 9 Oct 2023 16:20:27 +0200 Subject: [PATCH 3/6] Fix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f93284f2..97956d35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,5 +45,6 @@ jobs: node-version: 16 - run: | cd examples/example-expo + yarn global add yalc yarn yarn tsc From a92a33f357ca392f760f7582d1a5921e96494f3b Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 9 Oct 2023 16:21:13 +0200 Subject: [PATCH 4/6] Updated versions --- posthog-react-native/CHANGELOG.md | 4 ++++ posthog-react-native/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/posthog-react-native/CHANGELOG.md b/posthog-react-native/CHANGELOG.md index 77ef31ef..7434a86f 100644 --- a/posthog-react-native/CHANGELOG.md +++ b/posthog-react-native/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.8.1 - 2023-10-09 + +1. Fixes a type generation issue + # 2.8.0 - 2023-10-06 1. Added new `const [flag, payload] = useFeatureFlagWithPayload('my-flag-name')` hook that returns the flag result and it's payload if it has one. diff --git a/posthog-react-native/package.json b/posthog-react-native/package.json index 9d9647b5..11f1710a 100644 --- a/posthog-react-native/package.json +++ b/posthog-react-native/package.json @@ -1,6 +1,6 @@ { "name": "posthog-react-native", - "version": "2.8.0", + "version": "2.8.1", "main": "lib/posthog-react-native/index.js", "files": [ "lib/" From 4c4177691038619fb70e88f7c2ea7780090027a7 Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 9 Oct 2023 16:22:36 +0200 Subject: [PATCH 5/6] Fix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97956d35..3552e529 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: with: node-version: 16 - run: | + yarn cd examples/example-expo yarn global add yalc yarn From 00741e5ac0e4ce48066827a11875356ce8773f76 Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 9 Oct 2023 16:47:59 +0200 Subject: [PATCH 6/6] Fix type issues --- posthog-core/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/posthog-core/src/index.ts b/posthog-core/src/index.ts index a0026406..0fe39c51 100644 --- a/posthog-core/src/index.ts +++ b/posthog-core/src/index.ts @@ -36,6 +36,8 @@ class PostHogFetchNetworkError extends Error { name = 'PostHogFetchNetworkError' constructor(public error: unknown) { + // TRICKY: "cause" is a newer property but is just ignored otherwise. Cast to any to ignore the type issue. + // @ts-ignore super('Network error while fetching PostHog', error instanceof Error ? { cause: error } : {}) } }