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

Ophan tracker JS does its own types #11438

Merged
merged 20 commits into from
Jul 12, 2024
Merged

Ophan tracker JS does its own types #11438

merged 20 commits into from
Jul 12, 2024

Conversation

mxdvl
Copy link
Contributor

@mxdvl mxdvl commented May 16, 2024

What does this change?

Bump @guardian/ophan-tracker-js to the latest version and use its exported types, which are now owned by the @guardian/ophan team rather than being declared in @guardian/libs

Why?

The team responsible for the data analysis is best placed to own the type declaration! We should see less errors and dropped events once this is in place.

Known issues

  • Some errors have been explicitely ignored for now, but specific teams should ensure the data is sent as they expect
  • The Ophan-related types are still exported from @guardian/libs and should be marked as deprecated
  • The “DO NOT MERGE” label is kept until we release a proper minor version of the library, not a pre-release

Potential risks

This being a key part of our analytics, we should be extra careful in releasing changes.

@JamieB-gu JamieB-gu added this to the Requests milestone May 16, 2024
Jonathan Flynn and others added 4 commits June 18, 2024 15:54
what happen to those?
are they dropped on the floor?
do they make their way into the lakehouse?
Copy link
Contributor Author

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

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

Pinged teams that should investigate existing events with errors…

dotcom-rendering/src/lib/braze/buildBrazeMessaging.ts Outdated Show resolved Hide resolved
dotcom-rendering/src/lib/messagePicker.ts Outdated Show resolved Hide resolved
dotcom-rendering/src/lib/messagePicker.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jul 2, 2024

Size Change: -31 B (0%)

Total Size: 889 kB

ℹ️ View Unchanged
Filename Size Change
dotcom-rendering/dist/1094.client.web.********************.js 6.17 kB 0 B
dotcom-rendering/dist/1225.client.web.********************.js 785 B 0 B
dotcom-rendering/dist/1299.client.web.********************.js 937 B 0 B
dotcom-rendering/dist/1445.client.web.********************.js 18.1 kB 0 B
dotcom-rendering/dist/1639.client.web.********************.js 2.52 kB 0 B
dotcom-rendering/dist/1692.client.web.********************.js 3.13 kB 0 B
dotcom-rendering/dist/1714.client.web.********************.js 3.21 kB 0 B
dotcom-rendering/dist/1762.client.web.********************.js 3.39 kB 0 B
dotcom-rendering/dist/1889.client.web.********************.js 3.63 kB 0 B
dotcom-rendering/dist/2170.client.web.********************.js 6.78 kB 0 B
dotcom-rendering/dist/2342.client.web.********************.js 1.01 kB 0 B
dotcom-rendering/dist/237.client.web.********************.js 2.23 kB 0 B
dotcom-rendering/dist/2373.client.web.********************.js 11.2 kB 0 B
dotcom-rendering/dist/2398.client.web.********************.js 6.51 kB 0 B
dotcom-rendering/dist/2471.client.web.********************.js 723 B 0 B
dotcom-rendering/dist/2521.client.web.********************.js 4.68 kB 0 B
dotcom-rendering/dist/2778.client.web.********************.js 858 B 0 B
dotcom-rendering/dist/2780.client.web.********************.js 6.42 kB 0 B
dotcom-rendering/dist/2920.client.web.********************.js 523 B 0 B
dotcom-rendering/dist/3000.client.web.********************.js 895 B 0 B
dotcom-rendering/dist/3113.client.web.********************.js 4.51 kB 0 B
dotcom-rendering/dist/3114.client.web.********************.js 663 B 0 B
dotcom-rendering/dist/3118.client.web.********************.js 499 B 0 B
dotcom-rendering/dist/3255.client.web.********************.js 809 B 0 B
dotcom-rendering/dist/33.client.web.********************.js 3.41 kB 0 B
dotcom-rendering/dist/3336.client.web.********************.js 785 B 0 B
dotcom-rendering/dist/336.client.web.********************.js 13.5 kB 0 B
dotcom-rendering/dist/3371.client.web.********************.js 6.4 kB 0 B
dotcom-rendering/dist/3431.client.web.********************.js 5.87 kB 0 B
dotcom-rendering/dist/3433.client.web.********************.js 9.19 kB 0 B
dotcom-rendering/dist/3494.client.web.********************.js 834 B 0 B
dotcom-rendering/dist/3523.client.web.********************.js 3.35 kB 0 B
dotcom-rendering/dist/3642.client.web.********************.js 791 B 0 B
dotcom-rendering/dist/3689.client.web.********************.js 4.3 kB 0 B
dotcom-rendering/dist/3715.client.web.********************.js 4.21 kB 0 B
dotcom-rendering/dist/3787.client.web.********************.js 4.8 kB -2 B (-0.04%)
dotcom-rendering/dist/3879.client.web.********************.js 4.15 kB 0 B
dotcom-rendering/dist/3922.client.web.********************.js 731 B 0 B
dotcom-rendering/dist/3932.client.web.********************.js 790 B 0 B
dotcom-rendering/dist/4103.client.web.********************.js 22.6 kB 0 B
dotcom-rendering/dist/4108.client.web.********************.js 5.48 kB 0 B
dotcom-rendering/dist/424.client.web.********************.js 757 B 0 B
dotcom-rendering/dist/4442.client.web.********************.js 833 B 0 B
dotcom-rendering/dist/4639.client.web.********************.js 3 kB 0 B
dotcom-rendering/dist/4666.client.web.********************.js 9.47 kB 0 B
dotcom-rendering/dist/4673.client.web.********************.js 731 B 0 B
dotcom-rendering/dist/4771.client.web.********************.js 3.02 kB 0 B
dotcom-rendering/dist/4807.client.web.********************.js 4.29 kB 0 B
dotcom-rendering/dist/4811.client.web.********************.js 1.01 kB 0 B
dotcom-rendering/dist/5044.client.web.********************.js 811 B 0 B
dotcom-rendering/dist/5077.client.web.********************.js 441 B 0 B
dotcom-rendering/dist/5084.client.web.********************.js 759 B 0 B
dotcom-rendering/dist/5127.client.web.********************.js 4.39 kB 0 B
dotcom-rendering/dist/5247.client.web.********************.js 2.81 kB 0 B
dotcom-rendering/dist/5308.client.web.********************.js 2.69 kB 0 B
dotcom-rendering/dist/5312.client.web.********************.js 3.21 kB 0 B
dotcom-rendering/dist/565.client.web.********************.js 675 B 0 B
dotcom-rendering/dist/5666.client.web.********************.js 3.11 kB 0 B
dotcom-rendering/dist/5750.client.web.********************.js 3.21 kB 0 B
dotcom-rendering/dist/5817.client.web.********************.js 922 B 0 B
dotcom-rendering/dist/6002.client.web.********************.js 3.09 kB 0 B
dotcom-rendering/dist/6093.client.web.********************.js 758 B 0 B
dotcom-rendering/dist/6167.client.web.********************.js 646 B 0 B
dotcom-rendering/dist/6346.client.web.********************.js 3.57 kB 0 B
dotcom-rendering/dist/6351.client.web.********************.js 6.26 kB 0 B
dotcom-rendering/dist/6436.client.web.********************.js 5.13 kB 0 B
dotcom-rendering/dist/6640.client.web.********************.js 913 B 0 B
dotcom-rendering/dist/6843.client.web.********************.js 7.3 kB 0 B
dotcom-rendering/dist/6885.client.web.********************.js 4.61 kB 0 B
dotcom-rendering/dist/6908.client.web.********************.js 3.48 kB 0 B
dotcom-rendering/dist/7062.client.web.********************.js 2.3 kB 0 B
dotcom-rendering/dist/7116.client.web.********************.js 23 kB 0 B
dotcom-rendering/dist/7196.client.web.********************.js 895 B 0 B
dotcom-rendering/dist/72.client.web.********************.js 966 B 0 B
dotcom-rendering/dist/7387.client.web.********************.js 961 B 0 B
dotcom-rendering/dist/7403.client.web.********************.js 2.67 kB 0 B
dotcom-rendering/dist/7544.client.web.********************.js 3.07 kB 0 B
dotcom-rendering/dist/7660.client.web.********************.js 3.67 kB 0 B
dotcom-rendering/dist/7697.client.web.********************.js 620 B 0 B
dotcom-rendering/dist/7723.client.web.********************.js 925 B 0 B
dotcom-rendering/dist/8134.client.web.********************.js 601 B 0 B
dotcom-rendering/dist/8179.client.web.********************.js 834 B 0 B
dotcom-rendering/dist/8279.client.web.********************.js 43.1 kB 0 B
dotcom-rendering/dist/8463.client.web.********************.js 156 B 0 B
dotcom-rendering/dist/8565.client.web.********************.js 653 B 0 B
dotcom-rendering/dist/8757.client.web.********************.js 3.54 kB 0 B
dotcom-rendering/dist/8791.client.web.********************.js 1.01 kB 0 B
dotcom-rendering/dist/8861.client.web.********************.js 3.98 kB 0 B
dotcom-rendering/dist/889.client.web.********************.js 860 B 0 B
dotcom-rendering/dist/8907.client.web.********************.js 792 B 0 B
dotcom-rendering/dist/9060.client.web.********************.js 886 B 0 B
dotcom-rendering/dist/9225.client.web.********************.js 583 B 0 B
dotcom-rendering/dist/9247.client.web.********************.js 3.83 kB 0 B
dotcom-rendering/dist/9287.client.web.********************.js 2.42 kB 0 B
dotcom-rendering/dist/9396.client.web.********************.js 691 B 0 B
dotcom-rendering/dist/9430.client.web.********************.js 510 B 0 B
dotcom-rendering/dist/9447.client.web.********************.js 3.05 kB 0 B
dotcom-rendering/dist/9593.client.web.********************.js 2.93 kB 0 B
dotcom-rendering/dist/9604.client.web.********************.js 528 B 0 B
dotcom-rendering/dist/9638.client.web.********************.js 12.4 kB 0 B
dotcom-rendering/dist/9723.client.web.********************.js 4.06 kB 0 B
dotcom-rendering/dist/9789.client.web.********************.js 924 B 0 B
dotcom-rendering/dist/9826.client.web.********************.js 3.42 kB 0 B
dotcom-rendering/dist/9936.client.web.********************.js 1.84 kB 0 B
dotcom-rendering/dist/Accessibility-importable.client.web.********************.js 6.18 kB 0 B
dotcom-rendering/dist/AdBlockAsk-importable.client.web.********************.js 2.85 kB 0 B
dotcom-rendering/dist/AdPortals-importable.client.web.********************.js 3.84 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.client.web.********************.js 425 B 0 B
dotcom-rendering/dist/AppsEpic-importable.client.web.********************.js 3.54 kB 0 B
dotcom-rendering/dist/AppsFooter-importable.client.web.********************.js 3.64 kB 0 B
dotcom-rendering/dist/AppsLightboxImage-importable.client.web.********************.js 3.03 kB 0 B
dotcom-rendering/dist/AppsLightboxImageStore-importable.client.web.********************.js 2.47 kB 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.client.web.********************.js 3.58 kB 0 B
dotcom-rendering/dist/AustralianTerritorySwitcher-importable.client.web.********************.js 2.33 kB 0 B
dotcom-rendering/dist/Branding-importable.client.web.********************.js 3.08 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.client.web.********************.js 37.2 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.client.web.********************.js 1.9 kB +1 B (+0.05%)
dotcom-rendering/dist/CalloutBlockComponent-importable.client.web.********************.js 6.7 kB 0 B
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.client.web.********************.js 5.75 kB 0 B
dotcom-rendering/dist/CardCommentCount-importable.client.web.********************.js 4.9 kB 0 B
dotcom-rendering/dist/Carousel-importable.client.web.********************.js 5.99 kB 0 B
dotcom-rendering/dist/CarouselForNewsletters-importable.client.web.********************.js 6.84 kB 0 B
dotcom-rendering/dist/ChartAtom-importable.client.web.********************.js 539 B 0 B
dotcom-rendering/dist/CommentCount-importable.client.web.********************.js 3.26 kB 0 B
dotcom-rendering/dist/DiscussionApps-importable.client.web.********************.js 1.81 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.client.web.********************.js 1.09 kB 0 B
dotcom-rendering/dist/DiscussionWeb-importable.client.web.********************.js 1.67 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.client.web.********************.js 3.64 kB 0 B
dotcom-rendering/dist/EditionSwitcherBanner-importable.client.web.********************.js 6.5 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.client.web.********************.js 3.74 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.client.web.********************.js 2.02 kB 0 B
dotcom-rendering/dist/FetchOnwardsData-importable.client.web.********************.js 2.43 kB 0 B
dotcom-rendering/dist/FilterKeyEventsToggle-importable.client.web.********************.js 5.21 kB 0 B
dotcom-rendering/dist/FocusStyles-importable.client.web.********************.js 622 B 0 B
dotcom-rendering/dist/FollowWrapper-importable.client.web.********************.js 3.37 kB 0 B
dotcom-rendering/dist/FooterLabel-importable.client.web.********************.js 346 B 0 B
dotcom-rendering/dist/FooterReaderRevenueLinks-importable.client.web.********************.js 3.54 kB 0 B
dotcom-rendering/dist/frameworks.client.web.********************.js 20.7 kB 0 B
dotcom-rendering/dist/FrontSubNav-importable.client.web.********************.js 6.5 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.client.web.********************.js 4.34 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.client.web.********************.js 10.6 kB 0 B
dotcom-rendering/dist/GetMatchStats-importable.client.web.********************.js 7.91 kB 0 B
dotcom-rendering/dist/GetMatchTabs-importable.client.web.********************.js 2.64 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.client.web.********************.js 16.7 kB 0 B
dotcom-rendering/dist/guardian-braze-components-end-of-article.client.web.********************.js 11 kB 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.client.web.********************.js 3.02 kB 0 B
dotcom-rendering/dist/HeaderTopBar-importable.client.web.********************.js 7.49 kB 0 B
dotcom-rendering/dist/index.client.web.********************.js 45.9 kB +14 B (+0.03%)
dotcom-rendering/dist/InstagramBlockComponent-importable.client.web.********************.js 3.29 kB 0 B
dotcom-rendering/dist/InteractiveAtomMessenger-importable.client.web.********************.js 851 B 0 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.client.web.********************.js 6.3 kB 0 B
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.client.web.********************.js 4.68 kB 0 B
dotcom-rendering/dist/InteractiveSupportButton-importable.client.web.********************.js 6.52 kB 0 B
dotcom-rendering/dist/KeyEventsCarousel-importable.client.web.********************.js 4.73 kB 0 B
dotcom-rendering/dist/KnowledgeQuizAtom-importable.client.web.********************.js 3.5 kB 0 B
dotcom-rendering/dist/LatestLinks-importable.client.web.********************.js 3.61 kB 0 B
dotcom-rendering/dist/LightboxHash-importable.client.web.********************.js 435 B 0 B
dotcom-rendering/dist/LightboxLayout-importable.client.web.********************.js 6.47 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.client.web.********************.js 3.7 kB 0 B
dotcom-rendering/dist/Liveness-importable.client.web.********************.js 4.94 kB 0 B
dotcom-rendering/dist/ManyNewsletterSignUp-importable.client.web.********************.js 9.81 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.client.web.********************.js 5.44 kB 0 B
dotcom-rendering/dist/Metrics-importable.client.web.********************.js 2.96 kB 0 B
dotcom-rendering/dist/MostViewedFooter-importable.client.web.********************.js 5.93 kB 0 B
dotcom-rendering/dist/MostViewedFooterData-importable.client.web.********************.js 8.52 kB 0 B
dotcom-rendering/dist/MostViewedRightWithAd-importable.client.web.********************.js 4.62 kB 0 B
dotcom-rendering/dist/OnwardsUpper-importable.client.web.********************.js 6.62 kB 0 B
dotcom-rendering/dist/PersonalityQuizAtom-importable.client.web.********************.js 3.63 kB 0 B
dotcom-rendering/dist/ProfileAtom-importable.client.web.********************.js 2.8 kB 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.client.web.********************.js 3.04 kB 0 B
dotcom-rendering/dist/PulsingDot-importable.client.web.********************.js 749 B 0 B
dotcom-rendering/dist/QandaAtom-importable.client.web.********************.js 2.8 kB 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.client.web.********************.js 469 B 0 B
dotcom-rendering/dist/readerRevenueDevUtils.client.web.********************.js 1.92 kB 0 B
dotcom-rendering/dist/RelativeTime-importable.client.web.********************.js 2.51 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.client.web.********************.js 4.81 kB 0 B
dotcom-rendering/dist/SecureSignup-importable.client.web.********************.js 5.1 kB 0 B
dotcom-rendering/dist/SendTargetingParams-importable.client.web.********************.js 2.15 kB 0 B
dotcom-rendering/dist/sentry.client.web.********************.js 764 B 0 B
dotcom-rendering/dist/SetABTests-importable.client.web.********************.js 3.67 kB 0 B
dotcom-rendering/dist/SetAdTargeting-importable.client.web.********************.js 484 B 0 B
dotcom-rendering/dist/ShareButton-importable.client.web.********************.js 1.53 kB 0 B
dotcom-rendering/dist/shimport.client.web.********************.js 2.8 kB 0 B
dotcom-rendering/dist/ShowHideContainers-importable.client.web.********************.js 649 B 0 B
dotcom-rendering/dist/ShowMore-importable.client.web.********************.js 1.41 kB 0 B
dotcom-rendering/dist/SignInGateMain.client.web.********************.js 3.99 kB -24 B (-0.6%)
dotcom-rendering/dist/SignInGateMainCheckoutComplete.client.web.********************.js 3.91 kB -22 B (-0.56%)
dotcom-rendering/dist/SignInGateSelector-importable.client.web.********************.js 3.11 kB -14 B (-0.45%)
dotcom-rendering/dist/SlotBodyEnd-importable.client.web.********************.js 3.44 kB 0 B
dotcom-rendering/dist/SpotifyBlockComponent-importable.client.web.********************.js 5.28 kB 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.client.web.********************.js 4.05 kB 0 B
dotcom-rendering/dist/StickyLiveblogAskWrapper-importable.client.web.********************.js 7.91 kB 0 B
dotcom-rendering/dist/SubNav-importable.client.web.********************.js 3.37 kB 0 B
dotcom-rendering/dist/SupportTheG-importable.client.web.********************.js 6.51 kB +16 B (+0.25%)
dotcom-rendering/dist/TableOfContents-importable.client.web.********************.js 3.2 kB 0 B
dotcom-rendering/dist/TimelineAtom-importable.client.web.********************.js 3.23 kB 0 B
dotcom-rendering/dist/TopBar-importable.client.web.********************.js 5.03 kB 0 B
dotcom-rendering/dist/TopBarSupport-importable.client.web.********************.js 2.75 kB 0 B
dotcom-rendering/dist/TweetBlockComponent-importable.client.web.********************.js 1.02 kB 0 B
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.client.web.********************.js 3.3 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.client.web.********************.js 5.45 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.client.web.********************.js 3.13 kB 0 B
dotcom-rendering/dist/WeatherWrapper-importable.client.web.********************.js 6.65 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.client.web.********************.js 3.08 kB 0 B

compressed-size-action

@mxdvl mxdvl marked this pull request as ready for review July 3, 2024 12:11
@mxdvl mxdvl requested review from a team as code owners July 3, 2024 12:11
Copy link

github-actions bot commented Jul 3, 2024

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@@ -108,6 +108,7 @@ export const buildBrazeMessaging = async (
const sdkLoadTimeTaken = endPerformanceMeasure();
const ophan = await getOphan(renderingTarget);
ophan.record({
// @ts-expect-error -- is this event dropped by Ophan?

Choose a reason for hiding this comment

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

Maybe adjust these comments to state that these events are being dropped and add a link to this PR for further context or a note that other teams will remove it later on.

@domlander
Copy link
Contributor

I notice that the type OphanComponentEvent from @guardian/libs is still used in a lot of places. Can these all be switched over to ComponentEvent from @guardian/ophan-tracker-js now?

@jonflynng jonflynng self-requested a review July 11, 2024 15:05
teams should remove the invalid calls to Ophan,
when they are able to do so, as these events are
being dropped by Ophan, having an invalid shape.
@mxdvl
Copy link
Contributor Author

mxdvl commented Jul 11, 2024

I notice that the type OphanComponentEvent from @guardian/libs is still used in a lot of places. Can these all be switched over to ComponentEvent from @guardian/ophan-tracker-js now?

Unfortunately, it’s not straightforward as the @guardian/support-dotcom-components package still expects functions to be compatible with OphanComponentEvents, resulting in TypeScript compiler errors. I’ve raised a draft PR to demonstrate: #11853

@mxdvl mxdvl added the run_chromatic Runs chromatic when label is applied label Jul 11, 2024
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jul 11, 2024
@mxdvl mxdvl merged commit 76bad65 into main Jul 12, 2024
35 checks passed
@mxdvl mxdvl deleted the mxdvl/ophan-tracker-js-types branch July 12, 2024 06:56
@prout-bot
Copy link

Seen on PROD (merged by @mxdvl 9 minutes and 54 seconds ago) Please check your changes!

@mxdvl
Copy link
Contributor Author

mxdvl commented Jul 12, 2024

Ophan are happy with the release.

Follow-up required by various teams:

  • @guardian/growth to look into using these @guardian/ophan-tracker-js types for @guardian/support-dotcom-components
  • @guardian/value to look into removing the dropped component events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants