cleanup dynamic/static import warnings

This commit is contained in:
Henry Jameson 2026-06-02 18:09:12 +03:00
commit b7ccbc6726
14 changed files with 88 additions and 61 deletions

View file

@ -10,11 +10,9 @@ import DMs from 'components/dm_timeline/dm_timeline.vue'
import Drafts from 'components/drafts/drafts.vue' import Drafts from 'components/drafts/drafts.vue'
import FollowRequests from 'components/follow_requests/follow_requests.vue' import FollowRequests from 'components/follow_requests/follow_requests.vue'
import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue' import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'
import Interactions from 'components/interactions/interactions.vue'
import Lists from 'components/lists/lists.vue' import Lists from 'components/lists/lists.vue'
import ListsEdit from 'components/lists_edit/lists_edit.vue' import ListsEdit from 'components/lists_edit/lists_edit.vue'
import ListsTimeline from 'components/lists_timeline/lists_timeline.vue' import ListsTimeline from 'components/lists_timeline/lists_timeline.vue'
import Notifications from 'components/notifications/notifications.vue'
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue' import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
import PasswordReset from 'components/password_reset/password_reset.vue' import PasswordReset from 'components/password_reset/password_reset.vue'
import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue' import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'
@ -24,8 +22,8 @@ import RemoteUserResolver from 'components/remote_user_resolver/remote_user_reso
import Search from 'components/search/search.vue' import Search from 'components/search/search.vue'
import ShoutPanel from 'components/shout_panel/shout_panel.vue' import ShoutPanel from 'components/shout_panel/shout_panel.vue'
import TagTimeline from 'components/tag_timeline/tag_timeline.vue' import TagTimeline from 'components/tag_timeline/tag_timeline.vue'
import UserProfile from 'components/user_profile/user_profile.vue'
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue' import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
import { defineAsyncComponent } from 'vue'
import NavPanel from 'src/components/nav_panel/nav_panel.vue' import NavPanel from 'src/components/nav_panel/nav_panel.vue'
import BookmarkFolderEdit from '../components/bookmark_folder_edit/bookmark_folder_edit.vue' import BookmarkFolderEdit from '../components/bookmark_folder_edit/bookmark_folder_edit.vue'
@ -100,12 +98,16 @@ export default (store) => {
{ {
name: 'external-user-profile', name: 'external-user-profile',
path: '/users/$:id', path: '/users/$:id',
component: UserProfile, component: defineAsyncComponent(
() => import('src/components/user_profile/user_profile.vue'),
),
}, },
{ {
name: 'interactions', name: 'interactions',
path: '/users/:username/interactions', path: '/users/:username/interactions',
component: Interactions, component: defineAsyncComponent(
() => import('src/components/interactions/interactions.vue'),
),
beforeEnter: validateAuthenticatedRoute, beforeEnter: validateAuthenticatedRoute,
}, },
{ {
@ -135,7 +137,9 @@ export default (store) => {
{ {
name: 'notifications', name: 'notifications',
path: '/:username/notifications', path: '/:username/notifications',
component: Notifications, component: defineAsyncComponent(
() => import('src/components/notifications/notifications.vue'),
),
props: () => ({ disableTeleport: true }), props: () => ({ disableTeleport: true }),
beforeEnter: validateAuthenticatedRoute, beforeEnter: validateAuthenticatedRoute,
}, },
@ -171,8 +175,20 @@ export default (store) => {
component: AnnouncementsPage, component: AnnouncementsPage,
}, },
{ name: 'drafts', path: '/drafts', component: Drafts }, { name: 'drafts', path: '/drafts', component: Drafts },
{ name: 'user-profile', path: '/users/:name', component: UserProfile }, {
{ name: 'legacy-user-profile', path: '/:name', component: UserProfile }, name: 'user-profile',
path: '/users/:name',
component: defineAsyncComponent(
() => import('src/components/user_profile/user_profile.vue'),
),
},
{
name: 'legacy-user-profile',
path: '/:name',
component: defineAsyncComponent(
() => import('src/components/user_profile/user_profile.vue'),
),
},
{ name: 'lists', path: '/lists', component: Lists }, { name: 'lists', path: '/lists', component: Lists },
{ name: 'lists-timeline', path: '/lists/:id', component: ListsTimeline }, { name: 'lists-timeline', path: '/lists/:id', component: ListsTimeline },
{ name: 'lists-edit', path: '/lists/:id/edit', component: ListsEdit }, { name: 'lists-edit', path: '/lists/:id/edit', component: ListsEdit },

View file

@ -1,14 +1,14 @@
import { mapState as mapPiniaState } from 'pinia' import { mapState as mapPiniaState } from 'pinia'
import { defineAsyncComponent } from 'vue'
import { mapGetters, mapState } from 'vuex' import { mapGetters, mapState } from 'vuex'
import Attachment from '../attachment/attachment.vue' import Attachment from 'src/components/attachment/attachment.vue'
import ChatMessageDate from '../chat_message_date/chat_message_date.vue' import ChatMessageDate from 'src/components/chat_message_date/chat_message_date.vue'
import Gallery from '../gallery/gallery.vue' import Gallery from 'src/components/gallery/gallery.vue'
import LinkPreview from '../link-preview/link-preview.vue' import LinkPreview from 'src/components/link-preview/link-preview.vue'
import Popover from '../popover/popover.vue' import Popover from 'src/components/popover/popover.vue'
import StatusContent from '../status_content/status_content.vue' import StatusContent from 'src/components/status_content/status_content.vue'
import UserAvatar from '../user_avatar/user_avatar.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
import UserPopover from 'src/components/user_popover/user_popover.vue'
import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceStore } from 'src/stores/instance.js'
import { useInterfaceStore } from 'src/stores/interface' import { useInterfaceStore } from 'src/stores/interface'
@ -37,9 +37,7 @@ const ChatMessage = {
Gallery, Gallery,
LinkPreview, LinkPreview,
ChatMessageDate, ChatMessageDate,
UserPopover: defineAsyncComponent( UserPopover,
() => import('../user_popover/user_popover.vue'),
),
}, },
computed: { computed: {
// Returns HH:MM (hours and minutes) in local time. // Returns HH:MM (hours and minutes) in local time.

View file

@ -1,7 +1,8 @@
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import RichContent from 'src/components/rich_content/rich_content.jsx' import RichContent from 'src/components/rich_content/rich_content.jsx'
import UserAvatar from '../user_avatar/user_avatar.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
import UserPopover from 'src/components/user_popover/user_popover.vue'
import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js'
@ -10,9 +11,7 @@ export default {
components: { components: {
UserAvatar, UserAvatar,
RichContent, RichContent,
UserPopover: defineAsyncComponent( UserPopover,
() => import('../user_popover/user_popover.vue'),
),
}, },
props: ['user', 'withAvatar'], props: ['user', 'withAvatar'],
computed: { computed: {

View file

@ -2,12 +2,13 @@ import { mapState as mapPiniaState } from 'pinia'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import { mapGetters, mapState } from 'vuex' import { mapGetters, mapState } from 'vuex'
import UnicodeDomainIndicator from 'src/components/unicode_domain_indicator/unicode_domain_indicator.vue'
import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
import UserPopover from 'src/components/user_popover/user_popover.vue'
import { import {
highlightClass, highlightClass,
highlightStyle, highlightStyle,
} from '../../services/user_highlighter/user_highlighter.js' } from '../../services/user_highlighter/user_highlighter.js'
import UnicodeDomainIndicator from '../unicode_domain_indicator/unicode_domain_indicator.vue'
import UserAvatar from '../user_avatar/user_avatar.vue'
import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js'
import { useUserHighlightStore } from 'src/stores/user_highlight.js' import { useUserHighlightStore } from 'src/stores/user_highlight.js'
@ -24,9 +25,7 @@ const MentionLink = {
components: { components: {
UserAvatar, UserAvatar,
UnicodeDomainIndicator, UnicodeDomainIndicator,
UserPopover: defineAsyncComponent( UserPopover,
() => import('../user_popover/user_popover.vue'),
),
}, },
props: { props: {
url: { url: {

View file

@ -1,15 +1,15 @@
import { mapState } from 'pinia' import { mapState } from 'pinia'
import { defineAsyncComponent } from 'vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue'
import NavigationPins from 'src/components/navigation/navigation_pins.vue' import NavigationPins from 'src/components/navigation/navigation_pins.vue'
import SideDrawer from 'src/components/side_drawer/side_drawer.vue'
import GestureService from '../../services/gesture_service/gesture_service' import GestureService from '../../services/gesture_service/gesture_service'
import { import {
countExtraNotifications, countExtraNotifications,
unseenNotificationsFromStore, unseenNotificationsFromStore,
} from '../../services/notification_utils/notification_utils' } from '../../services/notification_utils/notification_utils'
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import Notifications from '../notifications/notifications.vue'
import SideDrawer from '../side_drawer/side_drawer.vue'
import { useAnnouncementsStore } from 'src/stores/announcements.js' import { useAnnouncementsStore } from 'src/stores/announcements.js'
import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceStore } from 'src/stores/instance.js'
@ -30,7 +30,9 @@ library.add(faTimes, faBell, faBars, faArrowUp, faMinus, faCheckDouble)
const MobileNav = { const MobileNav = {
components: { components: {
SideDrawer, SideDrawer,
Notifications, Notifications: defineAsyncComponent(
() => import('src/components/notifications/notifications.vue'),
),
NavigationPins, NavigationPins,
ConfirmModal, ConfirmModal,
}, },

View file

@ -12,7 +12,6 @@ import Status from '../status/status.vue'
import StatusContent from '../status_content/status_content.vue' import StatusContent from '../status_content/status_content.vue'
import Timeago from '../timeago/timeago.vue' import Timeago from '../timeago/timeago.vue'
import UserAvatar from '../user_avatar/user_avatar.vue' import UserAvatar from '../user_avatar/user_avatar.vue'
import UserCard from '../user_card/user_card.vue'
import UserLink from '../user_link/user_link.vue' import UserLink from '../user_link/user_link.vue'
import UserPopover from '../user_popover/user_popover.vue' import UserPopover from '../user_popover/user_popover.vue'
@ -64,7 +63,6 @@ const Notification = {
components: { components: {
StatusContent, StatusContent,
UserAvatar, UserAvatar,
UserCard,
Timeago, Timeago,
Status, Status,
Report, Report,

View file

@ -2,23 +2,23 @@ import { debounce, map, reject, uniqBy } from 'lodash'
import { mapActions, mapState } from 'pinia' import { mapActions, mapState } from 'pinia'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import Attachment from 'src/components/attachment/attachment.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue'
import DraftCloser from 'src/components/draft_closer/draft_closer.vue' import DraftCloser from 'src/components/draft_closer/draft_closer.vue'
import EmojiInput from 'src/components/emoji_input/emoji_input.vue'
import suggestor from 'src/components/emoji_input/suggestor.js'
import Gallery from 'src/components/gallery/gallery.vue' import Gallery from 'src/components/gallery/gallery.vue'
import MediaUpload from 'src/components/media_upload/media_upload.vue'
import PollForm from 'src/components/poll/poll_form.vue'
import Popover from 'src/components/popover/popover.vue' import Popover from 'src/components/popover/popover.vue'
import QuoteForm from 'src/components/quote/quote_form.vue'
import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
import Select from 'src/components/select/select.vue'
import StatusContent from 'src/components/status_content/status_content.vue'
import { propsToNative } from '../../services/attributes_helper/attributes_helper.service.js' import { propsToNative } from '../../services/attributes_helper/attributes_helper.service.js'
import { findOffset } from '../../services/offset_finder/offset_finder.service.js' import { findOffset } from '../../services/offset_finder/offset_finder.service.js'
import genRandomSeed from '../../services/random_seed/random_seed.service.js' import genRandomSeed from '../../services/random_seed/random_seed.service.js'
import statusPoster from '../../services/status_poster/status_poster.service.js' import statusPoster from '../../services/status_poster/status_poster.service.js'
import Attachment from '../attachment/attachment.vue'
import Checkbox from '../checkbox/checkbox.vue'
import EmojiInput from '../emoji_input/emoji_input.vue'
import suggestor from '../emoji_input/suggestor.js'
import MediaUpload from '../media_upload/media_upload.vue'
import PollForm from '../poll/poll_form.vue'
import QuoteForm from '../quote/quote_form.vue'
import ScopeSelector from '../scope_selector/scope_selector.vue'
import Select from '../select/select.vue'
import StatusContent from '../status_content/status_content.vue'
import { useEmojiStore } from 'src/stores/emoji.js' import { useEmojiStore } from 'src/stores/emoji.js'
import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceStore } from 'src/stores/instance.js'

View file

@ -7,7 +7,10 @@ library.add(faCircleNotch)
export default { export default {
components: { components: {
Status: defineAsyncComponent(() => import('../status/status.vue')), // Quote and Status depend on each other, dynamic import to break this circular dependency
Status: defineAsyncComponent(
() => import('src/components/status/status.vue'),
),
}, },
name: 'Quote', name: 'Quote',
props: { props: {

View file

@ -1,10 +1,10 @@
import { mapActions, mapState } from 'pinia' import { mapActions, mapState } from 'pinia'
import { defineAsyncComponent } from 'vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js' import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js'
import GestureService from '../../services/gesture_service/gesture_service' import GestureService from '../../services/gesture_service/gesture_service'
import { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils' import { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils'
import UserCard from '../user_card/user_card.vue'
import { useAnnouncementsStore } from 'src/stores/announcements' import { useAnnouncementsStore } from 'src/stores/announcements'
import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceStore } from 'src/stores/instance.js'
@ -64,7 +64,11 @@ const SideDrawer = {
this.$store.dispatch('startFetchingFollowRequests') this.$store.dispatch('startFetchingFollowRequests')
} }
}, },
components: { UserCard }, components: {
UserCard: defineAsyncComponent(
() => import('src/components/user_card/user_card.vue'),
),
},
computed: { computed: {
currentUser() { currentUser() {
return this.$store.state.users.currentUser return this.$store.state.users.currentUser

View file

@ -1,6 +1,8 @@
import { find } from 'lodash' import { find } from 'lodash'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import Popover from 'src/components/popover/popover.vue'
import { library } from '@fortawesome/fontawesome-svg-core' import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
@ -20,8 +22,10 @@ const StatusPopover = {
}, },
}, },
components: { components: {
Status: defineAsyncComponent(() => import('../status/status.vue')), Status: defineAsyncComponent(
Popover: defineAsyncComponent(() => import('../popover/popover.vue')), () => import('src/components/status/status.vue'),
),
Popover,
}, },
methods: { methods: {
enter() { enter() {

View file

@ -1,6 +1,8 @@
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import Popover from 'src/components/popover/popover.vue'
import RichContent from 'src/components/rich_content/rich_content.jsx' import RichContent from 'src/components/rich_content/rich_content.jsx'
import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
import UnicodeDomainIndicator from '../unicode_domain_indicator/unicode_domain_indicator.vue' import UnicodeDomainIndicator from '../unicode_domain_indicator/unicode_domain_indicator.vue'
import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceStore } from 'src/stores/instance.js'
@ -19,10 +21,8 @@ const UserListPopover = {
components: { components: {
RichContent, RichContent,
UnicodeDomainIndicator, UnicodeDomainIndicator,
Popover: defineAsyncComponent(() => import('../popover/popover.vue')), Popover,
UserAvatar: defineAsyncComponent( UserAvatar,
() => import('../user_avatar/user_avatar.vue'),
),
}, },
computed: { computed: {
usersCapped() { usersCapped() {

View file

@ -1,8 +1,8 @@
import { defineAsyncComponent } from 'vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import AuthForm from '../auth_form/auth_form.js' import AuthForm from 'src/components/auth_form/auth_form.js'
import PostStatusForm from '../post_status_form/post_status_form.vue' import PostStatusForm from 'src/components/post_status_form/post_status_form.vue'
import UserCard from '../user_card/user_card.vue'
const UserPanel = { const UserPanel = {
computed: { computed: {
@ -14,7 +14,9 @@ const UserPanel = {
components: { components: {
AuthForm, AuthForm,
PostStatusForm, PostStatusForm,
UserCard, UserCard: defineAsyncComponent(
() => import('src/components/user_card/user_card.vue'),
),
}, },
} }

View file

@ -1,7 +1,7 @@
import { mapState } from 'pinia' import { mapState } from 'pinia'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
import UserCard from '../user_card/user_card.vue' import Popover from 'src/components/popover/popover.vue'
import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js'
@ -9,8 +9,10 @@ const UserPopover = {
name: 'UserPopover', name: 'UserPopover',
props: ['userId', 'overlayCenters', 'disabled', 'overlayCentersSelector'], props: ['userId', 'overlayCenters', 'disabled', 'overlayCentersSelector'],
components: { components: {
UserCard, UserCard: defineAsyncComponent(
Popover: defineAsyncComponent(() => import('../popover/popover.vue')), () => import('src/components/user_card/user_card.vue'),
),
Popover,
}, },
computed: mapState(useMergedConfigStore, { computed: mapState(useMergedConfigStore, {
userPopoverAvatarAction: (state) => userPopoverAvatarAction: (state) =>

View file

@ -16,7 +16,7 @@ const ULTIMATE_FALLBACK_LOCALE = 'en'
const hasLanguageFile = (code) => languages.includes(code) const hasLanguageFile = (code) => languages.includes(code)
const languageFileMap = import.meta.glob('./*.json') const languageFileMap = import.meta.glob(['./*.json', '!./en.json'])
const loadLanguageFile = (code) => { const loadLanguageFile = (code) => {
const jsonName = langCodeToJsonName(code) const jsonName = langCodeToJsonName(code)