aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-20 09:04:52 +0100
committerChocobozzz <me@florianbigard.com>2017-12-20 09:05:16 +0100
commit24a8e782d8b2adb208d9cfb8659450395e2e2a77 (patch)
tree2f8aaebb8ec06c1c9b82728a9f46efd59163767f
parent1c6c7699f54e516839058529f11fb2e3d49c4ec0 (diff)
downloadPeerTube-24a8e782d8b2adb208d9cfb8659450395e2e2a77.tar.gz
PeerTube-24a8e782d8b2adb208d9cfb8659450395e2e2a77.tar.zst
PeerTube-24a8e782d8b2adb208d9cfb8659450395e2e2a77.zip
Add bootstrap analyzer and optimize build
-rw-r--r--client/package.json6
-rw-r--r--client/src/app/+admin/admin.module.ts2
-rw-r--r--client/src/app/shared/shared.module.ts3
-rw-r--r--client/src/app/videos/+video-edit/shared/video-description.component.ts2
-rw-r--r--client/src/sass/include/_bootstrap.scss56
-rw-r--r--client/yarn.lock54
-rw-r--r--package.json3
-rwxr-xr-xscripts/build/client.sh2
-rwxr-xr-xscripts/client-report.sh5
9 files changed, 123 insertions, 10 deletions
diff --git a/client/package.json b/client/package.json
index 7e23d4d75..ba0a318bc 100644
--- a/client/package.json
+++ b/client/package.json
@@ -16,7 +16,8 @@
16 "lint": "standard && tslint --type-check --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts'", 16 "lint": "standard && tslint --type-check --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts'",
17 "webpack": "webpack", 17 "webpack": "webpack",
18 "ng": "ng", 18 "ng": "ng",
19 "postinstall": "npm rebuild node-sass" 19 "postinstall": "npm rebuild node-sass",
20 "webpack-bundle-analyzer": "webpack-bundle-analyzer"
20 }, 21 },
21 "license": "GPLv3", 22 "license": "GPLv3",
22 "dependencies": {}, 23 "dependencies": {},
@@ -37,6 +38,7 @@
37 "@ngx-loading-bar/http-client": "^1.0.0-rc.1", 38 "@ngx-loading-bar/http-client": "^1.0.0-rc.1",
38 "@ngx-meta/core": "^4.0.1", 39 "@ngx-meta/core": "^4.0.1",
39 "@types/core-js": "^0.9.28", 40 "@types/core-js": "^0.9.28",
41 "@types/lodash-es": "^4.17.0",
40 "@types/markdown-it": "^0.0.4", 42 "@types/markdown-it": "^0.0.4",
41 "@types/node": "^8.0.33", 43 "@types/node": "^8.0.33",
42 "@types/video.js": "6.2.0", 44 "@types/video.js": "6.2.0",
@@ -50,6 +52,7 @@
50 "extract-text-webpack-plugin": "^3.0.2", 52 "extract-text-webpack-plugin": "^3.0.2",
51 "file-loader": "^1.1.5", 53 "file-loader": "^1.1.5",
52 "html-webpack-plugin": "^2.19.0", 54 "html-webpack-plugin": "^2.19.0",
55 "lodash-es": "^4.17.4",
53 "markdown-it": "^8.4.0", 56 "markdown-it": "^8.4.0",
54 "ngx-bootstrap": "2.0.0-beta.9", 57 "ngx-bootstrap": "2.0.0-beta.9",
55 "ngx-chips": "1.6.1", 58 "ngx-chips": "1.6.1",
@@ -74,6 +77,7 @@
74 "video.js": "^6.2.0", 77 "video.js": "^6.2.0",
75 "videojs-dock": "^2.0.2", 78 "videojs-dock": "^2.0.2",
76 "webpack": "^3.3.0", 79 "webpack": "^3.3.0",
80 "webpack-bundle-analyzer": "^2.9.1",
77 "webtorrent": "^0.98.0", 81 "webtorrent": "^0.98.0",
78 "zone.js": "~0.8.5" 82 "zone.js": "~0.8.5"
79 } 83 }
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts
index c0b006e73..74ceb25ef 100644
--- a/client/src/app/+admin/admin.module.ts
+++ b/client/src/app/+admin/admin.module.ts
@@ -1,5 +1,6 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { TabsModule } from 'ngx-bootstrap/tabs' 2import { TabsModule } from 'ngx-bootstrap/tabs'
3import { DataTableModule } from 'primeng/components/datatable/datatable'
3import { SharedModule } from '../shared' 4import { SharedModule } from '../shared'
4import { AdminRoutingModule } from './admin-routing.module' 5import { AdminRoutingModule } from './admin-routing.module'
5import { AdminComponent } from './admin.component' 6import { AdminComponent } from './admin.component'
@@ -16,6 +17,7 @@ import { VideoBlacklistComponent, VideoBlacklistListComponent } from './video-bl
16 imports: [ 17 imports: [
17 AdminRoutingModule, 18 AdminRoutingModule,
18 TabsModule.forRoot(), 19 TabsModule.forRoot(),
20 DataTableModule,
19 SharedModule 21 SharedModule
20 ], 22 ],
21 23
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts
index 5af118c98..a5c56cb46 100644
--- a/client/src/app/shared/shared.module.ts
+++ b/client/src/app/shared/shared.module.ts
@@ -10,7 +10,6 @@ import { ModalModule } from 'ngx-bootstrap/modal'
10import { InfiniteScrollModule } from 'ngx-infinite-scroll' 10import { InfiniteScrollModule } from 'ngx-infinite-scroll'
11import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' 11import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes'
12import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared' 12import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared'
13import { DataTableModule } from 'primeng/components/datatable/datatable'
14 13
15import { AUTH_INTERCEPTOR_PROVIDER } from './auth' 14import { AUTH_INTERCEPTOR_PROVIDER } from './auth'
16import { DeleteButtonComponent } from './misc/delete-button.component' 15import { DeleteButtonComponent } from './misc/delete-button.component'
@@ -39,7 +38,6 @@ import { VideoService } from './video/video.service'
39 BsDropdownModule.forRoot(), 38 BsDropdownModule.forRoot(),
40 ModalModule.forRoot(), 39 ModalModule.forRoot(),
41 40
42 DataTableModule,
43 PrimeSharedModule, 41 PrimeSharedModule,
44 InfiniteScrollModule, 42 InfiniteScrollModule,
45 NgPipesModule 43 NgPipesModule
@@ -66,7 +64,6 @@ import { VideoService } from './video/video.service'
66 64
67 BsDropdownModule, 65 BsDropdownModule,
68 ModalModule, 66 ModalModule,
69 DataTableModule,
70 PrimeSharedModule, 67 PrimeSharedModule,
71 InfiniteScrollModule, 68 InfiniteScrollModule,
72 BytesPipe, 69 BytesPipe,
diff --git a/client/src/app/videos/+video-edit/shared/video-description.component.ts b/client/src/app/videos/+video-edit/shared/video-description.component.ts
index 9b77a27e6..34dbc21a6 100644
--- a/client/src/app/videos/+video-edit/shared/video-description.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-description.component.ts
@@ -1,10 +1,10 @@
1import { Component, forwardRef, Input, OnInit } from '@angular/core' 1import { Component, forwardRef, Input, OnInit } from '@angular/core'
2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' 2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3import { truncate } from 'lodash'
4import 'rxjs/add/operator/debounceTime' 3import 'rxjs/add/operator/debounceTime'
5import 'rxjs/add/operator/distinctUntilChanged' 4import 'rxjs/add/operator/distinctUntilChanged'
6import { Subject } from 'rxjs/Subject' 5import { Subject } from 'rxjs/Subject'
7import { MarkdownService } from '../../shared' 6import { MarkdownService } from '../../shared'
7import truncate from 'lodash-es/truncate'
8 8
9@Component({ 9@Component({
10 selector: 'my-video-description', 10 selector: 'my-video-description',
diff --git a/client/src/sass/include/_bootstrap.scss b/client/src/sass/include/_bootstrap.scss
new file mode 100644
index 000000000..e72d1def2
--- /dev/null
+++ b/client/src/sass/include/_bootstrap.scss
@@ -0,0 +1,56 @@
1/*!
2 * Bootstrap v3.3.7 (http://getbootstrap.com)
3 * Copyright 2011-2016 Twitter, Inc.
4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 */
6
7// Core variables and mixins
8@import "bootstrap/variables";
9@import "bootstrap/mixins";
10
11// Reset and dependencies
12@import "bootstrap/normalize";
13@import "bootstrap/print";
14@import "bootstrap/glyphicons";
15
16// Core CSS
17@import "bootstrap/scaffolding";
18@import "bootstrap/type";
19@import "bootstrap/code";
20@import "bootstrap/grid";
21@import "bootstrap/tables";
22@import "bootstrap/forms";
23@import "bootstrap/buttons";
24
25// Components
26@import "bootstrap/component-animations";
27@import "bootstrap/dropdowns";
28@import "bootstrap/button-groups";
29@import "bootstrap/input-groups";
30@import "bootstrap/navs";
31@import "bootstrap/navbar";
32@import "bootstrap/breadcrumbs";
33@import "bootstrap/pagination";
34@import "bootstrap/pager";
35@import "bootstrap/labels";
36@import "bootstrap/badges";
37@import "bootstrap/jumbotron";
38@import "bootstrap/thumbnails";
39@import "bootstrap/alerts";
40@import "bootstrap/progress-bars";
41@import "bootstrap/media";
42@import "bootstrap/list-group";
43@import "bootstrap/panels";
44@import "bootstrap/responsive-embed";
45@import "bootstrap/wells";
46@import "bootstrap/close";
47
48// Components w/ JavaScript
49@import "bootstrap/modals";
50@import "bootstrap/tooltip";
51@import "bootstrap/popovers";
52@import "bootstrap/carousel";
53
54// Utility classes
55@import "bootstrap/utilities";
56@import "bootstrap/responsive-utilities";
diff --git a/client/yarn.lock b/client/yarn.lock
index 10f15bcd6..10af86a55 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -217,6 +217,16 @@
217 version "0.9.43" 217 version "0.9.43"
218 resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-0.9.43.tgz#65d646c5e8c0cd1bdee37065799f9d3d48748253" 218 resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-0.9.43.tgz#65d646c5e8c0cd1bdee37065799f9d3d48748253"
219 219
220"@types/lodash-es@^4.17.0":
221 version "4.17.0"
222 resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.0.tgz#ed9044d62ee36a93e0650b112701986b1c74c766"
223 dependencies:
224 "@types/lodash" "*"
225
226"@types/lodash@*":
227 version "4.14.91"
228 resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.91.tgz#794611b28056d16b5436059c6d800b39d573cd3a"
229
220"@types/magnet-uri@*": 230"@types/magnet-uri@*":
221 version "5.1.1" 231 version "5.1.1"
222 resolved "https://registry.yarnpkg.com/@types/magnet-uri/-/magnet-uri-5.1.1.tgz#861aaf64c92a3137dd848fefc55cd352a8ea851a" 232 resolved "https://registry.yarnpkg.com/@types/magnet-uri/-/magnet-uri-5.1.1.tgz#861aaf64c92a3137dd848fefc55cd352a8ea851a"
@@ -295,7 +305,7 @@ acorn@^4.0.3:
295 version "4.0.13" 305 version "4.0.13"
296 resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" 306 resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"
297 307
298acorn@^5.0.0, acorn@^5.2.1: 308acorn@^5.0.0, acorn@^5.1.1, acorn@^5.2.1:
299 version "5.2.1" 309 version "5.2.1"
300 resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" 310 resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7"
301 311
@@ -1938,6 +1948,10 @@ domutils@1.5.1:
1938 dom-serializer "0" 1948 dom-serializer "0"
1939 domelementtype "1" 1949 domelementtype "1"
1940 1950
1951duplexer@^0.1.1:
1952 version "0.1.1"
1953 resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
1954
1941duplexify@^3.1.2, duplexify@^3.4.2: 1955duplexify@^3.1.2, duplexify@^3.4.2:
1942 version "3.5.1" 1956 version "3.5.1"
1943 resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" 1957 resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd"
@@ -1957,7 +1971,7 @@ ee-first@1.1.1:
1957 version "1.1.1" 1971 version "1.1.1"
1958 resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" 1972 resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
1959 1973
1960ejs@^2.5.7: 1974ejs@^2.5.6, ejs@^2.5.7:
1961 version "2.5.7" 1975 version "2.5.7"
1962 resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a" 1976 resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a"
1963 1977
@@ -2349,7 +2363,7 @@ exports-loader@^0.6.3:
2349 loader-utils "^1.0.2" 2363 loader-utils "^1.0.2"
2350 source-map "0.5.x" 2364 source-map "0.5.x"
2351 2365
2352express@^4.16.2: 2366express@^4.15.2, express@^4.16.2:
2353 version "4.16.2" 2367 version "4.16.2"
2354 resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c" 2368 resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c"
2355 dependencies: 2369 dependencies:
@@ -2489,6 +2503,10 @@ filename-regex@^2.0.0:
2489 version "2.0.1" 2503 version "2.0.1"
2490 resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" 2504 resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
2491 2505
2506filesize@^3.5.9:
2507 version "3.5.11"
2508 resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.5.11.tgz#1919326749433bb3cf77368bd158caabcc19e9ee"
2509
2492filestream@^4.0.0: 2510filestream@^4.0.0:
2493 version "4.1.3" 2511 version "4.1.3"
2494 resolved "https://registry.yarnpkg.com/filestream/-/filestream-4.1.3.tgz#948fcaade8221f715f5ecaddc54862faaacc9325" 2512 resolved "https://registry.yarnpkg.com/filestream/-/filestream-4.1.3.tgz#948fcaade8221f715f5ecaddc54862faaacc9325"
@@ -2864,6 +2882,12 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
2864 version "4.1.11" 2882 version "4.1.11"
2865 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" 2883 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
2866 2884
2885gzip-size@^3.0.0:
2886 version "3.0.0"
2887 resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520"
2888 dependencies:
2889 duplexer "^0.1.1"
2890
2867handle-thing@^1.2.5: 2891handle-thing@^1.2.5:
2868 version "1.2.5" 2892 version "1.2.5"
2869 resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" 2893 resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4"
@@ -3823,6 +3847,10 @@ locate-path@^2.0.0:
3823 p-locate "^2.0.0" 3847 p-locate "^2.0.0"
3824 path-exists "^3.0.0" 3848 path-exists "^3.0.0"
3825 3849
3850lodash-es@^4.17.4:
3851 version "4.17.4"
3852 resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7"
3853
3826lodash._baseassign@^3.0.0: 3854lodash._baseassign@^3.0.0:
3827 version "3.2.0" 3855 version "3.2.0"
3828 resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" 3856 resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
@@ -4616,6 +4644,10 @@ onetime@^1.0.0:
4616 version "1.1.0" 4644 version "1.1.0"
4617 resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" 4645 resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789"
4618 4646
4647opener@^1.4.3:
4648 version "1.4.3"
4649 resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8"
4650
4619opn@^5.1.0, opn@~5.1.0: 4651opn@^5.1.0, opn@~5.1.0:
4620 version "5.1.0" 4652 version "5.1.0"
4621 resolved "https://registry.yarnpkg.com/opn/-/opn-5.1.0.tgz#72ce2306a17dbea58ff1041853352b4a8fc77519" 4653 resolved "https://registry.yarnpkg.com/opn/-/opn-5.1.0.tgz#72ce2306a17dbea58ff1041853352b4a8fc77519"
@@ -7159,6 +7191,22 @@ wbuf@^1.1.0, wbuf@^1.7.2:
7159 dependencies: 7191 dependencies:
7160 minimalistic-assert "^1.0.0" 7192 minimalistic-assert "^1.0.0"
7161 7193
7194webpack-bundle-analyzer@^2.9.1:
7195 version "2.9.1"
7196 resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.9.1.tgz#c2c8e03e8e5768ed288b39ae9e27a8b8d7b9d476"
7197 dependencies:
7198 acorn "^5.1.1"
7199 chalk "^1.1.3"
7200 commander "^2.9.0"
7201 ejs "^2.5.6"
7202 express "^4.15.2"
7203 filesize "^3.5.9"
7204 gzip-size "^3.0.0"
7205 lodash "^4.17.4"
7206 mkdirp "^0.5.1"
7207 opener "^1.4.3"
7208 ws "^3.3.1"
7209
7162webpack-concat-plugin@^1.4.2: 7210webpack-concat-plugin@^1.4.2:
7163 version "1.4.2" 7211 version "1.4.2"
7164 resolved "https://registry.yarnpkg.com/webpack-concat-plugin/-/webpack-concat-plugin-1.4.2.tgz#b60bbb626ce5001911809d6e2329fa32f4978a88" 7212 resolved "https://registry.yarnpkg.com/webpack-concat-plugin/-/webpack-concat-plugin-1.4.2.tgz#b60bbb626ce5001911809d6e2329fa32f4978a88"
diff --git a/package.json b/package.json
index 51434b86c..71da491be 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,8 @@
47 "ts-node": "ts-node", 47 "ts-node": "ts-node",
48 "tslint": "tslint", 48 "tslint": "tslint",
49 "travis": "scripty", 49 "travis": "scripty",
50 "release": "scripty" 50 "release": "scripty",
51 "client-report": "scripty"
51 }, 52 },
52 "dependencies": { 53 "dependencies": {
53 "async": "^2.0.0", 54 "async": "^2.0.0",
diff --git a/scripts/build/client.sh b/scripts/build/client.sh
index 8e8da7cbc..e3137df37 100755
--- a/scripts/build/client.sh
+++ b/scripts/build/client.sh
@@ -4,5 +4,5 @@ cd client || exit -1
4 4
5rm -rf ./dist ./compiled 5rm -rf ./dist ./compiled
6 6
7npm run ng build -- --prod 7npm run ng build -- --prod --stats-json
8NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js 8NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js
diff --git a/scripts/client-report.sh b/scripts/client-report.sh
new file mode 100755
index 000000000..586cc2e47
--- /dev/null
+++ b/scripts/client-report.sh
@@ -0,0 +1,5 @@
1#!/bin/bash
2
3cd client || exit -1
4
5npm run webpack-bundle-analyzer ./dist/stats.json