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: Update Svelte Onboarding Code #27155

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nermalcat69
Copy link

Problem

I was setting up posthog for my website saasplates.com which is written in svelte and i noticed this problem so thought i should fix it.

Changes

Added OnMount as it's the best one and works best when a user visits the site.

👉 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?

Copy link
Member

@rafaeelaudibert rafaeelaudibert left a comment

Choose a reason for hiding this comment

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

Hey, @nermalcat69! This is great! I agree this is a much better fix - and ChatGPT agrees with the both of us, I'm not the best at Svelte :)

There are two changes we might want here:

  • Can you make sure you're importing onMount? My understanding is that it's not available by default, correct me if I'm wrong
  • Can you by any chance update our Svelte documentation on the website as well? It's fine if you can't get to it, I can always try and update it myself, but I believe you have more knowledge than I have :)

The docs are live here: https://posthog.com/docs/libraries/svelte
Our docs live in here, and it should be easy to find where to update it: https://github.com/PostHog/posthog.com

@nermalcat69
Copy link
Author

Sureee, Thanks @rafaeelaudibert i'll get back to you ASAP!

@rafaeelaudibert
Copy link
Member

Sureee, Thanks @rafaeelaudibert i'll get back to you ASAP!

Make sure you're enjoying the end-of-year break as well :). Thank you!

@nermalcat69
Copy link
Author

Review it whenever you get time and thanks for your time 💯

Merry Belated Christmas 😄

@nermalcat69
Copy link
Author

The docs pr: PostHog/posthog.com#10223

Copy link
Member

@rafaeelaudibert rafaeelaudibert left a comment

Choose a reason for hiding this comment

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

🎉

@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) December 26, 2024 23:12
@rafaeelaudibert rafaeelaudibert changed the title 🦔 Fix Svelte Code During Onboarding fix: Update Svelte Onboarding Code Dec 26, 2024
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.

2 participants