-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Using Prebid.js as npm dependency #3435
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request introduces 1 alert when merging f5b8f32 into c07e60d - view on LGTM.com new alerts:
Comment posted by LGTM.com |
snapwich
force-pushed
the
prebid-as-library
branch
from
January 10, 2019 21:47
fed5682
to
8923933
Compare
mkendall07
requested review from
mike-chowla and
jsnellbaker
and removed request for
mike-chowla
January 14, 2019 14:42
snapwich
force-pushed
the
prebid-as-library
branch
from
January 15, 2019 17:20
f00a013
to
fcbdfaf
Compare
jsnellbaker
approved these changes
Jan 15, 2019
jsnellbaker
added
needs 2nd review
Core module updates require two approvals from the core team
and removed
needs review
labels
Jan 15, 2019
mkendall07
approved these changes
Jan 15, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Major props @snapwich !
This was referenced Jan 16, 2019
amuraco
pushed a commit
to amuraco/Prebid.js
that referenced
this pull request
Jan 28, 2019
* added babel plugin to replace webpack StringReplacementPlugin * remove ignore-loader in favor of filtering non .js files as modules * make all imports relative for projects not using our resolver * refactor adaptermanager to adapterManager * convert adapterManager to be compatible with latest version of babel * refactored utils with es6 exports * fixing tests * fixing stubs and tests * babelrc updated to be used externally from parent project * remove $prebid.version$ from gulp and add to babel plugin * fix tests to use actual prebid.version rather than string literal * refactor all modules to use relative imports w/o webpack resolver * fix test in old safari * update package-lock.json * remove unnecessary json-loader * update babel plugin to use same @babel/core * add instructions for using prebid as npm depenedency added to readme * remove unused variable in global babel plugin * fixed missing internal.createTrackPixelIframeHtml * fix relative pathing for new modules
10 tasks
ghost
pushed a commit
to devunrulymedia/Prebid.js
that referenced
this pull request
Jan 30, 2019
* added babel plugin to replace webpack StringReplacementPlugin * remove ignore-loader in favor of filtering non .js files as modules * make all imports relative for projects not using our resolver * refactor adaptermanager to adapterManager * convert adapterManager to be compatible with latest version of babel * refactored utils with es6 exports * fixing tests * fixing stubs and tests * babelrc updated to be used externally from parent project * remove $prebid.version$ from gulp and add to babel plugin * fix tests to use actual prebid.version rather than string literal * refactor all modules to use relative imports w/o webpack resolver * fix test in old safari * update package-lock.json * remove unnecessary json-loader * update babel plugin to use same @babel/core * add instructions for using prebid as npm depenedency added to readme * remove unused variable in global babel plugin * fixed missing internal.createTrackPixelIframeHtml * fix relative pathing for new modules
pedrolopezmrf
pushed a commit
to Marfeel/Prebid.js
that referenced
this pull request
Mar 18, 2019
* added babel plugin to replace webpack StringReplacementPlugin * remove ignore-loader in favor of filtering non .js files as modules * make all imports relative for projects not using our resolver * refactor adaptermanager to adapterManager * convert adapterManager to be compatible with latest version of babel * refactored utils with es6 exports * fixing tests * fixing stubs and tests * babelrc updated to be used externally from parent project * remove $prebid.version$ from gulp and add to babel plugin * fix tests to use actual prebid.version rather than string literal * refactor all modules to use relative imports w/o webpack resolver * fix test in old safari * update package-lock.json * remove unnecessary json-loader * update babel plugin to use same @babel/core * add instructions for using prebid as npm depenedency added to readme * remove unused variable in global babel plugin * fixed missing internal.createTrackPixelIframeHtml * fix relative pathing for new modules
2 tasks
AlessandroDG
added a commit
to simplaex/Prebid.js
that referenced
this pull request
Mar 28, 2019
AlessandroDG
added a commit
to simplaex/Prebid.js
that referenced
this pull request
Mar 28, 2019
AlessandroDG
pushed a commit
to simplaex/Prebid.js
that referenced
this pull request
Mar 28, 2019
## Type of change - [x] Refactoring (no functional changes, no api changes) ## Description of change Refactor rivrAnalyticsAdapter.js events handling. ## History * RVR-2087 - update adapterManager dependency * RVR-2369 - Update package-lock.json * RVR-2369 - Revert changes in main Analytics adapter It will be handled in a separate PR * RVR-2369 - Use relative import paths Needed for prebid#3435
jsnellbaker
pushed a commit
that referenced
this pull request
Apr 1, 2019
* Rvr 2369 Refactor events handling (#9) * RVR-2177 - Refactor events handling * RVR-2087 - Inject pbjsGlobalVariable into rivraddon * RVR-2087 - update adapterManager dependency * RVR-2087 - Add ADD_AD_UNITS to Prebid.JS trackable events * RVR-2369 - Update package-lock.json * Rvr 2369 prevent duplicate events (#10) ## Type of change - [x] Refactoring (no functional changes, no api changes) ## Description of change Refactor rivrAnalyticsAdapter.js events handling. ## History * RVR-2087 - update adapterManager dependency * RVR-2369 - Update package-lock.json * RVR-2369 - Revert changes in main Analytics adapter It will be handled in a separate PR * RVR-2369 - Use relative import paths Needed for #3435
pycnvr
pushed a commit
to conversant/Prebid.js
that referenced
this pull request
Apr 4, 2019
* Rvr 2369 Refactor events handling (#9) * RVR-2177 - Refactor events handling * RVR-2087 - Inject pbjsGlobalVariable into rivraddon * RVR-2087 - update adapterManager dependency * RVR-2087 - Add ADD_AD_UNITS to Prebid.JS trackable events * RVR-2369 - Update package-lock.json * Rvr 2369 prevent duplicate events (#10) ## Type of change - [x] Refactoring (no functional changes, no api changes) ## Description of change Refactor rivrAnalyticsAdapter.js events handling. ## History * RVR-2087 - update adapterManager dependency * RVR-2369 - Update package-lock.json * RVR-2369 - Revert changes in main Analytics adapter It will be handled in a separate PR * RVR-2369 - Use relative import paths Needed for prebid#3435
Merged
jacekburys-quantcast
pushed a commit
to jacekburys-quantcast/Prebid.js
that referenced
this pull request
May 15, 2019
* added babel plugin to replace webpack StringReplacementPlugin * remove ignore-loader in favor of filtering non .js files as modules * make all imports relative for projects not using our resolver * refactor adaptermanager to adapterManager * convert adapterManager to be compatible with latest version of babel * refactored utils with es6 exports * fixing tests * fixing stubs and tests * babelrc updated to be used externally from parent project * remove $prebid.version$ from gulp and add to babel plugin * fix tests to use actual prebid.version rather than string literal * refactor all modules to use relative imports w/o webpack resolver * fix test in old safari * update package-lock.json * remove unnecessary json-loader * update babel plugin to use same @babel/core * add instructions for using prebid as npm depenedency added to readme * remove unused variable in global babel plugin * fixed missing internal.createTrackPixelIframeHtml * fix relative pathing for new modules
jacekburys-quantcast
pushed a commit
to jacekburys-quantcast/Prebid.js
that referenced
this pull request
May 15, 2019
* Rvr 2369 Refactor events handling (prebid#9) * RVR-2177 - Refactor events handling * RVR-2087 - Inject pbjsGlobalVariable into rivraddon * RVR-2087 - update adapterManager dependency * RVR-2087 - Add ADD_AD_UNITS to Prebid.JS trackable events * RVR-2369 - Update package-lock.json * Rvr 2369 prevent duplicate events (prebid#10) ## Type of change - [x] Refactoring (no functional changes, no api changes) ## Description of change Refactor rivrAnalyticsAdapter.js events handling. ## History * RVR-2087 - update adapterManager dependency * RVR-2369 - Update package-lock.json * RVR-2369 - Revert changes in main Analytics adapter It will be handled in a separate PR * RVR-2369 - Use relative import paths Needed for prebid#3435
10 tasks
This was referenced Jun 13, 2019
Merged
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Description of change
This updates the code base to be useable directly from npm as a library within another application. The README is updated with instructions for using Prebid.js with both Babel 6 and 7. After implementing the proper
babel-loader
within the external application, Prebid.js can be used like soThis updates the local Prebid.js build to the latest version of Babel. This required refactoring to ES6 modules for many of the files (no mix-matched commonjs and es6 imports/exports).
It also replaces the
string-replace-webpack-plugin
with a Babel Plugin for doing all the global search and replacing for things such as the$$PREBID_GLOBAL$$
.Other information
ES6 modules affect some of the capabilities of sinon stubbing. To allow stubbing for some features, in utils for example, an
internals
export was added to allow stubbing features (similar to how commonjsexports
object was being used). I investigated using something likebabel-plugin-rewire
to do stubbing, however it's incompatible with ourinstanbul
setup and fixing it to work correctly would be an even larger refactor; however, it might be worth investigating in the future.Going forward, any build features that we would added with Gulp or Webpack should probably be implemented as Babel Plugins to maintain compatibility for applications using Prebid.js directly from npm. It might be worthwhile creating another repo that pulls in Prebid.js as an npm dependency and tests functionality to avoid breaking integrations.
All file imports within
src
andmodules
files were updated to use relative pathing. This is required since any application pulling in Prebid.js will most likely not have the same webpack resolver to properly locate resources. Any new pull-requests adding features should use relative paths for any files withinsrc
ormodules
. It's still fine to use the webpack resolver for imports withintest
.I updated the README to mention that using this feature requires Prebid.js 1.38.0+, so it'd be nice to add this in the next release so that is accurate.
Closes #1853