Skip to content

Commit 37a0378

Browse files
committed
Remove vuetify-loader.
1 parent a1fa332 commit 37a0378

File tree

4 files changed

+178
-33
lines changed

4 files changed

+178
-33
lines changed

contentcuration/contentcuration/frontend/shared/app.js

Lines changed: 178 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,105 @@
11
import 'regenerator-runtime/runtime';
22
import Vue from 'vue';
33
import VueRouter from 'vue-router';
4-
import Vuetify from 'vuetify';
4+
import Vuetify, {
5+
// To generate this list of Vuetify components used in the Studio code base,
6+
// we can use some shell commands to look through all the components and extract
7+
// ones that are prefixed with 'V' - due to our component naming conventions
8+
// enforced by linting, this should capture all of them. The only possible issue might
9+
// be if we have imported a component from somewhere other than vuetify that prefixes
10+
// the component name with a V.
11+
// Use this shell command to regenerate this list:
12+
// egrep -o "<(V[A-Z][a-zA-Z]+)" -r -h --include "*.vue" . | egrep -o "V[a-zA-Z]+" | sort | uniq
13+
// This first greps all files ending in .vue for text starting with <V then
14+
// an uppercase letter and then any other letters.
15+
// This is then passed onto another egrep invocation that just looks for
16+
// the V and letters to give the component name.
17+
// This is then piped to sort and then uniq to give us a unique list of components.
18+
VAlert,
19+
VApp,
20+
VAutocomplete,
21+
VBadge,
22+
VBreadcrumbs,
23+
VBreadcrumbsItem,
24+
VBtn,
25+
VCard,
26+
VCardActions,
27+
VCardText,
28+
VCardTitle,
29+
VCheckbox,
30+
VChip,
31+
VCombobox,
32+
VContainer,
33+
VContent,
34+
VDataTable,
35+
VDatePicker,
36+
VDialog,
37+
VDivider,
38+
VEditDialog,
39+
VExpandTransition,
40+
VExpandXTransition,
41+
VExpansionPanel,
42+
VExpansionPanelContent,
43+
VFadeTransition,
44+
VFlex,
45+
VFooter,
46+
VForm,
47+
VHover,
48+
VImg,
49+
VInput,
50+
VLayout,
51+
VList,
52+
VListTile,
53+
VListTileAction,
54+
VListTileContent,
55+
VListTileSubTitle,
56+
VListTileTitle,
57+
VMenu,
58+
VNavigationDrawer,
59+
VPagination,
60+
VProgressCircular,
61+
VProgressLinear,
62+
VRadio,
63+
VRadioGroup,
64+
VScaleTransition,
65+
VSelect,
66+
VSheet,
67+
VSlideXReverseTransition,
68+
VSlideXTransition,
69+
VSlideYTransition,
70+
VSnackbar,
71+
VSpacer,
72+
VSpeedDial,
73+
VSubheader,
74+
VTab,
75+
VTabItem,
76+
VTabsItems,
77+
VTextarea,
78+
VTextField,
79+
VToolbar,
80+
VToolbarItems,
81+
VToolbarSideIcon,
82+
VToolbarTitle,
83+
VTooltip,
84+
VWindow,
85+
VWindowItem,
86+
} from 'vuetify/lib';
87+
import {
88+
// To generate a list of directives that are used, we use a similar bash command, but
89+
// are instead looking for directives of the form v- followed by a word.
90+
// We have to be a bit more intelligent to know which ones come from Vuetify, as it only has:
91+
// ClickOutside
92+
// Ripple
93+
// Resize
94+
// Scroll
95+
// Touch
96+
// so we are just looking for matches for any of these.
97+
// egrep -o "(v-(resize|ripple|click-outside|scroll|touch))" -r -h --include "*.vue" . | sort | uniq
98+
ClickOutside,
99+
Ripple,
100+
Resize,
101+
Scroll,
102+
} from 'vuetify/lib/directives'
5103
import VueIntl from 'vue-intl';
6104
import Croppa from 'vue-croppa';
7105
import { Workbox, messageSW } from 'workbox-window';
@@ -29,6 +127,85 @@ Vue.use(Croppa);
29127
Vue.use(VueIntl);
30128
Vue.use(VueRouter);
31129
Vue.use(Vuetify, {
130+
components: {
131+
// Explicitly register used Vuetify components globally
132+
// As it appears that the vuetify loader plugin causes memory leaks.
133+
VAlert,
134+
VApp,
135+
VAutocomplete,
136+
VBadge,
137+
VBreadcrumbs,
138+
VBreadcrumbsItem,
139+
VBtn,
140+
VCard,
141+
VCardActions,
142+
VCardText,
143+
VCardTitle,
144+
VCheckbox,
145+
VChip,
146+
VCombobox,
147+
VContainer,
148+
VContent,
149+
VDataTable,
150+
VDatePicker,
151+
VDialog,
152+
VDivider,
153+
VEditDialog,
154+
VExpandTransition,
155+
VExpandXTransition,
156+
VExpansionPanel,
157+
VExpansionPanelContent,
158+
VFadeTransition,
159+
VFlex,
160+
VFooter,
161+
VForm,
162+
VHover,
163+
VImg,
164+
VInput,
165+
VLayout,
166+
VList,
167+
VListTile,
168+
VListTileAction,
169+
VListTileContent,
170+
VListTileSubTitle,
171+
VListTileTitle,
172+
VMenu,
173+
VNavigationDrawer,
174+
VPagination,
175+
VProgressCircular,
176+
VProgressLinear,
177+
VRadio,
178+
VRadioGroup,
179+
VScaleTransition,
180+
VSelect,
181+
VSheet,
182+
VSlideXReverseTransition,
183+
VSlideXTransition,
184+
VSlideYTransition,
185+
VSnackbar,
186+
VSpacer,
187+
VSpeedDial,
188+
VSubheader,
189+
VTab,
190+
VTabItem,
191+
VTabsItems,
192+
VTextarea,
193+
VTextField,
194+
VToolbar,
195+
VToolbarItems,
196+
VToolbarSideIcon,
197+
VToolbarTitle,
198+
VTooltip,
199+
VWindow,
200+
VWindowItem,
201+
},
202+
directives: {
203+
// Explicitly register used directives.
204+
ClickOutside,
205+
Ripple,
206+
Resize,
207+
Scroll,
208+
},
32209
rtl: window.isRTL,
33210
// Enable css variables (e.g. `var(--v-grey-darken1)`)
34211
options: {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
"npm-run-all": "^4.1.3",
127127
"stylus": "^0.54.5",
128128
"stylus-loader": "^3.0.2",
129-
"vuetify-loader": "^1.7.3",
130129
"workbox-webpack-plugin": "^6.5.3"
131130
},
132131
"false": {},

webpack.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const BundleTracker = require('kolibri-tools/lib/webpackBundleTracker');
1010
const CircularDependencyPlugin = require('circular-dependency-plugin');
1111

1212
const WebpackRTLPlugin = require('kolibri-tools/lib/webpackRtlPlugin');
13-
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin');
1413

1514
const { InjectManifest } = require('workbox-webpack-plugin');
1615

@@ -89,7 +88,6 @@ module.exports = (env = {}) => {
8988
modules: [rootNodeModules],
9089
},
9190
plugins: [
92-
new VuetifyLoaderPlugin(),
9391
new BundleTracker({
9492
filename: path.resolve(djangoProjectDir, 'build', 'webpack-stats.json'),
9593
}),

yarn.lock

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,11 +3271,6 @@ call-bind@^1.0.0, call-bind@^1.0.2:
32713271
function-bind "^1.1.1"
32723272
get-intrinsic "^1.0.2"
32733273

3274-
callsite@^1.0.0:
3275-
version "1.0.0"
3276-
resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20"
3277-
integrity sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==
3278-
32793274
callsites@^3.0.0:
32803275
version "3.1.0"
32813276
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
@@ -4123,13 +4118,6 @@ debug@~3.1.0:
41234118
dependencies:
41244119
ms "2.0.0"
41254120

4126-
decache@^4.6.0:
4127-
version "4.6.1"
4128-
resolved "https://registry.yarnpkg.com/decache/-/decache-4.6.1.tgz#5928bfab97a6fcf22a65047a3d07999af36efaf0"
4129-
integrity sha512-ohApBM8u9ygepJCjgBrEZSSxPjc0T/PJkD+uNyxXPkqudyUpdXpwJYp0VISm2WrPVzASU6DZyIi6BWdyw7uJ2Q==
4130-
dependencies:
4131-
callsite "^1.0.0"
4132-
41334121
decamelize-keys@^1.1.0:
41344122
version "1.1.0"
41354123
resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9"
@@ -5209,14 +5197,6 @@ file-entry-cache@^6.0.1:
52095197
dependencies:
52105198
flat-cache "^3.0.4"
52115199

5212-
file-loader@^6.2.0:
5213-
version "6.2.0"
5214-
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
5215-
integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
5216-
dependencies:
5217-
loader-utils "^2.0.0"
5218-
schema-utils "^3.0.0"
5219-
52205200
file-saver@2.0.1:
52215201
version "2.0.1"
52225202
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.1.tgz#7fe2242af1cbc559a29d8176078a8b56d781fa79"
@@ -12265,15 +12245,6 @@ vue@^2.6.12:
1226512245
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
1226612246
integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==
1226712247

12268-
vuetify-loader@^1.7.3:
12269-
version "1.7.3"
12270-
resolved "https://registry.yarnpkg.com/vuetify-loader/-/vuetify-loader-1.7.3.tgz#404657f4925c828f400fe3269003421d586835c6"
12271-
integrity sha512-1Kt6Rfvuw3i9BBlxC9WTMnU3WEU7IBWQmDX+fYGAVGpzWCX7oHythUIwPCZGShHSYcPMKSDbXTPP8UvT5RNw8Q==
12272-
dependencies:
12273-
decache "^4.6.0"
12274-
file-loader "^6.2.0"
12275-
loader-utils "^2.0.0"
12276-
1227712248
vuetify@^1.5.24:
1227812249
version "1.5.24"
1227912250
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-1.5.24.tgz#d5cf6e7289570d5d05f8832a097cd435d36d37df"

0 commit comments

Comments
 (0)