From 406b4bdbe79b5b0b68fcdcb3c4b6e419460a0258 Mon Sep 17 00:00:00 2001 From: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:42:09 +0900 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=E9=9D=9E=E6=8E=A8?= =?UTF-8?q?=E5=A5=A8=E3=81=A8=E3=81=AA=E3=81=A3=E3=81=9FReactivity=20Trans?= =?UTF-8?q?form=E3=82=92=E4=BD=BF=E3=82=8F=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=20(#12539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(frontend): 非推奨となったReactivity Transformを使わないように * refactor: 不要な括弧を除去 * fix: 不要なアノテーションを除去 * fix: Refの配列をrefしている部分の対応 * refactor: 不要な括弧を除去 * fix: lint * refactor: Ref、ShallowRef、ComputedRefの変数の宣言をletからconstに置換 * fix: type error * chore: drop reactivity transform from eslint configuration * refactor: remove unnecessary import * fix: 対応漏れ --- packages/frontend/.eslintrc.cjs | 6 - packages/frontend/package.json | 1 - .../frontend/src/components/MkAbuseReport.vue | 5 +- .../src/components/MkAchievements.vue | 10 +- .../frontend/src/components/MkAnalogClock.vue | 64 +-- packages/frontend/src/components/MkAsUi.vue | 6 +- packages/frontend/src/components/MkButton.vue | 14 +- packages/frontend/src/components/MkChart.vue | 4 +- .../frontend/src/components/MkChartLegend.vue | 19 +- .../frontend/src/components/MkClickerGame.vue | 14 +- .../frontend/src/components/MkContextMenu.vue | 16 +- .../src/components/MkCropperDialog.vue | 16 +- packages/frontend/src/components/MkDialog.vue | 19 +- .../src/components/MkEmojiPickerDialog.vue | 13 +- .../components/MkFileCaptionEditWindow.vue | 10 +- packages/frontend/src/components/MkFolder.vue | 20 +- .../src/components/MkFollowButton.vue | 24 +- .../src/components/MkForgotPassword.vue | 18 +- .../frontend/src/components/MkHeatmap.vue | 18 +- .../src/components/MkImgWithBlurhash.vue | 45 ++- .../src/components/MkInstanceCardMini.vue | 5 +- .../src/components/MkInstanceStats.vue | 16 +- .../src/components/MkInstanceTicker.vue | 4 +- .../frontend/src/components/MkLaunchPad.vue | 6 +- packages/frontend/src/components/MkLink.vue | 8 +- .../frontend/src/components/MkMediaBanner.vue | 4 +- .../frontend/src/components/MkMediaImage.vue | 18 +- .../frontend/src/components/MkMediaList.vue | 4 +- packages/frontend/src/components/MkMenu.vue | 30 +- .../frontend/src/components/MkMiniChart.vue | 20 +- packages/frontend/src/components/MkModal.vue | 92 ++--- .../frontend/src/components/MkModalWindow.vue | 24 +- packages/frontend/src/components/MkNote.vue | 78 ++-- .../src/components/MkNoteDetailed.vue | 76 ++-- .../frontend/src/components/MkNoteSimple.vue | 4 +- .../frontend/src/components/MkNoteSub.vue | 6 +- .../components/MkNotificationSelectWindow.vue | 6 +- .../src/components/MkNotifications.vue | 2 +- packages/frontend/src/components/MkOmit.vue | 14 +- .../frontend/src/components/MkPageWindow.vue | 38 +- .../frontend/src/components/MkPagination.vue | 60 +-- .../src/components/MkPasswordDialog.vue | 18 +- .../src/components/MkPlusOneEffect.vue | 6 +- .../frontend/src/components/MkPopupMenu.vue | 8 +- .../frontend/src/components/MkPostForm.vue | 368 +++++++++--------- .../src/components/MkPostFormDialog.vue | 8 +- .../src/components/MkPullToRefresh.vue | 78 ++-- .../MkPushNotificationAllowButton.vue | 41 +- packages/frontend/src/components/MkRadio.vue | 4 +- .../src/components/MkReactionEffect.vue | 6 +- .../src/components/MkReactionsViewer.vue | 26 +- .../src/components/MkRetentionHeatmap.vue | 16 +- packages/frontend/src/components/MkSignin.vue | 90 ++--- .../src/components/MkSigninDialog.vue | 8 +- .../src/components/MkSignupDialog.form.vue | 148 +++---- .../src/components/MkSignupDialog.vue | 12 +- .../src/components/MkSubNoteContent.vue | 4 +- .../frontend/src/components/MkTagCloud.vue | 20 +- .../frontend/src/components/MkTimeline.vue | 10 +- packages/frontend/src/components/MkToast.vue | 6 +- .../src/components/MkTokenGenerateWindow.vue | 26 +- .../frontend/src/components/MkUrlPreview.vue | 60 +-- .../src/components/MkUrlPreviewPopup.vue | 10 +- .../MkUserAnnouncementEditDialog.vue | 32 +- .../src/components/MkUserCardMini.vue | 6 +- .../src/components/MkUserOnlineIndicator.vue | 4 +- .../frontend/src/components/MkUserPopup.vue | 18 +- .../src/components/MkUserSelectDialog.vue | 40 +- .../components/MkUserSetupDialog.Privacy.vue | 8 +- .../src/components/MkVisibilityPicker.vue | 10 +- .../MkVisitorDashboard.ActiveUsersChart.vue | 10 +- .../src/components/MkVisitorDashboard.vue | 10 +- packages/frontend/src/components/MkWindow.vue | 94 ++--- .../src/components/MkYouTubePlayer.vue | 15 +- .../frontend/src/components/global/MkA.vue | 3 +- .../frontend/src/components/global/MkAd.vue | 2 +- .../src/components/global/MkAvatar.vue | 16 +- .../src/components/global/MkCustomEmoji.vue | 4 +- .../src/components/global/MkPageHeader.vue | 28 +- .../components/global/MkStickyContainer.vue | 62 +-- .../frontend/src/components/global/MkTime.vue | 42 +- .../src/components/global/RouterView.vue | 14 +- packages/frontend/src/pages/_error_.vue | 22 +- packages/frontend/src/pages/about-misskey.vue | 26 +- packages/frontend/src/pages/about.emojis.vue | 32 +- .../frontend/src/pages/about.federation.vue | 26 +- packages/frontend/src/pages/about.vue | 16 +- packages/frontend/src/pages/admin-file.vue | 30 +- packages/frontend/src/pages/admin-user.vue | 94 ++--- .../frontend/src/pages/admin/_header_.vue | 8 +- packages/frontend/src/pages/admin/abuses.vue | 26 +- packages/frontend/src/pages/admin/ads.vue | 20 +- .../src/pages/admin/announcements.vue | 20 +- .../src/pages/admin/bot-protection.vue | 48 +-- .../frontend/src/pages/admin/branding.vue | 76 ++-- .../frontend/src/pages/admin/database.vue | 6 +- .../src/pages/admin/email-settings.vue | 46 +-- .../src/pages/admin/external-services.vue | 18 +- .../frontend/src/pages/admin/federation.vue | 30 +- packages/frontend/src/pages/admin/files.vue | 24 +- packages/frontend/src/pages/admin/index.vue | 100 ++--- .../src/pages/admin/instance-block.vue | 19 +- packages/frontend/src/pages/admin/invites.vue | 8 +- .../frontend/src/pages/admin/moderation.vue | 46 +-- packages/frontend/src/pages/admin/modlog.vue | 16 +- .../src/pages/admin/object-storage.vue | 82 ++-- .../src/pages/admin/other-settings.vue | 30 +- .../src/pages/admin/overview.active-users.vue | 10 +- .../src/pages/admin/overview.ap-requests.vue | 14 +- .../src/pages/admin/overview.federation.vue | 30 +- .../src/pages/admin/overview.heatmap.vue | 3 +- .../src/pages/admin/overview.moderators.vue | 10 +- .../src/pages/admin/overview.queue.vue | 26 +- .../src/pages/admin/overview.stats.vue | 22 +- .../src/pages/admin/overview.users.vue | 9 +- .../frontend/src/pages/admin/overview.vue | 44 +-- .../src/pages/admin/proxy-account.vue | 22 +- .../frontend/src/pages/admin/queue.chart.vue | 26 +- packages/frontend/src/pages/admin/queue.vue | 9 +- packages/frontend/src/pages/admin/relays.vue | 10 +- .../frontend/src/pages/admin/roles.edit.vue | 28 +- .../frontend/src/pages/admin/roles.editor.vue | 54 +-- .../frontend/src/pages/admin/roles.role.vue | 14 +- packages/frontend/src/pages/admin/roles.vue | 4 +- .../frontend/src/pages/admin/security.vue | 80 ++-- .../frontend/src/pages/admin/server-rules.vue | 10 +- .../frontend/src/pages/admin/settings.vue | 118 +++--- packages/frontend/src/pages/admin/users.vue | 30 +- packages/frontend/src/pages/announcements.vue | 6 +- .../frontend/src/pages/antenna-timeline.vue | 30 +- packages/frontend/src/pages/api-console.vue | 6 +- packages/frontend/src/pages/auth.form.vue | 8 +- packages/frontend/src/pages/auth.vue | 28 +- .../frontend/src/pages/avatar-decorations.vue | 14 +- .../frontend/src/pages/channel-editor.vue | 66 ++-- packages/frontend/src/pages/channel.vue | 64 +-- packages/frontend/src/pages/channels.vue | 30 +- packages/frontend/src/pages/clip.vue | 50 +-- .../src/pages/custom-emojis-manager.vue | 4 +- packages/frontend/src/pages/drive.vue | 10 +- .../frontend/src/pages/emoji-edit-dialog.vue | 66 ++-- .../frontend/src/pages/explore.featured.vue | 3 +- packages/frontend/src/pages/explore.roles.vue | 6 +- packages/frontend/src/pages/explore.users.vue | 18 +- packages/frontend/src/pages/explore.vue | 12 +- .../frontend/src/pages/flash/flash-edit.vue | 58 +-- .../frontend/src/pages/flash/flash-index.vue | 8 +- packages/frontend/src/pages/flash/flash.vue | 78 ++-- .../frontend/src/pages/follow-requests.vue | 4 +- packages/frontend/src/pages/gallery/edit.vue | 46 +-- packages/frontend/src/pages/gallery/index.vue | 16 +- packages/frontend/src/pages/gallery/post.vue | 44 +-- packages/frontend/src/pages/instance-info.vue | 62 +-- packages/frontend/src/pages/list.vue | 38 +- packages/frontend/src/pages/miauth.vue | 14 +- .../frontend/src/pages/my-antennas/create.vue | 3 +- .../frontend/src/pages/my-antennas/edit.vue | 5 +- .../frontend/src/pages/my-antennas/editor.vue | 60 +-- .../frontend/src/pages/my-antennas/index.vue | 8 +- .../frontend/src/pages/my-clips/index.vue | 22 +- .../frontend/src/pages/my-lists/index.vue | 8 +- packages/frontend/src/pages/my-lists/list.vue | 40 +- packages/frontend/src/pages/not-found.vue | 5 +- packages/frontend/src/pages/note.vue | 56 +-- packages/frontend/src/pages/notifications.vue | 24 +- .../page-editor/els/page-editor.el.image.vue | 10 +- .../page-editor/els/page-editor.el.note.vue | 16 +- .../els/page-editor.el.section.vue | 10 +- .../page-editor/els/page-editor.el.text.vue | 8 +- .../src/pages/page-editor/page-editor.vue | 128 +++--- packages/frontend/src/pages/page.vue | 60 +-- packages/frontend/src/pages/pages.vue | 8 +- packages/frontend/src/pages/registry.keys.vue | 16 +- .../frontend/src/pages/registry.value.vue | 34 +- packages/frontend/src/pages/registry.vue | 9 +- .../frontend/src/pages/reset-password.vue | 10 +- packages/frontend/src/pages/role.vue | 28 +- packages/frontend/src/pages/scratchpad.vue | 16 +- packages/frontend/src/pages/search.note.vue | 28 +- packages/frontend/src/pages/search.user.vue | 18 +- packages/frontend/src/pages/search.vue | 8 +- packages/frontend/src/pages/settings/2fa.vue | 4 +- .../frontend/src/pages/settings/accounts.vue | 6 +- packages/frontend/src/pages/settings/api.vue | 6 +- packages/frontend/src/pages/settings/apps.vue | 6 +- .../src/pages/settings/custom-css.vue | 6 +- packages/frontend/src/pages/settings/deck.vue | 4 +- .../src/pages/settings/drive-cleaner.vue | 2 +- .../frontend/src/pages/settings/drive.vue | 14 +- .../frontend/src/pages/settings/email.vue | 6 +- .../frontend/src/pages/settings/general.vue | 4 +- .../src/pages/settings/import-export.vue | 6 +- .../frontend/src/pages/settings/index.vue | 64 +-- .../src/pages/settings/mute-block.vue | 30 +- .../frontend/src/pages/settings/navbar.vue | 4 +- .../notifications.notification-config.vue | 8 +- .../src/pages/settings/notifications.vue | 20 +- .../frontend/src/pages/settings/other.vue | 4 +- .../src/pages/settings/plugin.install.vue | 6 +- .../frontend/src/pages/settings/plugin.vue | 6 +- .../frontend/src/pages/settings/privacy.vue | 46 +-- .../frontend/src/pages/settings/profile.vue | 8 +- .../frontend/src/pages/settings/reaction.vue | 28 +- .../frontend/src/pages/settings/roles.vue | 4 +- .../frontend/src/pages/settings/security.vue | 5 +- .../frontend/src/pages/settings/sounds.vue | 4 +- .../frontend/src/pages/settings/statusbar.vue | 10 +- .../src/pages/settings/theme.install.vue | 8 +- .../src/pages/settings/theme.manage.vue | 4 +- .../frontend/src/pages/settings/theme.vue | 4 +- .../src/pages/settings/webhook.edit.vue | 50 +-- .../src/pages/settings/webhook.new.vue | 46 +-- .../frontend/src/pages/settings/webhook.vue | 6 +- packages/frontend/src/pages/share.vue | 44 +-- .../frontend/src/pages/signup-complete.vue | 10 +- packages/frontend/src/pages/tag.vue | 4 +- packages/frontend/src/pages/theme-editor.vue | 64 +-- packages/frontend/src/pages/timeline.vue | 58 +-- .../frontend/src/pages/user-list-timeline.vue | 24 +- packages/frontend/src/pages/user-tag.vue | 2 +- .../src/pages/user/activity.following.vue | 14 +- .../src/pages/user/activity.heatmap.vue | 18 +- .../src/pages/user/activity.notes.vue | 14 +- .../frontend/src/pages/user/activity.pv.vue | 14 +- .../frontend/src/pages/user/followers.vue | 24 +- .../frontend/src/pages/user/following.vue | 24 +- packages/frontend/src/pages/user/home.vue | 60 +-- .../src/pages/user/index.activity.vue | 12 +- .../frontend/src/pages/user/index.files.vue | 12 +- packages/frontend/src/pages/user/index.vue | 36 +- .../frontend/src/pages/welcome.entrance.a.vue | 10 +- packages/frontend/src/pages/welcome.setup.vue | 18 +- .../frontend/src/pages/welcome.timeline.vue | 18 +- packages/frontend/src/pages/welcome.vue | 10 +- packages/frontend/src/ui/_common_/common.vue | 8 +- .../src/ui/_common_/statusbar-federation.vue | 4 +- .../src/ui/_common_/statusbar-rss.vue | 4 +- .../src/ui/_common_/statusbar-user-list.vue | 4 +- .../src/ui/_common_/stream-indicator.vue | 8 +- packages/frontend/src/ui/classic.header.vue | 12 +- packages/frontend/src/ui/classic.sidebar.vue | 16 +- packages/frontend/src/ui/classic.vue | 42 +- packages/frontend/src/ui/deck.vue | 6 +- .../frontend/src/ui/deck/antenna-column.vue | 4 +- .../frontend/src/ui/deck/channel-column.vue | 11 +- packages/frontend/src/ui/deck/column.vue | 36 +- .../frontend/src/ui/deck/direct-column.vue | 6 +- packages/frontend/src/ui/deck/list-column.vue | 10 +- packages/frontend/src/ui/deck/main-column.vue | 6 +- .../frontend/src/ui/deck/mentions-column.vue | 6 +- .../src/ui/deck/notifications-column.vue | 4 +- .../src/ui/deck/role-timeline-column.vue | 4 +- packages/frontend/src/ui/deck/tl-column.vue | 30 +- .../frontend/src/ui/deck/widgets-column.vue | 6 +- packages/frontend/src/ui/minimum.vue | 10 +- packages/frontend/src/ui/universal.vue | 26 +- .../frontend/src/ui/universal.widgets.vue | 6 +- packages/frontend/src/ui/visitor.vue | 32 +- packages/frontend/src/ui/zen.vue | 10 +- .../src/widgets/WidgetActivity.chart.vue | 35 +- .../src/widgets/WidgetAiscriptApp.vue | 4 +- packages/frontend/src/widgets/WidgetClock.vue | 8 +- .../src/widgets/WidgetDigitalClock.vue | 7 +- .../src/widgets/WidgetInstanceCloud.vue | 10 +- .../frontend/src/widgets/WidgetJobQueue.vue | 16 +- packages/frontend/src/widgets/WidgetRss.vue | 8 +- .../frontend/src/widgets/WidgetRssTicker.vue | 12 +- .../frontend/src/widgets/WidgetUserList.vue | 17 +- .../src/widgets/server-metric/cpu-mem.vue | 56 +-- .../src/widgets/server-metric/cpu.vue | 6 +- .../src/widgets/server-metric/disk.vue | 10 +- .../src/widgets/server-metric/mem.vue | 18 +- .../src/widgets/server-metric/net.vue | 60 +-- .../src/widgets/server-metric/pie.vue | 6 +- packages/frontend/tsconfig.json | 1 - packages/frontend/vite.config.ts | 7 +- pnpm-lock.yaml | 166 ++------ 277 files changed, 3353 insertions(+), 3441 deletions(-) diff --git a/packages/frontend/.eslintrc.cjs b/packages/frontend/.eslintrc.cjs index 77038f0df..20f88dc07 100644 --- a/packages/frontend/.eslintrc.cjs +++ b/packages/frontend/.eslintrc.cjs @@ -69,12 +69,6 @@ module.exports = { 'require': false, '__dirname': false, - // Vue - '$$': false, - '$ref': false, - '$shallowRef': false, - '$computed': false, - // Misskey '_DEV_': false, '_LANGS_': false, diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 4f3b74649..9ecb47afb 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -25,7 +25,6 @@ "@syuilo/aiscript": "0.16.0", "@tabler/icons-webfont": "2.37.0", "@vitejs/plugin-vue": "4.5.1", - "@vue-macros/reactivity-transform": "0.4.0", "@vue/compiler-sfc": "3.3.9", "astring": "1.8.6", "autosize": "6.0.1", diff --git a/packages/frontend/src/components/MkAbuseReport.vue b/packages/frontend/src/components/MkAbuseReport.vue index 2c7be319c..ce7e134b7 100644 --- a/packages/frontend/src/components/MkAbuseReport.vue +++ b/packages/frontend/src/components/MkAbuseReport.vue @@ -41,6 +41,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkChart.vue b/packages/frontend/src/components/MkChart.vue index fe7077bdb..adb3c134a 100644 --- a/packages/frontend/src/components/MkChart.vue +++ b/packages/frontend/src/components/MkChart.vue @@ -74,7 +74,7 @@ const props = defineProps({ }, }); -let legendEl = $shallowRef>(); +const legendEl = shallowRef>(); const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b)); const negate = arr => arr.map(x => -x); @@ -268,7 +268,7 @@ const render = () => { gradient, }, }, - plugins: [chartVLine(vLineColor), ...(props.detailed ? [chartLegend(legendEl)] : [])], + plugins: [chartVLine(vLineColor), ...(props.detailed ? [chartLegend(legendEl.value)] : [])], }); }; diff --git a/packages/frontend/src/components/MkChartLegend.vue b/packages/frontend/src/components/MkChartLegend.vue index d321114cb..1a1b4323d 100644 --- a/packages/frontend/src/components/MkChartLegend.vue +++ b/packages/frontend/src/components/MkChartLegend.vue @@ -13,29 +13,30 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkCropperDialog.vue b/packages/frontend/src/components/MkCropperDialog.vue index 81f393660..0a1ddd317 100644 --- a/packages/frontend/src/components/MkCropperDialog.vue +++ b/packages/frontend/src/components/MkCropperDialog.vue @@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkFileCaptionEditWindow.vue b/packages/frontend/src/components/MkFileCaptionEditWindow.vue index 28888fb9c..922089a78 100644 --- a/packages/frontend/src/components/MkFileCaptionEditWindow.vue +++ b/packages/frontend/src/components/MkFileCaptionEditWindow.vue @@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkFolder.vue b/packages/frontend/src/components/MkFolder.vue index 60ecc1305..6b7dfb20e 100644 --- a/packages/frontend/src/components/MkFolder.vue +++ b/packages/frontend/src/components/MkFolder.vue @@ -50,7 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index b8de71e3b..88d318818 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkHeatmap.vue b/packages/frontend/src/components/MkHeatmap.vue index 0022531e5..a57e6c929 100644 --- a/packages/frontend/src/components/MkHeatmap.vue +++ b/packages/frontend/src/components/MkHeatmap.vue @@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkLink.vue b/packages/frontend/src/components/MkLink.vue index 0501d797f..808a071d1 100644 --- a/packages/frontend/src/components/MkLink.vue +++ b/packages/frontend/src/components/MkLink.vue @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkMediaBanner.vue b/packages/frontend/src/components/MkMediaBanner.vue index 122f8ad79..92b5388c3 100644 --- a/packages/frontend/src/components/MkMediaBanner.vue +++ b/packages/frontend/src/components/MkMediaBanner.vue @@ -32,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only