Skip to content

Commit

Permalink
Switch from Vue.extend to defineComponent (#3066)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Jan 18, 2023
1 parent 1e94d01 commit 2cd8f0f
Show file tree
Hide file tree
Showing 78 changed files with 162 additions and 161 deletions.
4 changes: 2 additions & 2 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import Vue, { defineComponent } from 'vue'
import { mapActions, mapMutations } from 'vuex'
import { ObserveVisibility } from 'vue-observe-visibility'
import FtFlexBox from './components/ft-flex-box/ft-flex-box.vue'
Expand All @@ -18,7 +18,7 @@ let ipcRenderer = null

Vue.directive('observe-visibility', ObserveVisibility)

export default Vue.extend({
export default defineComponent({
name: 'App',
components: {
FtFlexBox,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/data-settings/data-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import { mapActions, mapMutations } from 'vuex'
import FtButton from '../ft-button/ft-button.vue'
Expand All @@ -18,7 +18,7 @@ import {
} from '../../helpers/utils'
import { invidiousAPICall } from '../../helpers/api/invidious'

export default Vue.extend({
export default defineComponent({
name: 'DataSettings',
components: {
'ft-settings-section': FtSettingsSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtInputTags from '../../components/ft-input-tags/ft-input-tags.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'

export default Vue.extend({
export default defineComponent({
name: 'PlayerSettings',
components: {
'ft-settings-section': FtSettingsSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
Expand All @@ -9,7 +9,7 @@ import { mapActions } from 'vuex'
import { ipcRenderer } from 'electron'
import { IpcChannels } from '../../../constants'

export default Vue.extend({
export default defineComponent({
name: 'DownloadSettings',
components: {
'ft-settings-section': FtSettingsSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import fs from 'fs/promises'
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtPrompt from '../ft-prompt/ft-prompt.vue'
import { pathExists } from '../../helpers/filesystem'
import { getUserDataPath } from '../../helpers/utils'

export default Vue.extend({
export default defineComponent({
name: 'ExperimentalSettings',
components: {
'ft-settings-section': FtSettingsSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSelect from '../ft-select/ft-select.vue'
import FtInput from '../ft-input/ft-input.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'

export default Vue.extend({
export default defineComponent({
name: 'ExternalPlayerSettings',
components: {
'ft-settings-section': FtSettingsSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtAgeRestricted',
props: {
contentTypeString: {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-auto-grid/ft-auto-grid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtAutoGrid',
props: {
grid: {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-button/ft-button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtButton',
props: {
label: {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-card/ft-card.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtCard'
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { sanitizeForHtmlId } from '../../helpers/accessibility'

export default Vue.extend({
export default defineComponent({
name: 'FtChannelBubble',
props: {
channelName: {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-element-list/ft-element-list.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtAutoGrid from '../ft-auto-grid/ft-auto-grid.vue'
import FtListLazyWrapper from '../ft-list-lazy-wrapper/ft-list-lazy-wrapper.vue'

export default Vue.extend({
export default defineComponent({
name: 'FtElementList',
components: {
'ft-auto-grid': FtAutoGrid,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-flex-box/ft-flex-box.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtFlexBox'
})
4 changes: 2 additions & 2 deletions src/renderer/components/ft-icon-button/ft-icon-button.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { sanitizeForHtmlId } from '../../helpers/accessibility'

export default Vue.extend({
export default defineComponent({
name: 'FtIconButton',
props: {
title: {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-input-tags/ft-input-tags.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtInput from '../ft-input/ft-input.vue'
import FtTooltip from '../ft-tooltip/ft-tooltip.vue'

export default Vue.extend({
export default defineComponent({
name: 'FtInputTags',
components: {
'ft-input': FtInput,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-input/ft-input.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtTooltip from '../ft-tooltip/ft-tooltip.vue'
import { mapActions } from 'vuex'

export default Vue.extend({
export default defineComponent({
name: 'FtInput',
components: {
'ft-tooltip': FtTooltip
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-list-channel/ft-list-channel.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { youtubeImageUrlToInvidious } from '../../helpers/api/invidious'
import { formatNumber } from '../../helpers/utils'

export default Vue.extend({
export default defineComponent({
name: 'FtListChannel',
props: {
data: {
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/components/ft-list-dropdown/ft-list-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { sanitizeForHtmlId, handleDropdownKeyboardEvent } from '../../helpers/accessibility'
export default Vue.extend({

export default defineComponent({
name: 'FtListDropdown',
props: {
title: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtListVideo from '../ft-list-video/ft-list-video.vue'
import FtListChannel from '../ft-list-channel/ft-list-channel.vue'
import FtListPlaylist from '../ft-list-playlist/ft-list-playlist.vue'

export default Vue.extend({
export default defineComponent({
name: 'FtListLazyWrapper',
components: {
'ft-list-video': FtListVideo,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-list-playlist/ft-list-playlist.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtIconButton from '../ft-icon-button/ft-icon-button.vue'
import { mapActions } from 'vuex'

export default Vue.extend({
export default defineComponent({
name: 'FtListPlaylist',
components: {
'ft-icon-button': FtIconButton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtListVideo from '../ft-list-video/ft-list-video.vue'

export default Vue.extend({
export default defineComponent({
name: 'FtListVideoLazy',
components: {
'ft-list-video': FtListVideo
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtIconButton from '../ft-icon-button/ft-icon-button.vue'
import { mapActions } from 'vuex'
import {
Expand All @@ -11,7 +11,7 @@ import {
toDistractionFreeTitle
} from '../../helpers/utils'

export default Vue.extend({
export default defineComponent({
name: 'FtListVideo',
components: {
'ft-icon-button': FtIconButton
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-loader/ft-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtLoader',
props: {
fullscreen: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtNotificationBanner',
props: {
message: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtProfileBubble',
props: {
profileName: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'

import FtCard from '../../components/ft-card/ft-card.vue'
Expand All @@ -9,7 +9,7 @@ import FtPrompt from '../../components/ft-prompt/ft-prompt.vue'
import { showToast } from '../../helpers/utils'
import { youtubeImageUrlToInvidious } from '../../helpers/api/invidious'

export default Vue.extend({
export default defineComponent({
name: 'FtProfileChannelList',
components: {
'ft-card': FtCard,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-profile-edit/ft-profile-edit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtCard from '../../components/ft-card/ft-card.vue'
import FtPrompt from '../../components/ft-prompt/ft-prompt.vue'
Expand All @@ -9,7 +9,7 @@ import { MAIN_PROFILE_ID } from '../../../constants'
import { calculateColorLuminance, colors } from '../../helpers/colors'
import { showToast } from '../../helpers/utils'

export default Vue.extend({
export default defineComponent({
name: 'FtProfileEdit',
components: {
'ft-card': FtCard,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'

import FtCard from '../../components/ft-card/ft-card.vue'
Expand All @@ -9,7 +9,7 @@ import FtSelect from '../ft-select/ft-select.vue'
import { showToast } from '../../helpers/utils'
import { youtubeImageUrlToInvidious } from '../../helpers/api/invidious'

export default Vue.extend({
export default defineComponent({
name: 'FtProfileFilterChannelsList',
components: {
'ft-card': FtCard,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'

import FtCard from '../../components/ft-card/ft-card.vue'
import FtIconButton from '../../components/ft-icon-button/ft-icon-button.vue'
import { showToast } from '../../helpers/utils'

export default Vue.extend({
export default defineComponent({
name: 'FtProfileSelector',
components: {
'ft-card': FtCard,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-progress-bar/ft-progress-bar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtProgressBar',
computed: {
progressBarPercentage: function () {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-prompt/ft-prompt.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtCard from '../../components/ft-card/ft-card.vue'
import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
import FtButton from '../../components/ft-button/ft-button.vue'
import { sanitizeForHtmlId } from '../../helpers/accessibility'

export default Vue.extend({
export default defineComponent({
name: 'FtPrompt',
components: {
'ft-card': FtCard,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-radio-button/ft-radio-button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { defineComponent } from 'vue'

export default Vue.extend({
export default defineComponent({
name: 'FtElementList',
props: {
title: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtRadioButton from '../ft-radio-button/ft-radio-button.vue'

export default Vue.extend({
export default defineComponent({
name: 'FtSearchFilters',
components: {
'ft-flex-box': FtFlexBox,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ft-select/ft-select.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue'
import { defineComponent } from 'vue'
import FtTooltip from '../ft-tooltip/ft-tooltip.vue'
import { sanitizeForHtmlId } from '../../helpers/accessibility'

export default Vue.extend({
export default defineComponent({
name: 'FtSelect',
components: {
'ft-tooltip': FtTooltip
Expand Down
Loading

0 comments on commit 2cd8f0f

Please sign in to comment.