-
Notifications
You must be signed in to change notification settings - Fork 0
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
PLTX-2337 (refactor) upgrade to latest CMP from appnexus #4
Conversation
callback | ||
}); | ||
} | ||
// else if ( |
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.
Is there a reason we commented this out instead of erasing it? Usually commenting out chunks is a bit of a code smell
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.
I left it commented out because the upstream CMP has a "todo" to remove this, since i've already removed it i want the comment here so it matches up with the upstream file and context is given
@@ -0,0 +1 @@ | |||
8.11.3 |
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.
🎉
// import CopyWebpackPlugin from 'copy-webpack-plugin'; | ||
import autoprefixer from 'autoprefixer'; | ||
import path from 'path'; | ||
// import UglifyJS from 'uglify-es'; |
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.
Let's erase the commented out imports
package.json
Outdated
"clean": "rm -rf build", | ||
"dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress", | ||
"start": "serve build -s -c 1", | ||
"clean": "rm -rf dist", |
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.
yarn add -D rimraf
and replace this with:
"clean": "rimraf dist",
This allows the command to work cross platform (mac/linux/bsd/windows)
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.
Actually we already have rimraf so you don't even need to add it
@@ -0,0 +1,135 @@ | |||
// __cmp('setConsentUiCallback', callback) QUANTCAST | |||
import 'core-js/fn/array/find-index'; |
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.
Using this library in one of our sites will double up the bundle size for anything we're using babel-polyfill for. I think what we want to do is something like this:
https://stackoverflow.com/questions/33380063/what-is-the-best-way-to-include-babel-polyfill-using-multiple-entry-points
In development
mode in webpack we'd include the polyfill but in production mode we wouldn't include it
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.
Another reference is here:
https://babeljs.io/docs/en/babel-polyfill.html#usage-in-node-browserify-webpack
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.
Im not using babel-polyfill because it added another 130k to the package. But, would be nice to use it, ill make a ticket (see test plan)
@@ -0,0 +1,73 @@ | |||
/* eslint-disable max-nested-callbacks */ |
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.
^ Whenever I see this I know a party's coming soon
'process.env.NODE_ENV': JSON.stringify(ENV) | ||
}), | ||
new webpack.ProvidePlugin({ | ||
Promise: 'promise-polyfill' |
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.
The babel-polyfill tweak should allow you to remove this
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.
(see test plan) i removed babel-polyfill because it bloats the library (by 130k), will make a ticket to figure out how separate out the polyfills or optimize this
@@ -48,11 +48,20 @@ export function init(configUpdates) { | |||
const cmp = new Cmp(store); | |||
|
|||
// Expose `processCommand` as the CMP implementation | |||
window[CMP_GLOBAL_NAME] = cmp.processCommand; | |||
// window[CMP_GLOBAL_NAME] = cmp.processCommand; |
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.
same, leaving this comment in because i want to call this out when doing another upstream merge.
Background
This is work in progress
Replace core-js with babel plugin for IE11 polyfill supportsee useBuiltIns: figure out how to remove polyfills that aren't actually used in the codebase babel/babel-preset-env#84 Adds too much bloat, would like to add packageSize module firstTest Plan