|
1 | 1 | import 'regenerator-runtime/runtime'; |
2 | 2 | import Vue from 'vue'; |
3 | 3 | 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' |
5 | 103 | import VueIntl from 'vue-intl'; |
6 | 104 | import Croppa from 'vue-croppa'; |
7 | 105 | import { Workbox, messageSW } from 'workbox-window'; |
@@ -29,6 +127,85 @@ Vue.use(Croppa); |
29 | 127 | Vue.use(VueIntl); |
30 | 128 | Vue.use(VueRouter); |
31 | 129 | 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 | + }, |
32 | 209 | rtl: window.isRTL, |
33 | 210 | // Enable css variables (e.g. `var(--v-grey-darken1)`) |
34 | 211 | options: { |
|
0 commit comments