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

Prebid core & PBS adapter: POC - feature tags and optional compilation of native support #7978

Closed
wants to merge 211 commits into from

Conversation

dgirardi
Copy link
Collaborator

@dgirardi dgirardi commented Jan 27, 2022

Type of change

  • Feature
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

Description of change

This adds feature flags that can remove portions of the codebase at build time (see #7867). Consider this a proof of concept, because it depends on (and is diffed against) #7935 (this is why) - I will need to post a new PR when that is merged. Here I am looking for feedback on the general strategy and naming conventions.

The first (and only) flag defined here is "NATIVE", which is the easiest (and smallest) to manage; only core and PBS are included - with the expectation that adapters will over time mark their feature-specific code as is done here.

This is the effect on the bundle size:

demetrio@pbws:~/src/Prebid.js$ gulp build-bundle-prod --modules=prebidServerBidAdapter > /dev/null 2>&1 && ls -l build/dist/prebid.js
-rw-rw-r-- 1 demetrio demetrio 176791 Jan 27 11:21 build/dist/prebid.js
demetrio@pbws:~/src/Prebid.js$ gulp build-bundle-prod --modules=prebidServerBidAdapter --disable=native > /dev/null 2>&1 && ls -l build/dist/prebid.js
-rw-rw-r-- 1 demetrio demetrio 168356 Jan 27 11:21 build/dist/prebid.js

A readable comparison of the output: https://gist.github.com/dgirardi/c506a2aa243125cc2a8bdcfa27e10d7a/revisions

Other information

Testing: the strategy is, for now, to add an additional test run with all features disabled. Once we have more flags defined I intend to revisit this - it will probably be too expensive to run the whole test suite on all feature combinations, but I am optimistic that we can find a good heuristic to identify "relevant" tests and be exhaustive only on those (most tests do not interact with the code being removed).

Compilation: I have decided to use our Babel plugin to resolve feature flags (as opposed to webpack's DefinePlugin or other options like terser arguments). The reason is that it works better for npm consumers: no change is required to keep the build working, and there's no risk of our globals (i.e. FEATURES) clashing with their namespace.

patmmccann and others added 28 commits March 25, 2021 12:04
* add Rise adapter

* fixes

* change param isOrg to org

* Rise adapter

* change email for rise

* fix circle failed

* bump

* bump

* bump

* remove space

* Upgrade Rise adapter to 5.0

* add onBidWon event

* nurl

* add test

* eslint

* fix corcle

* fix circle

* fix

Co-authored-by: Noam Tzuberi <noam.tzuberi@ironsrc.com>
Co-authored-by: Laslo Chechur <laslo.chechur@ironsrc.com>
…rebid#7938)

* rename audigent halo to hadron

* revert package-lock changes

* re-add halo modules for continuity til Prebid 7 deprecation

* revert SSP adapter changes, add halo RTD test

* remove hadron refs from ssp tests

* add contact blurb

* pull hadron from ix bid adapter

* pull hadron from tappx test

* re-add halo id system spec
* feature: Add trustpid user id module

* refactor: Update trustpidSystem module, comments and md file

* refactor: Update trustpidSystem file to handle domain setting regardless of message events

* refactor: Update trustpidSystem module and dependent tests and docs

* refactor: Update trustpid undefined checks and returns

* tests: Update trustpid tests

* docs: Update trustpid docs typo

* refactor: Update trustpid module with storage and logging utils. Adjust tests.

Co-authored-by: Tomasz Januszek <tomasz@teavaro.com>
Changing maintainer of bid adapter
@dgirardi dgirardi force-pushed the feature-tags branch 2 times, most recently from 5c07ced to aa214d8 Compare January 27, 2022 15:48
dgirardi and others added 27 commits March 17, 2022 09:12
* Add dacid user id module

* Fix source domain

* Add document to explain dac ID
* Insticator adapter: add support gpid

* Update insticatorBidAdapter_spec.js

Rerun build

* Switch to use imp.ext.gpid field
* Upgrade webpack to 5; gulp build works

* Fix karma, except events

* Uniform access to events, import * or require (import * from 'events.js' / import events from 'events.js' return different objects, which is a problem for stubbing)

* Fix (?) adapters that use `this` inappropriately

* Update webpack-bundle-analyzer

* Fix warnings

* Enable tree shaking

* Set webpack mode 'none' (or else tests fail (!))

* Update coreJS version in babelrc - prebid#7943

* Use babel to translate to commonjs only for unit tests; enable production mode

* Merge master

* Add fsevents as optional dep
…bid.js 5.0 (prebid#8127)

* add open8 adapter

* slotkey and fix

* add maintainer address

* add bidwon

* check field populated

* Now Open8 adapter produced result object contains Prebid.js v5 mandatory field "meta.advertiserDomains".

* Import only used symbols from "utils.js".

Co-authored-by: 木田 愛一郎 <kidaa@O8MBP3-125.local>
Co-authored-by: Takahashi Kenta <rika-t@castify-inc.com>
…sources fun… (prebid#8117)

* ESP: Added getEncrptedSignalfromSources and registerSignalsources function to send eids to GAM

* Lint issue resolved

* ESP: Changes in code based on review comments

* ESP: Changes in code based on review comments

* ESP: Example HTML added

* ESP: Removed duplicate key from example.html

* ESP: GetUserEids by source name function added and change requested done

* ESP: SignalSources name changed to encryptedSignalSources under usersync object

* ESP: Added encryptedSignalConfig in userSync object having signal sources with customSources

* ESP: ESP example HTML modified

* ESP: removed unwanted arguments/parameters

* Test cases: Module added to test getUserIdsByEidsBySource function

* ESP: Added concat function instead of Object.assign

* Removed enableSingleRequest() calling from the code - testpage

* ESP: Lint issue solved

* ESP: LGTM alert issue fixed(This is always true)

* ESP: updated userid spec file and removed unwanted code

* ESP: Added check if registerDelay timeout is undefined and gtag check

* ESP: ESP configs updated and code clean up based on review comments

* ESP: Converted normal function to arrow functions

* ESP: Test cases position changed

* ESP: Handle undefined and null check
* JDB-496: first commit, copying over files from prebid-js-ftrack-module PR-1.0.0 ftrack user ID submodule code

* Addressing the lgtm alert

* Addressing the remaining lgtm alerts

* Setting VENDOR_ID to null for now

* Pulled ftrack out and used a config.param property instead to load ftrack

* Cleaning up errors raised by linter

* Tweaking a comment

* JDB-496: cleaning up docs based on PR feedback

* PR fixes

Co-authored-by: Jason Lydon <jason.lydon@flashtalking.com>
* added idWardRtdProvider module

* added idward_segments_example.html to test module

* improver description

* added 'Testing' section to readme

* added missing function description

* show sent FPD at the example html page

* review comments resolved

Co-authored-by: Pavlo <pavlo@id-ward.com>
* CAP-2474 Synacor Media Bid Adapter: Use OpenRTB parameters to populate bids' `ttl` values

* CAP-2474 Revised bid expiration/ttl code to conform to revised requirements w/ adserver tag expiration

* CAP-2474 Added tests and cleaned up tag expiration code

* feature/CAP-2516: Remove the filtering of eids for synacormediaBidAdapter

Co-authored-by: Andrew Fuchs <andrew.fuchs@synacor.com>
Co-authored-by: Timothy M. Ace <tace@imds.tv>
Co-authored-by: Tim Ace <tace@synacor.com>
* remove old userSyncs method

* Update mediasquareBidAdapter.js

* Update mediasquareBidAdapter.js

* Update mediasquareBidAdapter_spec.js

* Mediasquare Bid Adapter: add floor module support

* Update mediasquareBidAdapter_spec.js

* Update mediasquareBidAdapter.js
* Changed net revenue to True

* Added miltibid support for GroupM

* Added marketplace array to check for values

* Added marketplace check while requesting too

Co-authored-by: Azhar <azhar@L1119.local>
…essions (prebid#8154)

* Update ad unit validation to allow no bids if ortb2Imp is specified

* Move s2sTesting logic to the s2sTesting module

* Accept adUnit.storedAuctionResponse in lieu of adUnit.bids; update PBS adapter to work with no-bid adUnits

* Do not accept 'storedAuctionResponse' as an alternative to 'ortb2Imp'

* Fix short-circuit in building out imp[].ext

* Make `s2sConfig.bidders` optional
* AdHash Bidder Adapter: minor changes

We're operating on a com TLD now.
Added publisher in URL for easier routing.

* Implemented brand safety

Implemented brand safety checks

* Fix for GDPR consent

Removing the extra information as request data becomes too big and is sometimes truncated

* Ad fraud prevention formula changed

Ad fraud prevention formula changed to support negative values as well as linear distribution of article length
@dgirardi
Copy link
Collaborator Author

Closing in favor of #8219

@dgirardi dgirardi closed this Mar 25, 2022
@lgtm-com
Copy link

lgtm-com bot commented Mar 25, 2022

This pull request introduces 1 alert when merging 1c4dc4e into 19c6286 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.