Share AdTargeting between Islands - #8095
Merged
Merged
Conversation
|
Size Change: +615 B (0%) Total Size: 589 kB
ℹ️ View Unchanged
|
mxdvl
force-pushed
the
mxdvl/refactor-ad-targeting
branch
from
June 29, 2023 15:15
47c86d4 to
e0b5520
Compare
mxdvl
force-pushed
the
mxdvl/video-atom-in-card
branch
2 times, most recently
from
June 29, 2023 16:23
26309b2 to
cf02622
Compare
mxdvl
force-pushed
the
mxdvl/refactor-ad-targeting
branch
from
June 29, 2023 16:29
e0b5520 to
5769830
Compare
mxdvl
commented
Jun 30, 2023
| format, | ||
|
|
||
| element, | ||
| adTargeting: undefined, |
Contributor
Author
There was a problem hiding this comment.
Not entirely sure why this was undefined… we may need to review if this change has an impact after merging.
mxdvl
force-pushed
the
mxdvl/refactor-ad-targeting
branch
from
June 30, 2023 12:26
5769830 to
f2538d7
Compare
mxdvl
added a commit
to guardian/csnx
that referenced
this pull request
Jun 30, 2023
## What are you changing? - The `YoutubeAtomPlayer` can only be initialised once, and we require the ad targeting to be present before initialisation. ## Why? - Ad targetting is set asyncronously client-side in guardian/dotcom-rendering#8095, so we need to handle the value being `undefined` for the first render. - The current interface wasn’t srict enough so thanks @arelra for spotting this as the compiler would not have complained!
this removes an `any` and creates an explicit relationship between parsing and consumption
This ensures alignment for all code that checks for server or client. No longer checks against `document`, only `window`
this enables asynchronous ad targeting
This simplifies the logic of handling ad targetting across all Islands by setting it once via SWR.
mxdvl
force-pushed
the
mxdvl/refactor-ad-targeting
branch
from
June 30, 2023 14:53
f2538d7 to
d36891e
Compare
arelra
approved these changes
Jun 30, 2023
arelra
left a comment
Member
There was a problem hiding this comment.
lgtm!
Just to point out that atoms-rendering is bumped here to bring in: guardian/csnx#675
arelra
added a commit
to guardian/csnx
that referenced
this pull request
Jul 10, 2023
## What are you changing? Pass valid ad targeting to `YoutubeAtom` stories so the player is able to load. ## Background Since guardian/dotcom-rendering#8095 ad targeting will be set async on the client so it could be undefined initially and then defined in subsequent render passes. However the player requires ad targeting before it initialises and makes the request to YouTube so we block the player until ad targeting is defined as implemented in #675.
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?
This simplifies the logic of handling ad targetting across all Islands by setting it once via SWR like we did for AB Tests in #4200.
An optional override for media duration (
videoLength) is provided.Why?
Required to avoid having to drill the property deeply into Front Cards in #8075
Screenshots