Commit 31697d17 authored by Phil Hughes's avatar Phil Hughes

Merge branch '297252-ci-editor-syntax-validation-worker-staging' into 'master'

Fix worker paths in Pipeline Editor

See merge request gitlab-org/gitlab!54320
parents 02d31976 338f3d73
import { joinPaths } from '~/lib/utils/url_utility'; import { joinPaths } from '~/lib/utils/url_utility';
// tell webpack to load assets from origin so that web workers don't break /**
* Tell webpack to load assets from origin so that web workers don't break
* See https://gitlab.com/gitlab-org/gitlab/-/issues/321656 for a fix
*/
export function resetServiceWorkersPublicPath() { export function resetServiceWorkersPublicPath() {
// __webpack_public_path__ is a global variable that can be used to adjust // __webpack_public_path__ is a global variable that can be used to adjust
// the webpack publicPath setting at runtime. // the webpack publicPath setting at runtime.
......
...@@ -2,12 +2,17 @@ import Vue from 'vue'; ...@@ -2,12 +2,17 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql'; import createDefaultClient from '~/lib/graphql';
import { resetServiceWorkersPublicPath } from '../lib/utils/webpack';
import { resolvers } from './graphql/resolvers'; import { resolvers } from './graphql/resolvers';
import typeDefs from './graphql/typedefs.graphql'; import typeDefs from './graphql/typedefs.graphql';
import PipelineEditorApp from './pipeline_editor_app.vue'; import PipelineEditorApp from './pipeline_editor_app.vue';
export const initPipelineEditor = (selector = '#js-pipeline-editor') => { export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
// Prevent issues loading syntax validation workers
// Fixes https://gitlab.com/gitlab-org/gitlab/-/issues/297252
// TODO Remove when https://gitlab.com/gitlab-org/gitlab/-/issues/321656 is resolved
resetServiceWorkersPublicPath();
const el = document.querySelector(selector); const el = document.querySelector(selector);
if (!el) { if (!el) {
......
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