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: Deprecate sanitize_properties #1632

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rafaeelaudibert
Copy link
Member

Changes

We can achieve the exact same outcome we achieve with sanitize_properties by using before_send which is a much more compreheensive function, with better usability and ergonomics.

We can't remove this function without a major, so let's deprecate it and issue a console warning when it's used.

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

@rafaeelaudibert rafaeelaudibert requested review from pauldambra and a team December 27, 2024 14:53
Copy link

vercel bot commented Dec 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Dec 27, 2024 3:00pm

src/posthog-core.ts Outdated Show resolved Hide resolved
We can achieve the exact same outcome we achieve with `sanitize_properties` by using `before_send` which is a much more compreheensive function, with better usability and ergonomics.

We can't remove this function without a major, so let's deprecate it and issue a console warning when it's used.
@rafaeelaudibert rafaeelaudibert force-pushed the deprecate-sanitize-properties-over-before-send branch from 8d54002 to 6bd0137 Compare December 27, 2024 14:55
@rafaeelaudibert rafaeelaudibert added the bump minor Bump minor version when this PR gets merged label Dec 27, 2024
Copy link

github-actions bot commented Dec 27, 2024

Size Change: +1.41 kB (+0.04%)

Total Size: 3.22 MB

Filename Size Change
dist/array.full.es5.js 262 kB +142 B (+0.05%)
dist/array.full.js 365 kB +142 B (+0.04%)
dist/array.full.no-external.js 364 kB +142 B (+0.04%)
dist/array.js 179 kB +140 B (+0.08%)
dist/array.no-external.js 178 kB +140 B (+0.08%)
dist/main.js 180 kB +140 B (+0.08%)
dist/module.full.js 365 kB +142 B (+0.04%)
dist/module.full.no-external.js 364 kB +142 B (+0.04%)
dist/module.js 179 kB +140 B (+0.08%)
dist/module.no-external.js 178 kB +140 B (+0.08%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 206 kB
dist/customizations.full.js 12.6 kB
dist/dead-clicks-autocapture.js 14.4 kB
dist/exception-autocapture.js 9.48 kB
dist/external-scripts-loader.js 2.64 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 57.6 kB
dist/surveys.js 63.3 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

rafaeelaudibert added a commit to PostHog/posthog.com that referenced this pull request Dec 27, 2024
We're deprecating `sanitize_properties` on PostHog/posthog-js#1632, so let's suggest using `before_send` everywhere where we previously suggested `sanitize_properties`
@rafaeelaudibert
Copy link
Member Author

Website update to suggest before_send over sanitize_properties: PostHog/posthog.com#10229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant