summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-01-24 10:17:15 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-01-24 10:17:15 +0000
commit47f6dbdf47ced926700dec8e138ed16b59a1c40a (patch)
tree4287b0aa53a709202ec31d8c88cb02054a5727c3
parent0f5f77a04c75fa246460e978919344ee8d8f5377 (diff)
parente22c007f5093af53086284c8bd59ad7c949c6da1 (diff)
downloadgitlab-ce-47f6dbdf47ced926700dec8e138ed16b59a1c40a.tar.gz
Merge branch 'ph-even-more-dispatcher-imports' into 'master'
Added imports for dispatcher routes See merge request gitlab-org/gitlab-ce!16640
-rw-r--r--app/assets/javascripts/dispatcher.js20
-rw-r--r--app/assets/javascripts/pages/projects/show/index.js4
-rw-r--r--app/assets/javascripts/pages/projects/snippets/show/index.js4
-rw-r--r--app/views/layouts/_head.html.haml1
-rw-r--r--config/webpack.config.js5
5 files changed, 13 insertions, 21 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index d5659be28a4..f9e23189774 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -1,13 +1,8 @@
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */
-import notificationsDropdown from './notifications_dropdown';
-import LineHighlighter from './line_highlighter';
import MergeRequest from './merge_request';
import Flash from './flash';
-import BlobViewer from './blob/viewer/index';
import GfmAutoComplete from './gfm_auto_complete';
-import Star from './star';
import ZenMode from './zen_mode';
-import PerformanceBar from './performance_bar';
import initNotes from './init_notes';
import initIssuableSidebar from './init_issuable_sidebar';
import { convertPermissionToBoolean } from './lib/utils/common_utils';
@@ -621,23 +616,12 @@ import SearchAutocomplete from './search_autocomplete';
.then(callDefault)
.catch(fail);
break;
- case 'show':
- new Star();
- notificationsDropdown();
- break;
case 'wikis':
import('./pages/projects/wikis')
.then(callDefault)
.catch(fail);
shortcut_handler = true;
break;
- case 'snippets':
- if (path[2] === 'show') {
- new ZenMode();
- new LineHighlighter();
- new BlobViewer();
- }
- break;
}
break;
}
@@ -647,7 +631,9 @@ import SearchAutocomplete from './search_autocomplete';
}
if (document.querySelector('#peek')) {
- new PerformanceBar({ container: '#peek' });
+ import('./performance_bar')
+ .then(m => new m.default({ container: '#peek' })) // eslint-disable-line new-cap
+ .catch(fail);
}
};
diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js
index 92dc1e59651..55154cdddcb 100644
--- a/app/assets/javascripts/pages/projects/show/index.js
+++ b/app/assets/javascripts/pages/projects/show/index.js
@@ -5,8 +5,12 @@ import TreeView from '~/tree';
import BlobViewer from '~/blob/viewer/index';
import Activities from '~/activities';
import { ajaxGet } from '~/lib/utils/common_utils';
+import Star from '../../../star';
+import notificationsDropdown from '../../../notifications_dropdown';
export default () => {
+ new Star(); // eslint-disable-line no-new
+ notificationsDropdown();
new ShortcutsNavigation(); // eslint-disable-line no-new
new NotificationsForm(); // eslint-disable-line no-new
new UserCallout({ // eslint-disable-line no-new
diff --git a/app/assets/javascripts/pages/projects/snippets/show/index.js b/app/assets/javascripts/pages/projects/snippets/show/index.js
index d8cf5184f8f..a3cf75c385b 100644
--- a/app/assets/javascripts/pages/projects/snippets/show/index.js
+++ b/app/assets/javascripts/pages/projects/snippets/show/index.js
@@ -1,7 +1,11 @@
import initNotes from '~/init_notes';
import ZenMode from '~/zen_mode';
+import LineHighlighter from '../../../../line_highlighter';
+import BlobViewer from '../../../../blob/viewer';
export default function () {
+ new LineHighlighter(); // eslint-disable-line no-new
+ new BlobViewer(); // eslint-disable-line no-new
initNotes();
new ZenMode(); // eslint-disable-line no-new
}
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 1597621fa78..ea13a5e6d62 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -43,7 +43,6 @@
= webpack_bundle_tag "main"
= webpack_bundle_tag "raven" if current_application_settings.clientside_sentry_enabled
= webpack_bundle_tag "test" if Rails.env.test?
- = webpack_bundle_tag 'performance_bar' if performance_bar_enabled?
- if content_for?(:page_specific_javascripts)
= yield :page_specific_javascripts
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 229db11acb2..26502efaf6c 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -85,7 +85,6 @@ var config = {
test: './test.js',
two_factor_auth: './two_factor_auth.js',
users: './users/index.js',
- performance_bar: './performance_bar.js',
webpack_runtime: './webpack.js',
},
@@ -119,9 +118,9 @@ var config = {
{
test: /\_worker\.js$/,
use: [
- {
+ {
loader: 'worker-loader',
- options: {
+ options: {
inline: true
}
},