Skip to content

Commit

Permalink
Get rid of LifecycleMixin
Browse files Browse the repository at this point in the history
It's poorly documented but there used to be `@hook:mounted/...` in Vue 2
already and now there is `@vue:mounted/...` let's use that instead of our
own custom lifecycle mixin
  • Loading branch information
dschmidt committed Jan 9, 2023
1 parent 829dce1 commit 9656418
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 74 deletions.
4 changes: 2 additions & 2 deletions packages/web-app-files/src/components/SideBar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
:is-header-compact="isSingleResource"
v-bind="$attrs"
data-custom-key-bindings="true"
@beforeUnmount="destroySideBar"
@mounted="focusSideBar"
@vue:beforeUnmount="destroySideBar"
@vue:mounted="focusSideBar"
@fileChanged="focusSideBar"
@selectPanel="setActiveSideBarPanel"
@close="closeSideBar"
Expand Down
4 changes: 2 additions & 2 deletions packages/web-runtime/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
@input="modal.onInput"
@checkbox-changed="modal.onCheckboxValueChanged"
@confirm-secondary="modal.onConfirmSecondary"
@mounted="focusModal"
@beforeUnmount="focusModal"
@vue:mounted="focusModal"
@vue:beforeUnmount="focusModal"
>
<template v-if="modal.customContent" #content>
<div v-html="modal.customContent"></div>
Expand Down
2 changes: 0 additions & 2 deletions packages/web-runtime/src/defaults/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Vue from 'vue'
import WebPlugin from '../plugins/web'
import Avatar from '../components/Avatar.vue'
import focusMixin from '../mixins/focusMixin'
import lifecycleMixin from '../mixins/lifecycleMixin'
import VueEvents from 'vue-events'
import VueScrollTo from 'vue-scrollto'
import VueResize from 'vue-resize'
Expand All @@ -28,7 +27,6 @@ Vue.use(AsyncComputed)
Vue.component('AvatarImage', Avatar)

Vue.mixin(focusMixin)
Vue.mixin(lifecycleMixin)

// externalize Vue - this is not the Vue instance but the class
window.Vue = Vue
Expand Down
12 changes: 0 additions & 12 deletions packages/web-runtime/src/mixins/lifecycleMixin.js

This file was deleted.

56 changes: 0 additions & 56 deletions packages/web-runtime/tests/unit/mixins/lifecycleMixin.spec.ts

This file was deleted.

0 comments on commit 9656418

Please sign in to comment.