Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
eb548e6e
Commit
eb548e6e
authored
May 03, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust IDE page loading config to ensure web workers are not loaded cross-origin
parent
b2d90ea1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
19 deletions
+20
-19
app/assets/javascripts/ide/index.js
app/assets/javascripts/ide/index.js
+9
-6
app/assets/javascripts/pages/ide/index.js
app/assets/javascripts/pages/ide/index.js
+9
-0
app/views/ide/index.html.haml
app/views/ide/index.html.haml
+0
-3
config/webpack.config.js
config/webpack.config.js
+2
-10
No files found.
app/assets/javascripts/ide/index.js
View file @
eb548e6e
...
...
@@ -4,7 +4,9 @@ import ide from './components/ide.vue';
import
store
from
'
./stores
'
;
import
router
from
'
./ide_router
'
;
function
initIde
(
el
)
{
Vue
.
use
(
Translate
);
export
function
initIde
(
el
)
{
if
(
!
el
)
return
null
;
return
new
Vue
({
...
...
@@ -26,8 +28,9 @@ function initIde(el) {
});
}
const
ideElement
=
document
.
getElementById
(
'
ide
'
);
Vue
.
use
(
Translate
);
initIde
(
ideElement
);
export
function
resetServiceWorkersPublicPath
()
{
// tell webpack to load assets from origin so that web workers don't break
const
relativeRootPath
=
(
gon
&&
gon
.
relative_url_root
)
||
''
;
const
webpackAssetPath
=
`
${
relativeRootPath
}
/assets/webpack/`
;
__webpack_public_path__
=
webpackAssetPath
;
// eslint-disable-line camelcase
}
app/assets/javascripts/pages/ide/index.js
0 → 100644
View file @
eb548e6e
import
{
initIde
,
resetServiceWorkersPublicPath
}
from
'
~/ide/index
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
ideElement
=
document
.
getElementById
(
'
ide
'
);
if
(
ideElement
)
{
resetServiceWorkersPublicPath
();
initIde
(
ideElement
);
}
});
app/views/ide/index.html.haml
View file @
eb548e6e
-
@body_class
=
'ide'
-
page_title
'IDE'
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'ide'
,
force_same_domain:
true
#ide
.ide-loading
{
data:
{
"empty-state-svg-path"
=>
image_path
(
'illustrations/multi_file_editor_empty.svg'
),
"no-changes-state-svg-path"
=>
image_path
(
'illustrations/multi-editor_no_changes_empty.svg'
),
"committed-state-svg-path"
=>
image_path
(
'illustrations/multi-editor_all_changes_committed_empty.svg'
)
}
}
...
...
config/webpack.config.js
View file @
eb548e6e
...
...
@@ -57,7 +57,6 @@ function generateEntries() {
const
manualEntries
=
{
default
:
defaultEntries
,
raven
:
'
./raven/index.js
'
,
ide
:
'
./ide/index.js
'
,
};
return
Object
.
assign
(
manualEntries
,
autoEntries
);
...
...
@@ -75,6 +74,7 @@ const config = {
publicPath
:
'
/assets/webpack/
'
,
filename
:
IS_PRODUCTION
?
'
[name].[chunkhash].bundle.js
'
:
'
[name].bundle.js
'
,
chunkFilename
:
IS_PRODUCTION
?
'
[name].[chunkhash].chunk.js
'
:
'
[name].chunk.js
'
,
globalObject
:
'
this
'
,
// allow HMR and web workers to play nice
},
optimization
:
{
...
...
@@ -129,15 +129,7 @@ const config = {
},
{
test
:
/
\_
worker
\.
js$/
,
use
:
[
{
loader
:
'
worker-loader
'
,
options
:
{
inline
:
true
,
},
},
{
loader
:
'
babel-loader
'
},
],
use
:
[
'
worker-loader
'
,
'
babel-loader
'
],
},
{
test
:
/
\.(
worker
(\.
min
)?\.
js|pdf|bmpr
)
$/
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment