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

Add VAST 4.0 support #52

Merged
merged 24 commits into from
Apr 13, 2018
Merged

Add VAST 4.0 support #52

merged 24 commits into from
Apr 13, 2018

Conversation

chbonello
Copy link
Contributor

CircleCi will fail until the model has been updated.

@chbonello chbonello requested a review from timdp February 8, 2018 18:28
Copy link
Member

@timdp timdp left a comment

Choose a reason for hiding this comment

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

No major changes, I think.

Great that we're adding so many tests as well. Coverage seems good if I run it locally. Is there any major feature we're not covering yet?

To be consistent with iab-vast-model, let's also look into bumping the dependency versions and the minimum version of Node.

Additionally, the LICENSE year is probably outdated here too.

@@ -5,11 +5,17 @@ export default ($ad, options) => {
const wrapper = new Wrapper()
const $wrapper = $ad.wrapper
inheritAd($ad, $wrapper, wrapper, options)
if ($wrapper.followAdditionalWrappers != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Why are we changing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

followAdditionalWrappers has a default value of true, and allowMultipleAds has a default value of false in the VAST 4.0 spec. So we cannot simply do the assignment.

@@ -1,8 +1,9 @@
import {Extension} from 'iab-vast-model'

export default ($extension) => {
// console.log($extension)
Copy link
Member

Choose a reason for hiding this comment

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

Please remove.

if ($creative.linear) {
return createLinear($creative, options)
creative.linear = createLinear($creative, options)
Copy link
Member

Choose a reason for hiding this comment

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

Might still change depending on iab-vast-model PR.

I also seem to remember that one of the reasons why we had to change this was because it's not an else if, since they can coexist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, a or a . And an optional .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's try again...

Yes, it either a Linear or a NonLinearAds. And an optional CompanionAds.

@@ -0,0 +1,9 @@
export default (universalAdId, $universalAdId) => {
if ($universalAdId.idRegistry) {
Copy link
Member

Choose a reason for hiding this comment

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

We seem to be mixing if (object) and if (object != null). It's not a huge issue so I don't want it to block this PR, but let's try to make sure that everything inside if (...) evaluates to a boolean in the future.

const viewableImpression = new ViewableImpression()
viewableImpression.id = $viewableImpression.id
if ($viewableImpression.viewable != null) {
viewableImpression.viewables.push(...$viewableImpression.viewable.map(i => i._value))
Copy link
Member

Choose a reason for hiding this comment

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

I don't like i as a variable name if it's not a counter.

@@ -2,7 +2,7 @@ import TYPES from './types'
import parseTime from '../util/parse-time'

export default {
[TYPES.bool]: (str) => (str === 'true'),
[TYPES.bool]: (str) => (str === 'true' || str === '1'),
Copy link
Member

Choose a reason for hiding this comment

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

Did VAST 4 add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is from the IAB XML test-files. They sometimes use "1" rather than "true".

@coveralls
Copy link

coveralls commented Apr 13, 2018

Coverage Status

Coverage increased (+3.3%) to 95.093% when pulling ec83186 on feat/vast-4-support into e2aa8f1 on master.

@timdp timdp merged commit a80ea33 into master Apr 13, 2018
@timdp timdp deleted the feat/vast-4-support branch April 13, 2018 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants