Commit 020da23b authored by Paul Slaughter's avatar Paul Slaughter

Revert async loading components in ide.vue

- This causes timeouts in Jest because the compilation
happens at runtime. Also the loadDeferred state is the
most significant performance boost here.
parent 08bfc7fc
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { import {
WEBIDE_MARK_APP_START, WEBIDE_MARK_APP_START,
...@@ -9,10 +10,17 @@ import { ...@@ -9,10 +10,17 @@ import {
WEBIDE_MEASURE_BEFORE_VUE, WEBIDE_MEASURE_BEFORE_VUE,
} from '~/performance/constants'; } from '~/performance/constants';
import { performanceMarkAndMeasure } from '~/performance/utils'; import { performanceMarkAndMeasure } from '~/performance/utils';
import FindFile from '~/vue_shared/components/file_finder/index.vue';
import { modalTypes } from '../constants'; import { modalTypes } from '../constants';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
import IdeSidebar from './ide_side_bar.vue'; import IdeSidebar from './ide_side_bar.vue';
import RepoEditor from './repo_editor.vue'; import RepoEditor from './repo_editor.vue';
import ErrorMessage from './error_message.vue';
import CommitEditorHeader from './commit_sidebar/editor_header.vue';
import RepoTabs from './repo_tabs.vue';
import IdeStatusBar from './ide_status_bar.vue';
import RightPane from './panes/right.vue';
import NewModal from './new_dropdown/modal.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { measurePerformance } from '../utils'; import { measurePerformance } from '../utils';
...@@ -29,15 +37,15 @@ export default { ...@@ -29,15 +37,15 @@ export default {
components: { components: {
IdeSidebar, IdeSidebar,
RepoEditor, RepoEditor,
'error-message': () => import('./error_message.vue'), ErrorMessage,
'gl-button': () => import('@gitlab/ui/src/components/base/button/button.vue'), GlButton,
'gl-loading-icon': () => import('@gitlab/ui/src/components/base/loading_icon/loading_icon.vue'), GlLoadingIcon,
'commit-editor-header': () => import('./commit_sidebar/editor_header.vue'), CommitEditorHeader,
'repo-tabs': () => import('./repo_tabs.vue'), RepoTabs,
'ide-status-bar': () => import('./ide_status_bar.vue'), IdeStatusBar,
'find-file': () => import('~/vue_shared/components/file_finder/index.vue'), FindFile,
'right-pane': () => import('./panes/right.vue'), RightPane,
'new-modal': () => import('./new_dropdown/modal.vue'), NewModal,
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
data() { data() {
......
...@@ -14,7 +14,7 @@ describe('WebIDE', () => { ...@@ -14,7 +14,7 @@ describe('WebIDE', () => {
let wrapper; let wrapper;
function createComponent({ projData = emptyProjData, state = {}, mockStubs = {} } = {}) { function createComponent({ projData = emptyProjData, state = {} } = {}) {
const store = createStore(); const store = createStore();
store.state.currentProjectId = 'abcproject'; store.state.currentProjectId = 'abcproject';
...@@ -31,7 +31,6 @@ describe('WebIDE', () => { ...@@ -31,7 +31,6 @@ describe('WebIDE', () => {
return shallowMount(ide, { return shallowMount(ide, {
store, store,
localVue, localVue,
stubs: mockStubs,
}); });
} }
...@@ -61,9 +60,6 @@ describe('WebIDE', () => { ...@@ -61,9 +60,6 @@ describe('WebIDE', () => {
state: { state: {
errorMessage: null, errorMessage: null,
}, },
mockStubs: {
ErrorMessage,
},
}); });
expect(wrapper.find(ErrorMessage).exists()).toBe(false); expect(wrapper.find(ErrorMessage).exists()).toBe(false);
...@@ -76,9 +72,6 @@ describe('WebIDE', () => { ...@@ -76,9 +72,6 @@ describe('WebIDE', () => {
text: 'error', text: 'error',
}, },
}, },
mockStubs: {
ErrorMessage,
},
}); });
expect(wrapper.find(ErrorMessage).exists()).toBe(true); expect(wrapper.find(ErrorMessage).exists()).toBe(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment