Filter AB Tests Props - #4403
Merged
Merged
Conversation
mxdvl
force-pushed
the
mxdvl/filter-ab-tests
branch
from
March 25, 2022 09:26
c2b6c14 to
1a6ef02
Compare
mxdvl
marked this pull request as ready for review
March 25, 2022 09:27
mxdvl
requested review from
a team,
JamieB-gu,
iainjchambers-guardian and
marsavar
March 25, 2022 09:27
|
Size Change: -11.6 kB (-1%) Total Size: 1.54 MB
ℹ️ View Unchanged
|
mxdvl
force-pushed
the
mxdvl/islands/ab-swr
branch
from
March 25, 2022 14:38
13b0a37 to
2307f58
Compare
Switches that start with "ab" are used for AB tests. We strip those out of the list of switches to reduce the amount of prop data that needs to be serialised for the SetABTests Island.
mxdvl
force-pushed
the
mxdvl/filter-ab-tests
branch
from
March 25, 2022 14:47
1a6ef02 to
0ac7296
Compare
jlieb10
reviewed
Mar 28, 2022
jlieb10
reviewed
Mar 28, 2022
jlieb10
approved these changes
Mar 28, 2022
jlieb10
left a comment
Contributor
There was a problem hiding this comment.
Looks good, some optional comments :)
| */ | ||
| export const filterABTestSwitches = (switches: Switches): ABTestSwitches => | ||
| Object.fromEntries( | ||
| Object.entries(switches).filter(([key]) => key.startsWith('ab')), |
Contributor
There was a problem hiding this comment.
should we downcase the key string before matching on it? in case someone writes it as 'AB' instead of 'ab'?
Contributor
Author
There was a problem hiding this comment.
Abysmal, abhorrent, abominable! 😝
From the frontend docs
The convention is that the test id has to start with the characters 'ab-'.
There might be other switches that start with these characters, but failing to filter them out is not a major issue. There’s just a few bytes more data sent over the wire.
Co-authored-by: Joshua <jlieb10@users.noreply.github.com>
Co-authored-by: Joshua <jlieb10@users.noreply.github.com>
Co-authored-by: Joshua <jlieb10@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this change?
Filter out AB Test Props
Why?
Because we can limit the amout of props passed.
Closes #4190
Before
{ "abTestSwitches": { "anniversaryHeaderSvg": true, "prebidAppnexusUkRow": true, "commercialMetrics": true, "prebidTrustx": true, "scAdFreeBanner": false, "prebidPermutiveAudience": true, "compareVariantDecision": false, "enableSentryReporting": true, "lazyLoadContainers": true, "adFreeStrictExpiryEnforcement": false, "liveblogRendering": true, "remarketing": true, "fetchNonRefreshableLineItems": true, "registerWithPhone": false, "targeting": true, "remoteHeader": true, "extendedMostPopularFronts": true, "slotBodyEnd": true, "prebidImproveDigitalSkins": true, "emailInlineInFooter": true, "showNewPrivacyWordingOnEmailSignupEmbeds": true, "facebookTrackingPixel": true, "iasAdTargeting": true, "extendedMostPopular": true, "ampContentAbTesting": true, "prebidAnalytics": true, "prebidCriteo": true, "puzzlesBanner": true, "abSpacefinderOkrMegaTest": false, "imrWorldwide": true, "acast": true, "twitterUwt": true, "prebidAppnexusInvcode": true, "a9HeaderBidding": true, "prebidAppnexus": true, "enableDiscussionSwitch": true, "standaloneCommercialBundle": true, "prebidXaxis": true, "stickyVideos": true, "interactiveFullHeaderSwitch": true, "discussionAllPageSize": true, "prebidUserSync": true, "audioOnwardJourneySwitch": true, "mobileStickyPrebid": true, "externalVideoEmbeds": true, "simpleReach": true, "carrotTrafficDriver": true, "sentinelLogger": true, "geoMostPopular": true, "weAreHiring": true, "relatedContent": true, "thirdPartyEmbedTracking": true, "prebidOzone": true, "ampAmazon": true, "abCommercialLazyLoadMargin": true, "prebidAdYouLike": true, "mostViewedFronts": true, "abSignInGateMainControl": true, "ampPrebid": true, "googleSearch": true, "brazeSwitch": true, "consentManagement": true, "commercial": true, "redplanetForAus": true, "prebidSonobi": true, "idProfileNavigation": true, "confiantAdVerification": true, "discussionAllowAnonymousRecommendsSwitch": false, "scrollDepth": true, "permutive": true, "comscore": true, "webFonts": true, "prebidImproveDigital": true, "ophan": true, "crosswordSvgThumbnails": true, "prebidTriplelift": true, "weather": true, "commercialOutbrainNewids": true, "abSignInGateMainVariant": true, "abAdblockAsk": true, "prebidPubmatic": true, "serverShareCounts": false, "autoRefresh": true, "enhanceTweets": true, "prebidIndexExchange": true, "prebidOpenx": true, "prebidHeaderBidding": true, "idCookieRefresh": true, "sharingComments": true, "discussionPageSize": true, "smartAppBanner": false, "boostGaUserTimingFidelity": false, "historyTags": true, "mobileStickyLeaderboard": true, "surveys": true, "remoteBanner": true, "emailSignupRecaptcha": true, "prebidSmart": true, "inizio": true }, "pageIsSensitive": false, "isDev": false }After
{ "abTestSwitches": { "abSpacefinderOkrMegaTest": false, "abCommercialLazyLoadMargin": true, "abSignInGateMainControl": true, "abSignInGateMainVariant": true, "abAdblockAsk": true }, "pageIsSensitive": false, "isDev": false }