Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize webpack chunking #38329

Merged
merged 4 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcRichContenteditable from '@nextcloud/vue/dist/Components/NcRichContenteditable.js'
import RichEditorMixin from '@nextcloud/vue/dist/Mixins/richEditor.js'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'

import Moment from './Moment.vue'
import CommentMixin from '../mixins/CommentMixin.js'

// Dynamic loading
const NcRichContenteditable = () => import('@nextcloud/vue/dist/Components/NcRichContenteditable.js')

export default {
name: 'Comment',

Expand Down
4 changes: 4 additions & 0 deletions apps/comments/src/services/CommentsInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@

import { getLoggerBuilder } from '@nextcloud/logger'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import { getRequestToken } from '@nextcloud/auth'
import CommentsApp from '../views/Comments.vue'
import Vue from 'vue'

// eslint-disable-next-line camelcase
__webpack_nonce__ = btoa(getRequestToken())

const logger = getLoggerBuilder()
.setApp('comments')
.detectUser()
Expand Down
9 changes: 7 additions & 2 deletions apps/files_sharing/src/files_sharing_tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import Vue from 'vue'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import { getRequestToken } from '@nextcloud/auth'

import SharingTab from './views/SharingTab.vue'
import ShareSearch from './services/ShareSearch.js'
import ExternalLinkActions from './services/ExternalLinkActions.js'
import ExternalShareActions from './services/ExternalShareActions.js'
Expand All @@ -33,6 +33,9 @@ import TabSections from './services/TabSections.js'
// eslint-disable-next-line n/no-missing-import, import/no-unresolved
import ShareVariant from '@mdi/svg/svg/share-variant.svg?raw'

// eslint-disable-next-line camelcase
__webpack_nonce__ = btoa(getRequestToken())

// Init Sharing Tab Service
if (!window.OCA.Sharing) {
window.OCA.Sharing = {}
Expand All @@ -46,7 +49,6 @@ Vue.prototype.t = t
Vue.prototype.n = n

// Init Sharing tab component
const View = Vue.extend(SharingTab)
let TabInstance = null

window.addEventListener('DOMContentLoaded', function() {
Expand All @@ -57,6 +59,9 @@ window.addEventListener('DOMContentLoaded', function() {
iconSvg: ShareVariant,

async mount(el, fileInfo, context) {
const SharingTab = (await import('./views/SharingTab.vue')).default
const View = Vue.extend(SharingTab)

if (TabInstance) {
TabInstance.$destroy()
}
Expand Down
8 changes: 7 additions & 1 deletion apps/files_versions/src/components/Version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ import Download from 'vue-material-design-icons/Download.vue'
import Pencil from 'vue-material-design-icons/Pencil.vue'
import Check from 'vue-material-design-icons/Check.vue'
import Delete from 'vue-material-design-icons/Delete.vue'
import { NcActionButton, NcActionLink, NcListItem, NcModal, NcButton, NcTextField, Tooltip } from '@nextcloud/vue'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js'
import NcListItem from '@nextcloud/vue/dist/Components/NcListItem.js'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
import moment from '@nextcloud/moment'
import { translate } from '@nextcloud/l10n'
import { joinPaths } from '@nextcloud/paths'
Expand Down
10 changes: 6 additions & 4 deletions apps/settings/src/components/AdminTwoFactor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadi
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'
import { loadState } from '@nextcloud/initial-state'

import _ from 'lodash'
import sortedUniq from 'lodash/sortedUniq.js'
import uniq from 'lodash/uniq.js'
import debounce from 'lodash/debounce.js'
import { generateUrl, generateOcsUrl } from '@nextcloud/router'

export default {
Expand Down Expand Up @@ -125,19 +127,19 @@ export default {
mounted() {
// Groups are loaded dynamically, but the assigned ones *should*
// be valid groups, so let's add them as initial state
this.groups = _.sortedUniq(_.uniq(this.enforcedGroups.concat(this.excludedGroups)))
this.groups = sortedUniq(uniq(this.enforcedGroups.concat(this.excludedGroups)))

// Populate the groups with a first set so the dropdown is not empty
// when opening the page the first time
this.searchGroup('')
},
methods: {
searchGroup: _.debounce(function(query) {
searchGroup: debounce(function(query) {
this.loadingGroups = true
axios.get(generateOcsUrl('cloud/groups?offset=0&search={query}&limit=20', { query }))
.then(res => res.data.ocs)
.then(ocs => ocs.data.groups)
.then(groups => { this.groups = _.sortedUniq(_.uniq(this.groups.concat(groups))) })
.then(groups => { this.groups = sortedUniq(uniq(this.groups.concat(groups))) })
.catch(err => console.error('could not search groups', err))
.then(() => { this.loadingGroups = false })
}, 500),
Expand Down
8 changes: 3 additions & 5 deletions apps/settings/src/components/AuthToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@
</template>

<script>
import {
NcActions,
NcActionButton,
NcActionCheckbox,
} from '@nextcloud/vue'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox.js'

// When using capture groups the following parts are extracted the first is used as the version number, the second as the OS
const userAgentMap = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
</template>

<script>
import { NcActions, NcActionButton } from '@nextcloud/vue'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
import AlertOctagon from 'vue-material-design-icons/AlertOctagon.vue'
import Check from 'vue-material-design-icons/Check.vue'
Expand Down
10 changes: 4 additions & 6 deletions apps/settings/src/components/UserList/UserRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,10 @@
<script>
import ClickOutside from 'vue-click-outside'

import {
NcPopoverMenu,
NcMultiselect,
NcActions,
NcActionButton,
} from '@nextcloud/vue'
import NcPopoverMenu from '@nextcloud/vue/dist/Components/NcPopoverMenu.js'
import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import UserRowSimple from './UserRowSimple.vue'
import UserRowMixin from '../../mixins/UserRowMixin.js'

Expand Down
6 changes: 2 additions & 4 deletions apps/theming/src/AdminTheming.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@
<script>
import { loadState } from '@nextcloud/initial-state'

import {
NcNoteCard,
NcSettingsSection,
} from '@nextcloud/vue'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'
import CheckboxField from './components/admin/CheckboxField.vue'
import ColorPickerField from './components/admin/ColorPickerField.vue'
import FileInputField from './components/admin/FileInputField.vue'
Expand Down
6 changes: 2 additions & 4 deletions apps/theming/src/components/admin/CheckboxField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@
</template>

<script>
import {
NcCheckboxRadioSwitch,
NcNoteCard,
} from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import TextValueMixin from '../../mixins/admin/TextValueMixin.js'

Expand Down
8 changes: 3 additions & 5 deletions apps/theming/src/components/admin/ColorPickerField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@

<script>
import { debounce } from 'debounce'
import {
NcButton,
NcColorPicker,
NcNoteCard,
} from '@nextcloud/vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import Undo from 'vue-material-design-icons/UndoVariant.vue'

import TextValueMixin from '../../mixins/admin/TextValueMixin.js'
Expand Down
8 changes: 3 additions & 5 deletions apps/theming/src/components/admin/FileInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'

import {
NcButton,
NcLoadingIcon,
NcNoteCard,
} from '@nextcloud/vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import Delete from 'vue-material-design-icons/Delete.vue'
import Undo from 'vue-material-design-icons/UndoVariant.vue'
import Upload from 'vue-material-design-icons/Upload.vue'
Expand Down
2 changes: 1 addition & 1 deletion apps/theming/src/components/admin/TextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</template>

<script>
import { NcTextField } from '@nextcloud/vue'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'

import TextValueMixin from '../../mixins/admin/TextValueMixin.js'

Expand Down
3 changes: 3 additions & 0 deletions dist/2323-2323.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions dist/2323-2323.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*! For license information please see NcRichContenteditable.js.LICENSE.txt */
1 change: 1 addition & 0 deletions dist/2323-2323.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/614-614.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/614-614.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/6187-6187.js

Large diffs are not rendered by default.

Loading