-
Notifications
You must be signed in to change notification settings - Fork 129
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: Add better npm import, and script entrypoint for customizations #1550
Merged
robbie-c
merged 2 commits into
main
from
feature/add-a-better-npm-and-script-export-for-customizations
Nov 26, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './setAllPersonProfilePropertiesAsPersonPropertiesForFlags' | ||
export * from './before-send' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// this file is called customizations.full.ts because it includes all customizations | ||
// this naming scheme allows us to create a lighter version in the future with only the most popular customizations | ||
// without breaking backwards compatibility | ||
|
||
import * as customizations from '../customizations' | ||
import { assignableWindow } from '../utils/globals' | ||
assignableWindow.posthogCustomizations = customizations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,7 +224,7 @@ export class PostHogPersistence { | |
const campaignParams = Info.campaignParams(this.config.custom_campaign_params) | ||
// only save campaign params if there were any | ||
if (!isEmptyObject(stripEmptyProperties(campaignParams))) { | ||
this.register(Info.campaignParams(this.config.custom_campaign_params)) | ||
this.register(campaignParams) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drive-by, saw this could be smaller |
||
} | ||
this.campaign_params_saved = true | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry should have commented here
it's a big size bump for a convenience change...
i guess they're either not pure or rollup isn't detecting them as pure...
need some kind of /@NO_SIDE_EFFECTS/ marker somewhere so that these are only available in NPM not in the bundles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the size bump tells me that this hasn't worked as expected.
I'll look into it
Apologies for the premature tagging for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I removed the tsconfig change, and this seems to have prevented the increase in bundle size. I'll figure this part out separately.