Git Product home page Git Product logo

ad.js's People

Contributors

alcocerd avatar craigt672 avatar crymall avatar kellyjovan avatar lukap2211 avatar matthewcmoya avatar regan-karlewicz avatar skylerrogers avatar stephenbaldwin avatar vince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ad.js's Issues

Template literals omit conditional logic

The whitespace removal plugin for rollup removes conditional logic and replaces with the post operator value.

function proof(someValue?: string) {
  return `Some text ${ someValue || '' }`
}

post build becomes

function proof(someValue?: string) {
  return `Some text  `
}

DFP // updateCorrelator has been deprecated

Version: 2.0.0-beta.31

When running updateCorrelator in the DFP network plugin the following warning is produced:

updateCorrelator has been deprecated. Please see the Google Ad Manager help page on "Pageviews in GPT" for more information: https://support.google.com/admanager/answer/183281?hl=en

According to Google's Ad Manager community experts, the updateCorrelator function no longer works

I'm not sure what impacts this has on Ad.JS, but I do know this method is used inside resetCorrelator when calling setAsActive on the Page. It may be affecting infinite scroll articles.

Race condition

There is a race condition causing this code (in DFP.ts) to run even when the slot does end up having a contentUrl:

 if (!slot.getContentUrl()) {
            this.ad.isEmpty = true;

            dispatchEvent(
              Number(this.id.substring(this.id.length, this.id.length - 1)),
              LOG_LEVELS.WARN,
              'DFP Network',
              'Ad sizes missing. Bypassing ad.',
            );
            resolve();
}

This causes ad lifecycle events intended for after the ad renders to think that the ad is empty when it is not.

Original style values used for restoration onDestroy are overridden onCreate

Writing some tests to familiarize with ad.js (+ bonus increase coverage) and came across:

    this.originalStyle = container.style;

    container.style.position = 'sticky';
    container.style.top = `${stickyOffset}px`;

https://github.com/Econify/ad.js/blob/master/src/plugins/Sticky.ts#L34

Understanding is original style is a reference to container.style so the next line that sets the value of container.style overwrites the original value to be preserved in this.originalStyle (used for restoration in .onDestroy -> .cleanUp). As is this means position and top if set are never restored to their original values onDestroy -> cleanUp.

Fix and test coverage here: https://github.com/Econify/ad.js/tree/bugfix/restore-original-container-style-on-destroy

VERSION PINNING

We are currently not pinning our versions in npm.

Since we run npm install on every build, it is possible that code we have never ran is being published.

Even though we gate our publishing with test suites, this is still a must fix.

Migrate to "Buckets" & make ADJS immutable

Wanted to track this based on our conversation today @stephenbaldwin - please let me know if I missed anything.

In addition to making the library immutable, "Buckets" (or whatever name we choose) would:

  • group ads; thus handle/track correlation IDs
  • handle all ADJS configuration & remove the need to "re-configure" (i.e. the ADJS module would serve as a top level namespace only)
  • make the library more scalable (e.g. not lock ADJS into a single network per page render; you could technically have 3 ads on a page from 3 different ad providers if a client had that requirement)

adjs.dev doc site fails to load when an ad blocker is used

Description

Currently the adjs docs website is client-side rendered. Pieces of the page are loaded via XHR/Ajax.
The website fails to load when a user has an ad blocker on. Our current hypothesis is this occurs because the ad blocker see’s β€œad” in the URL and blocks the requests assuming it’s ad tracking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.