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

chore: deprecate property_blacklist in favor of property_denylist #1044

Merged
merged 12 commits into from
Feb 27, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Feb 27, 2024

Changes

Let's make our config more inclusive.

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!)

@posthog-bot
Copy link
Collaborator

Hey @marandaneto! 👋
This pull request seems to contain no description. Please add useful context, rationale, and/or any other information that will help make sense of this change now and in the distant Mars-based future.

@marandaneto marandaneto requested a review from a team February 27, 2024 12:21
Copy link

github-actions bot commented Feb 27, 2024

Size Change: +869 B (0%)

Total Size: 860 kB

Filename Size Change
dist/array.full.js 185 kB +218 B (0%)
dist/array.js 126 kB +217 B (0%)
dist/es.js 126 kB +217 B (0%)
dist/module.js 126 kB +217 B (0%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 12 kB
dist/recorder-v2.js 106 kB
dist/recorder.js 58.6 kB
dist/surveys-module-previews.js 62 kB
dist/surveys.js 58.3 kB

compressed-size-action

src/posthog-core.ts Outdated Show resolved Hide resolved
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

a little nit-picking about where/when we handle the config but otherwise :shipit:

src/posthog-core.ts Outdated Show resolved Hide resolved
_each(property_blacklist, function (blacklisted_prop) {
delete properties[blacklisted_prop]
// since property_blacklist is deprecated in favor of property_denylist, we merge both of them here
const property_denylist = [...this.config.property_blacklist, ...this.config.property_denylist]
Copy link
Member

Choose a reason for hiding this comment

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

also feels like we should merge this once, i think maybe we have to do it in init and in set_config

that way internally the SDK only has a denylist, and existing config gets copied into it whenever we evaluate the config

Copy link
Member Author

Choose a reason for hiding this comment

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

discussed offline, and added a TODO for now, it requires a bit of test refactoring to make it work since the override option always replaces the set_config call.

Copy link
Collaborator

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

Apart from what looks like a typo 👍

src/__tests__/posthog-core.js Outdated Show resolved Hide resolved
@marandaneto marandaneto marked this pull request as ready for review February 27, 2024 13:41
@marandaneto marandaneto merged commit c0578e3 into main Feb 27, 2024
13 checks passed
@marandaneto marandaneto deleted the chore/property-denylist branch February 27, 2024 13:41
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