Nuria has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390551 )

Change subject: Remove download of font from google endpoint
......................................................................

Remove download of font from google endpoint

This change splits off the css outside of the bundle, which should help with 
performance
as now js and css can be downloaded on parallel. Now, the
main objective under the split is that it also makes a lot
easier the configuration of the fonts.There is a new file (lato.css) that
stores the references to the fonts we are using so they are managed by our code
rather than referencing google.

Bug: T178317
Change-Id: Ifdec8c07f3eb578112b779105f51d0e2781d5965
---
M package.json
A src/lato/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2
A src/lato/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2
A src/lato/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2
A src/lato/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2
A src/lato/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2
A src/lato/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2
A src/lato/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2
A src/lato/lato.css
A src/lato/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2
M src/main.js
M webpack/base.config.js
12 files changed, 94 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/51/390551/1

diff --git a/package.json b/package.json
index 8b3a0ce..da04355 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,7 @@
         "karma-phantomjs-launcher": "^1.0.4",
         "karma-webpack": "^2.0.3",
         "style-loader": "^0.18.1",
+        "string-replace-loader":"^1.3.0",
         "uglifyjs-webpack-plugin": "^0.4.6",
         "url-loader": "^0.5.8",
         "vue-loader": "^12.0.4",
diff --git a/src/lato/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2 
b/src/lato/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2
new file mode 100644
index 0000000..3c03843
--- /dev/null
+++ b/src/lato/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2
Binary files differ
diff --git a/src/lato/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2 
b/src/lato/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2
new file mode 100644
index 0000000..c5f3b20
--- /dev/null
+++ b/src/lato/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2
Binary files differ
diff --git a/src/lato/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2 
b/src/lato/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2
new file mode 100644
index 0000000..a7839e1
--- /dev/null
+++ b/src/lato/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2
Binary files differ
diff --git a/src/lato/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2 
b/src/lato/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2
new file mode 100644
index 0000000..623e9f9
--- /dev/null
+++ b/src/lato/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2
Binary files differ
diff --git a/src/lato/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2 
b/src/lato/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2
new file mode 100644
index 0000000..597b855
--- /dev/null
+++ b/src/lato/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2
Binary files differ
diff --git a/src/lato/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2 
b/src/lato/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2
new file mode 100644
index 0000000..e9d0b3f
--- /dev/null
+++ b/src/lato/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2
Binary files differ
diff --git a/src/lato/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2 
b/src/lato/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2
new file mode 100644
index 0000000..e3537ee
--- /dev/null
+++ b/src/lato/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2
Binary files differ
diff --git a/src/lato/lato.css b/src/lato/lato.css
new file mode 100644
index 0000000..9c366d3
--- /dev/null
+++ b/src/lato/lato.css
@@ -0,0 +1,64 @@
+/* latin-ext */
+@font-face {
+  font-family: 'Lato';
+  font-style: italic;
+  font-weight: 400;
+  src: local('Lato Italic'), local('Lato-Italic'), 
url(./cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
+  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, 
U+2C60-2C7F, U+A720-A7FF;
+}
+/* latin */
+@font-face {
+  font-family: 'Lato';
+  font-style: italic;
+  font-weight: 400;
+  src: local('Lato Italic'), local('Lato-Italic'), 
url(./1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2) format('woff2');
+  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, 
U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
+}
+/* latin-ext */
+@font-face {
+  font-family: 'Lato';
+  font-style: italic;
+  font-weight: 700;
+  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), 
url(./AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2');
+  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, 
U+2C60-2C7F, U+A720-A7FF;
+}
+/* latin */
+@font-face {
+  font-family: 'Lato';
+  font-style: italic;
+  font-weight: 700;
+  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), 
url(./HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2) format('woff2');
+  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, 
U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
+}
+/* latin-ext */
+@font-face {
+  font-family: 'Lato';
+  font-style: normal;
+  font-weight: 400;
+  src: local('Lato Regular'), local('Lato-Regular'), 
url(./8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
+  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, 
U+2C60-2C7F, U+A720-A7FF;
+}
+/* latin */
+@font-face {
+  font-family: 'Lato';
+  font-style: normal;
+  font-weight: 400;
+  src: local('Lato Regular'), local('Lato-Regular'), 
url(./MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
+  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, 
U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
+}
+/* latin-ext */
+@font-face {
+  font-family: 'Lato';
+  font-style: normal;
+  font-weight: 700;
+  src: local('Lato Bold'), local('Lato-Bold'), 
url(./rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2) format('woff2');
+  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, 
U+2C60-2C7F, U+A720-A7FF;
+}
+/* latin */
+@font-face {
+  font-family: 'Lato';
+  font-style: normal;
+  font-weight: 700;
+  src: local('Lato Bold'), local('Lato-Bold'), 
url(./MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2) format('woff2');
+  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, 
U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
+}
diff --git a/src/lato/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2 
b/src/lato/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2
new file mode 100644
index 0000000..4f778f9
--- /dev/null
+++ b/src/lato/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2
Binary files differ
diff --git a/src/main.js b/src/main.js
index 11ff33f..2a8c873 100644
--- a/src/main.js
+++ b/src/main.js
@@ -4,6 +4,7 @@
 import Vue from 'vue';
 import App from './App';
 import '../semantic/dist/semantic.css';
+import './lato/lato.css';
 
 import store from './store';
 import router from './router';
diff --git a/webpack/base.config.js b/webpack/base.config.js
index 44e621b..f6902d4 100644
--- a/webpack/base.config.js
+++ b/webpack/base.config.js
@@ -3,6 +3,9 @@
 const utils = require('./utils');
 const webpack = require('webpack');
 const BundleAnalyzerPlugin = 
require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
+const ExtractTextPlugin = require("extract-text-webpack-plugin");
+
+
 
 module.exports = {
     entry: './src/main.js',
@@ -34,13 +37,34 @@
                     name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
                 }
             },
+           {
+             test: /\.css$/,
+             use: ExtractTextPlugin.extract({
+                 fallback: "style-loader",
+                 use: "css-loader"
+            })
+            },
+            // Replacing google imports in semantic with ...ahem nothing so 
they do not run
+            // the css needed is included in lato.css
             {
-                test: /\.css$/,
-                use: [ 'style-loader', 'css-loader' ]
+                test: /semantic\.css$/,
+                use :
+                [
+                {loader: 'string-replace-loader',
+                    query: {
+                     search: 
'https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin',
+                     replace: '',
+                     strict: true
+                    }
+                }
+                ]
             }
-        ]
+            ]
     },
+
+
     plugins: [
+        new ExtractTextPlugin("styles.css"),
         new HtmlWebpackPlugin({
             filename: 'index.html',
             template: 'src/index.html',
@@ -60,6 +84,7 @@
         ),
         // uncomment to see bundle size composition when running webpack
         // new BundleAnalyzerPlugin()
+
     ],
     devServer: {
         contentBase: utils.resolve('dist'),

-- 
To view, visit https://gerrit.wikimedia.org/r/390551
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifdec8c07f3eb578112b779105f51d0e2781d5965
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Nuria <nu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to