Reduce initial bundle size

This commit is contained in:
syuilo 2019-05-21 03:45:07 +09:00
parent 0d3117e472
commit 3cc2049fb3
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
4 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,6 @@ import avatar from './avatar.vue';
import nav from './nav.vue'; import nav from './nav.vue';
import misskeyFlavoredMarkdown from './misskey-flavored-markdown.vue'; import misskeyFlavoredMarkdown from './misskey-flavored-markdown.vue';
import poll from './poll.vue'; import poll from './poll.vue';
import pollEditor from './poll-editor.vue';
import reactionIcon from './reaction-icon.vue'; import reactionIcon from './reaction-icon.vue';
import reactionsViewer from './reactions-viewer.vue'; import reactionsViewer from './reactions-viewer.vue';
import time from './time.vue'; import time from './time.vue';
@ -70,7 +69,6 @@ Vue.component('mk-acct', acct);
Vue.component('mk-avatar', avatar); Vue.component('mk-avatar', avatar);
Vue.component('mk-nav', nav); Vue.component('mk-nav', nav);
Vue.component('mk-poll', poll); Vue.component('mk-poll', poll);
Vue.component('mk-poll-editor', pollEditor);
Vue.component('mk-reaction-icon', reactionIcon); Vue.component('mk-reaction-icon', reactionIcon);
Vue.component('mk-reactions-viewer', reactionsViewer); Vue.component('mk-reactions-viewer', reactionsViewer);
Vue.component('mk-time', time); Vue.component('mk-time', time);

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mk-poll-editor"> <div class="zmdxowus">
<p class="caution" v-if="choices.length < 2"> <p class="caution" v-if="choices.length < 2">
<fa icon="exclamation-triangle"/>{{ $t('no-only-one-choice') }} <fa icon="exclamation-triangle"/>{{ $t('no-only-one-choice') }}
</p> </p>
@ -134,7 +134,7 @@ export default Vue.extend({
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.mk-poll-editor .zmdxowus
padding 8px padding 8px
> .caution > .caution

View File

@ -28,7 +28,7 @@
<fa :icon="['far', 'laugh']"/> <fa :icon="['far', 'laugh']"/>
</button> </button>
<x-post-form-attaches class="files" :class="{ with: poll }" :files="files"/> <x-post-form-attaches class="files" :class="{ with: poll }" :files="files"/>
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/> <x-poll-editor class="poll-editor" v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/>
</div> </div>
</div> </div>
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/> <mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
@ -72,7 +72,8 @@ export default Vue.extend({
components: { components: {
MkVisibilityChooser, MkVisibilityChooser,
XPostFormAttaches XPostFormAttaches,
XPollEditor: () => import('../../../common/views/components/poll-editor.vue').then(m => m.default)
}, },
props: { props: {
@ -617,7 +618,7 @@ export default Vue.extend({
border-bottom solid 1px var(--primaryAlpha01) !important border-bottom solid 1px var(--primaryAlpha01) !important
border-radius 0 border-radius 0
> .mk-poll-editor > .poll-editor
background var(--desktopPostFormTextareaBg) background var(--desktopPostFormTextareaBg)
border solid 1px var(--primaryAlpha01) border solid 1px var(--primaryAlpha01)
border-top none border-top none

View File

@ -22,7 +22,7 @@
<input v-show="useCw" ref="cw" v-model="cw" :placeholder="$t('annotations')" v-autocomplete="{ model: 'cw' }"> <input v-show="useCw" ref="cw" v-model="cw" :placeholder="$t('annotations')" v-autocomplete="{ model: 'cw' }">
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="placeholder" v-autocomplete="{ model: 'text' }"></textarea> <textarea v-model="text" ref="text" :disabled="posting" :placeholder="placeholder" v-autocomplete="{ model: 'text' }"></textarea>
<x-post-form-attaches class="attaches" :files="files"/> <x-post-form-attaches class="attaches" :files="files"/>
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/> <x-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/>
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/> <mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
<footer> <footer>
<button class="upload" @click="chooseFile"><fa icon="upload"/></button> <button class="upload" @click="chooseFile"><fa icon="upload"/></button>
@ -64,7 +64,8 @@ import XPostFormAttaches from '../../../common/views/components/post-form-attach
export default Vue.extend({ export default Vue.extend({
i18n: i18n('mobile/views/components/post-form.vue'), i18n: i18n('mobile/views/components/post-form.vue'),
components: { components: {
XPostFormAttaches XPostFormAttaches,
XPollEditor: () => import('../../../common/views/components/poll-editor.vue').then(m => m.default)
}, },
props: { props: {