Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Type issue with RN #119

Merged
merged 7 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ 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: |
yarn
cd examples/example-expo
yarn global add yalc
yarn
yarn tsc
2 changes: 2 additions & 0 deletions posthog-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } : {})
}
}
Expand Down
4 changes: 4 additions & 0 deletions posthog-react-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/package.json
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion posthog-react-native/src/posthog-rn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading