Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Sep 10, 2024

Problem

Closes https://github.com/PostHog/posthog-js-lite/issues/255
Similar to #57

Changes

Release info Sub-libraries affected

Bump level

  • Major
  • Minor
  • Patch

Libraries affected

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Changelog notes

  • Added support for X

Copy link

github-actions bot commented Sep 10, 2024

Size Change: +463 B (+0.43%)

Total Size: 109 kB

Filename Size Change
posthog-node/lib/index.cjs.js 20.8 kB +5 B (+0.02%)
posthog-node/lib/index.esm.js 20.7 kB +5 B (+0.02%)
posthog-react-native/lib/posthog-core/src/utils.js 870 B +48 B (+5.84%) 🔍
posthog-web/lib/index.cjs.js 17.8 kB +203 B (+1.15%)
posthog-web/lib/index.esm.js 17.8 kB +202 B (+1.15%)
ℹ️ View Unchanged
Filename Size
posthog-react-native/lib/posthog-core/src/eventemitter.js 1.08 kB
posthog-react-native/lib/posthog-core/src/index.js 10 kB
posthog-react-native/lib/posthog-core/src/lz-string.js 1.42 kB
posthog-react-native/lib/posthog-core/src/types.js 420 B
posthog-react-native/lib/posthog-core/src/vendor/uuidv7.js 2.04 kB
posthog-react-native/lib/posthog-react-native/index.js 485 B
posthog-react-native/lib/posthog-react-native/src/autocapture.js 1.8 kB
posthog-react-native/lib/posthog-react-native/src/frameworks/wix-navigation.js 651 B
posthog-react-native/lib/posthog-react-native/src/hooks/useFeatureFlag.js 437 B
posthog-react-native/lib/posthog-react-native/src/hooks/useFeatureFlags.js 362 B
posthog-react-native/lib/posthog-react-native/src/hooks/useLifecycleTracker.js 416 B
posthog-react-native/lib/posthog-react-native/src/hooks/useNavigationTracker.js 628 B
posthog-react-native/lib/posthog-react-native/src/hooks/usePostHog.js 249 B
posthog-react-native/lib/posthog-react-native/src/legacy.js 810 B
posthog-react-native/lib/posthog-react-native/src/native-deps.js 1.2 kB
posthog-react-native/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js 183 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalExpoApplication.js 215 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalExpoDevice.js 211 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js 224 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js 216 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js 220 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js 218 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js 222 B
posthog-react-native/lib/posthog-react-native/src/optional/OptionalSessionReplay.js 231 B
posthog-react-native/lib/posthog-react-native/src/posthog-rn.js 4.42 kB
posthog-react-native/lib/posthog-react-native/src/PostHogContext.js 210 B
posthog-react-native/lib/posthog-react-native/src/PostHogProvider.js 1.57 kB
posthog-react-native/lib/posthog-react-native/src/storage.js 1.09 kB
posthog-react-native/lib/posthog-react-native/src/types.js 90 B
posthog-react-native/lib/posthog-react-native/src/version.js 123 B

compressed-size-action

Comment on lines -96 to -98
if (!window) {
return false
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkStoreIsSupported is only called if there's a window

@marandaneto marandaneto requested review from benjackwhite and a team September 10, 2024 08:46
marandaneto and others added 3 commits September 10, 2024 13:39
Co-authored-by: Ben White <ben@posthog.com>
Co-authored-by: Ben White <ben@posthog.com>
@marandaneto marandaneto marked this pull request as ready for review January 17, 2025 09:53
@marandaneto
Copy link
Member Author

Screenshot 2025-01-17 at 11 01 48

works for web and node, assuming this will work for the web workers too since all I've done is to add extra checks for the window and fetch objects.
totally forgot about this issue btw, I was skimming thru the repo and noticed the open PR, well now it's done.

@marandaneto marandaneto merged commit 70d810b into main Jan 17, 2025
4 checks passed
@marandaneto marandaneto deleted the fix/window-web branch January 17, 2025 10:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work in Next.js serverless (API route)
3 participants