From 083b8638e89a397d0557fb6cfb845a4360776029 Mon Sep 17 00:00:00 2001 From: Nicolas Ferro Date: Thu, 22 Feb 2018 19:17:26 -0300 Subject: [PATCH 1/6] issue #1022 - quiet logs on production mode --- webpack.config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 193ebe65e..3a9ffcde5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -214,12 +214,14 @@ if (process.env.NODE_ENV === 'production') { toplevel: false, typeofs: false, unused: false, - // Switch off all types of compression except those needed to convince // react-devtools that we're using a production build conditionals: true, dead_code: true, evaluate: true, + // Remove warnings + discard any console.* functions + warnings: false, + drop_console: true }, mangle: true, }, @@ -353,7 +355,7 @@ module.exports = [ if (targets.length === 0) { throw new Error( `target plugin ${ - plugin.name + plugin.name } has no targets in it's target folder ${folder}` ); } From 855e972bec4b3a9f89c65ae8d1cbbd4a569e8e3c Mon Sep 17 00:00:00 2001 From: Nicolas Ferro Date: Thu, 22 Feb 2018 19:34:33 -0300 Subject: [PATCH 2/6] fix pre-commit errors --- webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 3a9ffcde5..428bbf117 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -221,7 +221,7 @@ if (process.env.NODE_ENV === 'production') { evaluate: true, // Remove warnings + discard any console.* functions warnings: false, - drop_console: true + drop_console: true, }, mangle: true, }, @@ -355,7 +355,7 @@ module.exports = [ if (targets.length === 0) { throw new Error( `target plugin ${ - plugin.name + plugin.name } has no targets in it's target folder ${folder}` ); } From e33ccb57b6cb5b81dd7c84b03959378222a26bf6 Mon Sep 17 00:00:00 2001 From: Nicolas Ferro Date: Thu, 22 Feb 2018 21:00:55 -0300 Subject: [PATCH 3/6] invoke console warning through window to prevent from being discarded on prod --- client/coral-embed/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-embed/src/index.js b/client/coral-embed/src/index.js index 43bd3202e..2f456c4e2 100644 --- a/client/coral-embed/src/index.js +++ b/client/coral-embed/src/index.js @@ -16,7 +16,7 @@ function parseAssetURL() { // Try to get the url from the canonical tag on the page. return document.querySelector('link[rel="canonical"]').href; } catch (e) { - console.warn( + window.console.warn( 'This page does not include a canonical link tag. Talk has inferred this asset_url from the window object. Query params have been stripped, which may cause a single thread to be present across multiple pages.' ); From 898e28fe1be91a2fec8614525888ca39a5bc891f Mon Sep 17 00:00:00 2001 From: Mendel Konikov Date: Fri, 23 Feb 2018 08:27:21 -0500 Subject: [PATCH 4/6] Typos in comments --- plugins/talk-plugin-facebook-auth/server/router.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/talk-plugin-facebook-auth/server/router.js b/plugins/talk-plugin-facebook-auth/server/router.js index 53b6c7e56..b5232c5e9 100644 --- a/plugins/talk-plugin-facebook-auth/server/router.js +++ b/plugins/talk-plugin-facebook-auth/server/router.js @@ -2,7 +2,7 @@ module.exports = router => { const { passport, HandleAuthPopupCallback } = require('services/passport'); /** - * Facebook auth endpoint, this will redirect the user immediatly to facebook + * Facebook auth endpoint, this will redirect the user immediately to facebook * for authorization. */ router.get( @@ -16,7 +16,7 @@ module.exports = router => { /** * Facebook callback endpoint, this will send the user a html page designed to - * send back the user credentials upon sucesfull login. + * send back the user credentials upon sucessful login. */ router.get('/api/v1/auth/facebook/callback', (req, res, next) => { // Perform the facebook login flow and pass the data back through the opener. From 820087f49c5481a8c281a1ab91e3cfb6f2927f69 Mon Sep 17 00:00:00 2001 From: Mendel Konikov Date: Fri, 23 Feb 2018 11:12:34 -0500 Subject: [PATCH 5/6] Fix typos --- plugins/talk-plugin-google-auth/server/router.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/talk-plugin-google-auth/server/router.js b/plugins/talk-plugin-google-auth/server/router.js index 89977f35b..4253919ff 100644 --- a/plugins/talk-plugin-google-auth/server/router.js +++ b/plugins/talk-plugin-google-auth/server/router.js @@ -2,7 +2,7 @@ module.exports = router => { const { passport, HandleAuthPopupCallback } = require('services/passport'); /** - * Google auth endpoint, this will redirect the user immediatly to google + * Google auth endpoint, this will redirect the user immediately to Google * for authorization. */ router.get( @@ -16,10 +16,10 @@ module.exports = router => { /** * Google callback endpoint, this will send the user a html page designed to - * send back the user credentials upon sucesfull login. + * send back the user credentials upon successful login. */ router.get('/api/v1/auth/google/callback', (req, res, next) => { - // Perform the google login flow and pass the data back through the opener. + // Perform the Google login flow and pass the data back through the opener. passport.authenticate( 'google', { session: false }, From 69117f2fa52ada749f29cc949f0f06ef140a5619 Mon Sep 17 00:00:00 2001 From: Mendel Konikov Date: Fri, 23 Feb 2018 12:01:56 -0500 Subject: [PATCH 6/6] Fixed one more typo And once we're going all out, capitalized ;) --- plugins/talk-plugin-facebook-auth/server/router.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/talk-plugin-facebook-auth/server/router.js b/plugins/talk-plugin-facebook-auth/server/router.js index b5232c5e9..3e890ec89 100644 --- a/plugins/talk-plugin-facebook-auth/server/router.js +++ b/plugins/talk-plugin-facebook-auth/server/router.js @@ -2,7 +2,7 @@ module.exports = router => { const { passport, HandleAuthPopupCallback } = require('services/passport'); /** - * Facebook auth endpoint, this will redirect the user immediately to facebook + * Facebook auth endpoint, this will redirect the user immediately to Facebook * for authorization. */ router.get( @@ -15,8 +15,8 @@ module.exports = router => { ); /** - * Facebook callback endpoint, this will send the user a html page designed to - * send back the user credentials upon sucessful login. + * Facebook callback endpoint, this will send the user a HTML page designed to + * send back the user credentials upon successful login. */ router.get('/api/v1/auth/facebook/callback', (req, res, next) => { // Perform the facebook login flow and pass the data back through the opener.