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

Fully deprecate the adloader.loadScript function #2780

Closed
jsnellbaker opened this issue Jun 27, 2018 · 2 comments
Closed

Fully deprecate the adloader.loadScript function #2780

jsnellbaker opened this issue Jun 27, 2018 · 2 comments
Labels
Adapter API Change Bidder Adapter API Change good first issue pinned won't be closed by stalebot Pub API Change Publisher Facing API change

Comments

@jsnellbaker
Copy link
Collaborator

Type of issue

Feature

Description

As a follow-up to #2423, there are other areas in the Prebid.js core that still rely on the adloader.js's deprecated loadScript function. We should aim to update/refactor those areas in order to fully remove the loadScript function.

There is an alternate function currently implemented in the adloader.js file that's meant to replace the loadScript function; loadExternalScript. Note - the loadExternalScript function is meant to be used in limited cases and only when approved by Prebid team.

Below is a list of the currently known areas that still use the loadScript function:

  • cookie.js > the cookieSet function uses the loadScript function to call the specified file that's supplied in the s2sConfig.cookieSetUrl object. Only the prebidServerBidAdapter appears to use the cookieSet function, so the impact is limited. From an initial analysis, we should be able to easily transfer to the loadExternalScript function here.
  • Renderer.js > the main Renderer function uses loadScript to load the Renderer.url as well as handle the potential Renderer.callback field. This scenario will require additional changes to support; as the loadExternalScript function does not currently handle callbacks like the original loadScript did.
  • prebid.js > the public $$PREBID_GLOBAL$$.loadScript function. This code as well as any corresponding unit tests just needs to be removed .
  • adaptermanager.js > clean-up unit tests; specifically there are a number of stubs for the loadScript function in the beforeEach/afterEach blocks. The corresponding main file doesn't appear to use the loadScript function, so likely these are just remnants of previous code iterations that were forgotten.
@stale
Copy link

stale bot commented Jul 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 11, 2018
@stale stale bot closed this as completed Jul 18, 2018
@jsnellbaker jsnellbaker reopened this Jul 18, 2018
@stale stale bot removed the stale label Jul 18, 2018
@jsnellbaker jsnellbaker added the pinned won't be closed by stalebot label Jul 18, 2018
@jaiminpanchal27
Copy link
Collaborator

Already completed

  • cookieset is no longer part of Prebid project
  • unit tests use adloaderstub https://github.com/prebid/Prebid.js/blob/master/test/mocks/adloaderStub.js

Todo

  • Removing $$PREBID_GLOBAL$$.loadScript will be a breaking change. Lets make it part of 3.0 I2I 3.0 list of planned changes #3556
  • Comments mentioned in description for Renderer.js needs to be done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adapter API Change Bidder Adapter API Change good first issue pinned won't be closed by stalebot Pub API Change Publisher Facing API change
Projects
None yet
Development

No branches or pull requests

3 participants