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

Migrate standard epic to DCR #9959

Merged
merged 18 commits into from
Jan 10, 2024
Merged

Migrate standard epic to DCR #9959

merged 18 commits into from
Jan 10, 2024

Conversation

tomrf1
Copy link
Member

@tomrf1 tomrf1 commented Dec 19, 2023

Background

Currently our marketing components (epic, banner, header links) live in SDC. The SDC repo also has the server that does targeting/AB testing of marketing messages.
We want to move the client-side components from SDC to DCR.

So far, only the liveblog epic has been migrated to DCR:
#9538

Changes

This PR migrates the standard article epic.
As with the liveblog epic, the files have been copied over largely unchanged (besides import and linting fixes).

Note - this does remove the Apple Pay button feature from the epic. This was AB tested last year but is not currently in use. Migrating it to DCR would have made this PR a bit more involved so I'm leaving it out. If we change our minds later then we can do the work to add it back in. Original SDC PR.

Size

Before (from S3):
Screenshot 2024-01-04 at 15 11 29

After (webpack chunk):
Screenshot 2024-01-04 at 15 16 44

Screenshots from CODE

(Plenty more in storybook)

Screenshot 2024-01-04 at 15 35 05
Screenshot 2024-01-04 at 15 35 29
Screenshot 2024-01-04 at 15 35 37

Copy link

github-actions bot commented Dec 19, 2023

Size Change: +10.5 kB (+1%)

Total Size: 756 kB

Filename Size Change
dotcom-rendering/dist/8795.client.web.********************.js 0 B -16.2 kB (removed) 🏆
dotcom-rendering/dist/9031.client.web.********************.js 0 B -8.98 kB (removed) 🏆
dotcom-rendering/dist/AustralianTerritorySwitcher-importable.client.web.********************.js 1.99 kB -2.63 kB (-57%) 🏆
dotcom-rendering/dist/1229.client.web.********************.js 8.66 kB +8.66 kB (new file) 🆕
dotcom-rendering/dist/5250.client.web.********************.js 3.22 kB +3.22 kB (new file) 🆕
dotcom-rendering/dist/6898.client.web.********************.js 8.24 kB +8.24 kB (new file) 🆕
dotcom-rendering/dist/8344.client.web.********************.js 1.56 kB +1.56 kB (new file) 🆕
dotcom-rendering/dist/8903.client.web.********************.js 16.6 kB +16.6 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
dotcom-rendering/dist/1028.client.web.********************.js 788 B 0 B
dotcom-rendering/dist/1079.client.web.********************.js 5.06 kB 0 B
dotcom-rendering/dist/11.client.web.********************.js 5.19 kB 0 B
dotcom-rendering/dist/115.client.web.********************.js 3.74 kB 0 B
dotcom-rendering/dist/1170.client.web.********************.js 3.6 kB 0 B
dotcom-rendering/dist/1285.client.web.********************.js 925 B 0 B
dotcom-rendering/dist/1309.client.web.********************.js 642 B 0 B
dotcom-rendering/dist/1378.client.web.********************.js 508 B 0 B
dotcom-rendering/dist/1623.client.web.********************.js 851 B 0 B
dotcom-rendering/dist/2027.client.web.********************.js 3.08 kB 0 B
dotcom-rendering/dist/2030.client.web.********************.js 496 B 0 B
dotcom-rendering/dist/2118.client.web.********************.js 779 B 0 B
dotcom-rendering/dist/2138.client.web.********************.js 2.6 kB 0 B
dotcom-rendering/dist/2416.client.web.********************.js 780 B 0 B
dotcom-rendering/dist/2710.client.web.********************.js 1 kB 0 B
dotcom-rendering/dist/2903.client.web.********************.js 888 B 0 B
dotcom-rendering/dist/2993.client.web.********************.js 641 B 0 B
dotcom-rendering/dist/3032.client.web.********************.js 3.27 kB 0 B
dotcom-rendering/dist/307.client.web.********************.js 13.2 kB 0 B
dotcom-rendering/dist/3743.client.web.********************.js 905 B 0 B
dotcom-rendering/dist/3849.client.web.********************.js 3.33 kB 0 B
dotcom-rendering/dist/3958.client.web.********************.js 39.9 kB 0 B
dotcom-rendering/dist/3999.client.web.********************.js 748 B 0 B
dotcom-rendering/dist/408.client.web.********************.js 3.38 kB 0 B
dotcom-rendering/dist/4215.client.web.********************.js 409 B 0 B
dotcom-rendering/dist/4298.client.web.********************.js 8.31 kB 0 B
dotcom-rendering/dist/4355.client.web.********************.js 715 B 0 B
dotcom-rendering/dist/4464.client.web.********************.js 3.79 kB 0 B
dotcom-rendering/dist/4567.client.web.********************.js 822 B 0 B
dotcom-rendering/dist/4578.client.web.********************.js 3.51 kB 0 B
dotcom-rendering/dist/4698.client.web.********************.js 2.47 kB 0 B
dotcom-rendering/dist/4946.client.web.********************.js 722 B 0 B
dotcom-rendering/dist/4950.client.web.********************.js 671 B 0 B
dotcom-rendering/dist/512.client.web.********************.js 823 B 0 B
dotcom-rendering/dist/5165.client.web.********************.js 749 B 0 B
dotcom-rendering/dist/5242.client.web.********************.js 529 B 0 B
dotcom-rendering/dist/533.client.web.********************.js 920 B 0 B
dotcom-rendering/dist/5481.client.web.********************.js 5.21 kB 0 B
dotcom-rendering/dist/5551.client.web.********************.js 2.36 kB 0 B
dotcom-rendering/dist/5840.client.web.********************.js 920 B 0 B
dotcom-rendering/dist/5927.client.web.********************.js 823 B 0 B
dotcom-rendering/dist/5996.client.web.********************.js 801 B 0 B
dotcom-rendering/dist/6388.client.web.********************.js 5.76 kB 0 B
dotcom-rendering/dist/651.client.web.********************.js 852 B 0 B
dotcom-rendering/dist/6541.client.web.********************.js 914 B 0 B
dotcom-rendering/dist/6643.client.web.********************.js 954 B 0 B
dotcom-rendering/dist/6756.client.web.********************.js 525 B 0 B
dotcom-rendering/dist/6763.client.web.********************.js 594 B 0 B
dotcom-rendering/dist/6784.client.web.********************.js 748 B 0 B
dotcom-rendering/dist/6802.client.web.********************.js 994 B 0 B
dotcom-rendering/dist/7002.client.web.********************.js 875 B 0 B
dotcom-rendering/dist/7179.client.web.********************.js 2.51 kB 0 B
dotcom-rendering/dist/7444.client.web.********************.js 786 B 0 B
dotcom-rendering/dist/7496.client.web.********************.js 6.4 kB 0 B
dotcom-rendering/dist/7666.client.web.********************.js 2.75 kB 0 B
dotcom-rendering/dist/7726.client.web.********************.js 960 B 0 B
dotcom-rendering/dist/7860.client.web.********************.js 679 B 0 B
dotcom-rendering/dist/7880.client.web.********************.js 10 kB -2 B (0%)
dotcom-rendering/dist/8003.client.web.********************.js 2.85 kB 0 B
dotcom-rendering/dist/8060.client.web.********************.js 582 B 0 B
dotcom-rendering/dist/8288.client.web.********************.js 23 kB 0 B
dotcom-rendering/dist/8320.client.web.********************.js 800 B 0 B
dotcom-rendering/dist/8388.client.web.********************.js 617 B 0 B
dotcom-rendering/dist/8396.client.web.********************.js 5.41 kB 0 B
dotcom-rendering/dist/8442.client.web.********************.js 3.8 kB 0 B
dotcom-rendering/dist/8562.client.web.********************.js 1 kB 0 B
dotcom-rendering/dist/8995.client.web.********************.js 787 B 0 B
dotcom-rendering/dist/9033.client.web.********************.js 887 B 0 B
dotcom-rendering/dist/9045.client.web.********************.js 720 B 0 B
dotcom-rendering/dist/9106.client.web.********************.js 2.95 kB 0 B
dotcom-rendering/dist/9145.client.web.********************.js 4.24 kB 0 B
dotcom-rendering/dist/9206.client.web.********************.js 4.71 kB 0 B
dotcom-rendering/dist/922.client.web.********************.js 2.95 kB 0 B
dotcom-rendering/dist/9458.client.web.********************.js 5.09 kB 0 B
dotcom-rendering/dist/9479.client.web.********************.js 2.92 kB 0 B
dotcom-rendering/dist/9591.client.web.********************.js 1.84 kB 0 B
dotcom-rendering/dist/9721.client.web.********************.js 651 B 0 B
dotcom-rendering/dist/9856.client.web.********************.js 5.75 kB 0 B
dotcom-rendering/dist/9893.client.web.********************.js 3.27 kB 0 B
dotcom-rendering/dist/9895.client.web.********************.js 5.14 kB +2 B (0%)
dotcom-rendering/dist/991.client.web.********************.js 3.16 kB 0 B
dotcom-rendering/dist/AdPortals-importable.client.web.********************.js 3.65 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.client.web.********************.js 421 B 0 B
dotcom-rendering/dist/AppEmailSignUp-importable.client.web.********************.js 8.16 kB 0 B
dotcom-rendering/dist/AppsEpic-importable.client.web.********************.js 4.09 kB 0 B
dotcom-rendering/dist/AppsFooter-importable.client.web.********************.js 3.58 kB 0 B
dotcom-rendering/dist/AppsLightboxImage-importable.client.web.********************.js 2.96 kB 0 B
dotcom-rendering/dist/AppsLightboxImageStore-importable.client.web.********************.js 2.42 kB 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.client.web.********************.js 3.58 kB 0 B
dotcom-rendering/dist/Branding-importable.client.web.********************.js 2.52 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.client.web.********************.js 36.9 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.client.web.********************.js 5.26 kB 0 B
dotcom-rendering/dist/CalloutBlockComponent-importable.client.web.********************.js 6.76 kB 0 B
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.client.web.********************.js 5.77 kB 0 B
dotcom-rendering/dist/CardCommentCount-importable.client.web.********************.js 4.4 kB 0 B
dotcom-rendering/dist/Carousel-importable.client.web.********************.js 7.79 kB 0 B
dotcom-rendering/dist/CarouselForNewsletters-importable.client.web.********************.js 5.65 kB 0 B
dotcom-rendering/dist/ChartAtom-importable.client.web.********************.js 541 B 0 B
dotcom-rendering/dist/CommentCount-importable.client.web.********************.js 3.22 kB 0 B
dotcom-rendering/dist/DiscussionContainer-importable.client.web.********************.js 23.4 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.client.web.********************.js 3.75 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.client.web.********************.js 3.57 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.client.web.********************.js 4.11 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.client.web.********************.js 2.01 kB 0 B
dotcom-rendering/dist/FetchOnwardsData-importable.client.web.********************.js 2.52 kB 0 B
dotcom-rendering/dist/FilterKeyEventsToggle-importable.client.web.********************.js 3.33 kB 0 B
dotcom-rendering/dist/FocusStyles-importable.client.web.********************.js 612 B 0 B
dotcom-rendering/dist/FollowWrapper-importable.client.web.********************.js 790 B 0 B
dotcom-rendering/dist/FooterLabel-importable.client.web.********************.js 341 B 0 B
dotcom-rendering/dist/frameworks.client.web.********************.js 20.7 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.client.web.********************.js 3.59 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.client.web.********************.js 10.7 kB 0 B
dotcom-rendering/dist/GetMatchStats-importable.client.web.********************.js 1.6 kB 0 B
dotcom-rendering/dist/GetMatchTabs-importable.client.web.********************.js 2.62 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.client.web.********************.js 14.7 kB 0 B
dotcom-rendering/dist/guardian-braze-components-end-of-article.client.web.********************.js 9.3 kB 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.client.web.********************.js 781 B 0 B
dotcom-rendering/dist/HeaderTopBar-importable.client.web.********************.js 10.9 kB 0 B
dotcom-rendering/dist/index.client.web.********************.js 45.9 kB +53 B (0%)
dotcom-rendering/dist/InstagramBlockComponent-importable.client.web.********************.js 3.66 kB 0 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.client.web.********************.js 6.1 kB 0 B
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.client.web.********************.js 4.64 kB 0 B
dotcom-rendering/dist/InteractiveSupportButton-importable.client.web.********************.js 3.88 kB 0 B
dotcom-rendering/dist/KeyEventsCarousel-importable.client.web.********************.js 4.2 kB 0 B
dotcom-rendering/dist/KnowledgeQuizAtom-importable.client.web.********************.js 3.54 kB 0 B
dotcom-rendering/dist/LatestLinks-importable.client.web.********************.js 1.12 kB 0 B
dotcom-rendering/dist/LightboxHash-importable.client.web.********************.js 433 B 0 B
dotcom-rendering/dist/LightboxJavascript-importable.client.web.********************.js 4.57 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.client.web.********************.js 3.96 kB +8 B (0%)
dotcom-rendering/dist/Liveness-importable.client.web.********************.js 4.91 kB 0 B
dotcom-rendering/dist/ManyNewsletterSignUp-importable.client.web.********************.js 5.03 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.client.web.********************.js 5.63 kB 0 B
dotcom-rendering/dist/Metrics-importable.client.web.********************.js 2.29 kB 0 B
dotcom-rendering/dist/MostViewedFooter-importable.client.web.********************.js 5.2 kB 0 B
dotcom-rendering/dist/MostViewedFooterData-importable.client.web.********************.js 7.9 kB 0 B
dotcom-rendering/dist/MostViewedRightWrapper-importable.client.web.********************.js 3.88 kB -3 B (0%)
dotcom-rendering/dist/OnwardsUpper-importable.client.web.********************.js 4.18 kB 0 B
dotcom-rendering/dist/PersonalityQuizAtom-importable.client.web.********************.js 3.66 kB 0 B
dotcom-rendering/dist/ProfileAtom-importable.client.web.********************.js 543 B 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.client.web.********************.js 802 B 0 B
dotcom-rendering/dist/PulsingDot-importable.client.web.********************.js 749 B 0 B
dotcom-rendering/dist/QandaAtom-importable.client.web.********************.js 539 B 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.client.web.********************.js 470 B 0 B
dotcom-rendering/dist/readerRevenueDevUtils.client.web.********************.js 2.38 kB 0 B
dotcom-rendering/dist/ReaderRevenueLinks-importable.client.web.********************.js 6.12 kB -1 B (0%)
dotcom-rendering/dist/RelativeTime-importable.client.web.********************.js 1.98 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.client.web.********************.js 6.2 kB 0 B
dotcom-rendering/dist/SecureSignupIframe-importable.client.web.********************.js 4.92 kB 0 B
dotcom-rendering/dist/SendAMessage-importable.client.web.********************.js 4.39 kB 0 B
dotcom-rendering/dist/SendTargetingParams-importable.client.web.********************.js 2.11 kB 0 B
dotcom-rendering/dist/sentry.client.web.********************.js 771 B 0 B
dotcom-rendering/dist/SetABTests-importable.client.web.********************.js 3.5 kB 0 B
dotcom-rendering/dist/SetAdTargeting-importable.client.web.********************.js 484 B 0 B
dotcom-rendering/dist/shimport.client.web.********************.js 2.79 kB 0 B
dotcom-rendering/dist/ShowHideContainers-importable.client.web.********************.js 646 B 0 B
dotcom-rendering/dist/ShowMore-importable.client.web.********************.js 5.69 kB 0 B
dotcom-rendering/dist/SignInGateMain.client.web.********************.js 3.89 kB 0 B
dotcom-rendering/dist/SignInGateMainCheckoutComplete.client.web.********************.js 4.99 kB 0 B
dotcom-rendering/dist/SignInGateSelector-importable.client.web.********************.js 5.64 kB 0 B
dotcom-rendering/dist/SlotBodyEnd-importable.client.web.********************.js 6.81 kB +23 B (0%)
dotcom-rendering/dist/SpotifyBlockComponent-importable.client.web.********************.js 5.47 kB 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.client.web.********************.js 5.54 kB +2 B (0%)
dotcom-rendering/dist/SubNav-importable.client.web.********************.js 2.22 kB 0 B
dotcom-rendering/dist/SupportTheG-importable.client.web.********************.js 6.25 kB +1 B (0%)
dotcom-rendering/dist/TableOfContents-importable.client.web.********************.js 3.1 kB 0 B
dotcom-rendering/dist/TimelineAtom-importable.client.web.********************.js 1.24 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.67 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.client.web.********************.js 5.64 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.client.web.********************.js 3.5 kB 0 B
dotcom-rendering/dist/WeatherWrapper-importable.client.web.********************.js 5.42 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.client.web.********************.js 3.87 kB 0 B

compressed-size-action

@tomrf1 tomrf1 added the run_chromatic Runs chromatic when label is applied label Jan 5, 2024
@tomrf1 tomrf1 marked this pull request as ready for review January 5, 2024 11:13
@tomrf1 tomrf1 requested review from a team as code owners January 5, 2024 11:13
Copy link
Member

@tjmw tjmw left a comment

Choose a reason for hiding this comment

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

LGTM!

❤️ the bundle size change in the description.

Copy link
Contributor

@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.

Good to see this codebase being the home for these components!

Left some thoughts, but nothing blocking or that needs to be addressed as part of this port.

url: string;
}): JSX.Element => {
const [iframeHeight, setIframeHeight] = useState(60);
const iframeRef = useRef<HTMLIFrameElement>(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

@arelra made me aware that it’s probably best to useCallback for this, and make sure your useEffect has iframeRef as part of its dependencies array.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice, I think I'll do this in a follow up PR though

const markerTranslate = (goal / end) * 100 - 100;
const markerTransform = `translate3d(${markerTranslate}%, 0, 0)`;

return <div css={goalMarkerStyles(markerTransform)} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker, but as per Emotion best practice, you should use the style prop for dynamic styles.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 health card created

Comment on lines +142 to +143
rootMargin: '-18px',
threshold: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can I ask why we picked a negative root margin, which shrinks the intersection area, rather than increase the threshold?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question - I don't know! I think this is something to play with after this PR

Comment on lines +13 to +24
window.requestAnimationFrame(() => {
setRunningTotal((prevRunningTotal) => {
const newRunningTotal =
prevRunningTotal + Math.floor(total / 100);

if (newRunningTotal > total) {
return total;
}

return newRunningTotal;
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

It’s curious that this does not rely on a clock, but rather on the speed at which the device is able to request animation frames…

@tomrf1 tomrf1 requested a review from a team as a code owner January 10, 2024 08:55
@tomrf1 tomrf1 merged commit 7609fa4 into main Jan 10, 2024
28 checks passed
@tomrf1 tomrf1 deleted the tf-migrate-epic branch January 10, 2024 11:40
@prout-bot
Copy link

Seen on PROD (merged by @tomrf1 8 minutes and 59 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotcom-rendering run_chromatic Runs chromatic when label is applied Seen-on-PROD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants