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

feat: Swap to use dedicated version checker #24345

Closed
wants to merge 7 commits into from

Conversation

benjackwhite
Copy link
Contributor

Problem

Needs PostHog/posthog-js#1357

Changes

  • Swap to use dedicated prop rather than the internal method but still using it as a safe fallback

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

const posthogVersion =
posthog.version ??
(posthog as any)?._calculate_event_properties?.('test', {})?.['$lib_version'] ??
'0.0.0'
const majorMinorVersion = posthogVersion.split('.')
Copy link
Member

Choose a reason for hiding this comment

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

Minor point, but we could also replace this with the functions from semver (would be along the lines of compareVersion(a,b) >= 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given it is just a fallback I am going to be lazy and say no if thats alright 😅 but happy for you to take over and do it

Copy link
Member

Choose a reason for hiding this comment

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

I did this here #24484

benjackwhite and others added 2 commits August 14, 2024 13:29
# Conflicts:
#	frontend/src/toolbar/elements/heatmapLogic.ts
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

  • chromium: 0 added, 3 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Aug 14, 2024

Size Change: +13 B (0%)

Total Size: 1.07 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.07 MB +13 B (0%)

compressed-size-action

@benjackwhite benjackwhite deleted the fix/js-version-checl branch August 21, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants