Commit 71ba8b1f authored by Lukas 'Eipi' Eipert's avatar Lukas 'Eipi' Eipert Committed by Miguel Rincon

Fix Performance Bar, Sentry and Jira Connect App on relative urls

parent fa597211
import '../webpack';
import setConfigs from '@gitlab/ui/dist/config'; import setConfigs from '@gitlab/ui/dist/config';
import Vue from 'vue'; import Vue from 'vue';
import { getLocation, sizeToParent } from '~/jira_connect/utils'; import { getLocation, sizeToParent } from '~/jira_connect/utils';
......
import '../webpack';
import Vue from 'vue'; import Vue from 'vue';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { numberToHumanSize } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';
......
import '../webpack';
import SentryConfig from './sentry_config'; import SentryConfig from './sentry_config';
const index = function index() { const index = function index() {
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* This is the first script loaded by webpack's runtime. It is used to manually configure * This is the first script loaded by webpack's runtime. It is used to manually configure
* config.output.publicPath to account for relative_url_root or CDN settings which cannot be * config.output.publicPath to account for relative_url_root or CDN settings which cannot be
* baked-in to our webpack bundles. * baked-in to our webpack bundles.
*
* Note: This file should be at the top of an entry point and _cannot_ be moved to
* e.g. the `window` scope, because it needs to be executed in the scope of webpack.
*/ */
if (gon && gon.webpack_public_path) { if (gon && gon.webpack_public_path) {
......
...@@ -103,6 +103,15 @@ function generateEntries() { ...@@ -103,6 +103,15 @@ function generateEntries() {
autoEntries[entry] = defaultEntries.concat(entryPaths); autoEntries[entry] = defaultEntries.concat(entryPaths);
}); });
/*
If you create manual entries, ensure that these import `app/assets/javascripts/webpack.js` right at
the top of the entry in order to ensure that the public path is correctly determined for loading
assets async. See: https://webpack.js.org/configuration/output/#outputpublicpath
Note: WebPack 5 has an 'auto' option for the public path which could allow us to remove this option
Note 2: If you are using web-workers, you might need to reset the public path, see:
https://gitlab.com/gitlab-org/gitlab/-/issues/321656
*/
const manualEntries = { const manualEntries = {
default: defaultEntries, default: defaultEntries,
sentry: './sentry/index.js', sentry: './sentry/index.js',
......
...@@ -20,7 +20,7 @@ module QA ...@@ -20,7 +20,7 @@ module QA
end end
end end
it 'shows results for the original request and AJAX requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/478', quarantine: { only: { pipeline: :main }, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/323051', type: :bug } do it 'shows results for the original request and AJAX requests', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/478' do
# Issue pages always make AJAX requests # Issue pages always make AJAX requests
Resource::Issue.fabricate_via_browser_ui! do |issue| Resource::Issue.fabricate_via_browser_ui! do |issue|
issue.title = 'Performance bar test' issue.title = 'Performance bar test'
......
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