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

Refactor of Prebid #349

Merged
merged 58 commits into from
May 18, 2016
Merged

Refactor of Prebid #349

merged 58 commits into from
May 18, 2016

Conversation

protonate
Copy link
Collaborator

@protonate protonate commented May 12, 2016

The core JS of Prebid is refactored to implement functional programming patterns in the bid/request cycle and in handling of DFP slot targeting. This paves the way for handling concurrent bid requests, improving analytics tools, increasing test coverage, reducing LOC and so on.

An effort was made to reduce the data structures to as few as possible and then use map, reduce and other ES5 language capabilities to derive data. Therefore this PR means IE8 is no longer supported (it hasn't been "officially" supported forever, but this will break it). It is possible to use es5-shim if we decide it's needed. ES6 is supported already through use of the Babel transpiler, and some of these language features are used here as well.

The data structures are documented fairly well in the fixtures module, and consist of adUnits, bidsRequested, bidsReceived and DFP slot targeting as defined by the GPT targeting spec. A set of these data structures will comprise an auction, and the auctions will be managed in a queue, thus giving us a stream of auction instances with a unique set of data structures. Auctions can then be run in sequence without clobbering each other (concurrent bids) and reported on in batches with analytics libraries. This is part of a pending PR and the scope of this refactor PR is limited to functionality equivalence with current master branch.

Deprecations

  • pbjs.requestBidsForAdUnit @deprecated - removed, use pbjs.requestBids
  • pbjs.requestBidsForAdUnits @deprecated - removed, use pbjs.requestBids
  • pbjs.setTargetingForAdUnitsGPTAsync @deprecated - removed, use pbjs.setTargetingForGPTAsync

@protonate protonate mentioned this pull request May 12, 2016
@Studnicky
Copy link
Member

I see a few changes to adapter code in here - appears that bidmanager was changed significantly? Will adapters need to update and pull request for this?

mkendall07 and others added 5 commits May 16, 2016 12:05
* remove small helper functions for readability
* remove bidmanager.setBidderMap (not used)
* remove createEmptyBidResponseObj (just return object literal)
* remove pb_preBidders as unused
* refactor pbjs.requestBids and adaptermanager.callBids
* refactor bid count, rearrange getPriceBucketStrings
* refactor of targeting to set and clear before and after ad server call
@mkendall07
Copy link
Member

@Studnicky
There should be no major changes needed to adapters. The minor changes will be handled in this PR as needed so that this is transparent to all the bidders.

protonate and others added 6 commits May 17, 2016 15:03
… of querystring params

more fixtures and tests
…o fp_refactor

* 'fp_refactor' of https://github.com/prebid/Prebid.js:
  Restore getBidResponsesForAdUnitCode()
- Don't export getPriceBucketString
- Test 'dense' price bucket mode integration
# Conflicts:
#	test/fixtures/fixtures.js
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.

4 participants