Skip to content

Commit 2982afe

Browse files
silverwindlafriks
authored andcommitted
move jquery and jquery-migrate to npm/webpack (#9813)
Currently, this needs to be its own chunk because fomantic depends on jQuery being present. The next step is to move fomantic to webpack too after which we can combine the index,fomantic and jquery files into one. jquery-migrate is still neccessary because our ancient version of Dropzone seems to break without it. I imagine it can be removed after a Dropzone upgrade.
1 parent 0e8b27a commit 2982afe

File tree

10 files changed

+20
-244
lines changed

10 files changed

+20
-244
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
},
77
"dependencies": {
88
"fomantic-ui": "2.8.3",
9+
"jquery": "3.4.1",
10+
"jquery-migrate": "3.1.0",
911
"swagger-ui": "3.24.3",
1012
"vue-bar-graph": "1.2.0"
1113
},

public/vendor/librejs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<td><a href="https://github.com/codedance/jquery.AreYouSure/archive/1.9.0.tar.gz">jquery.areyousure-1.9.0.tar.gz</a></td>
1717
</tr>
1818
<tr>
19-
<td><a href="./plugins/jquery/jquery.min.js">jquery.min.js</a></td>
19+
<td><a href="../js/jquery.js">jQuery</a></td>
2020
<td><a href="https://jquery.org/license/">MIT</a></td>
2121
<td><a href="https://code.jquery.com/jquery-3.4.1.min.js">jquery-3.4.1.min.js</a></td>
2222
</tr>
2323
<tr>
24-
<td><a href="./plugins/jquery-migrate/jquery-migrate.min.js">jquery-migrate.min.js</a></td>
24+
<td><a href="../js/jquery.js">jQuery Migrate</a></td>
2525
<td><a href="https://jquery.org/license/">MIT</a></td>
26-
<td><a href="https://code.jquery.com/jquery-migrate-3.0.1.min.js">jquery-migrate-3.0.1.min.js</a></td>
26+
<td><a href="https://code.jquery.com/jquery-migrate-3.1.0.min.js">jquery-migrate-3.1.0.min.js</a></td>
2727
</tr>
2828
<tr>
2929
<td><a href="./plugins/fomantic/semantic.min.js">semantic.min.js</a></td>

public/vendor/plugins/jquery-migrate/jquery-migrate.min.js

Lines changed: 0 additions & 215 deletions
This file was deleted.

public/vendor/plugins/jquery/LICENSE

Lines changed: 0 additions & 18 deletions
This file was deleted.

public/vendor/plugins/jquery/jquery.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

templates/base/footer.tmpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
{{template "base/footer_content" .}}
1414

15-
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery/jquery.min.js?v=3.4.1"></script>
16-
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1"></script>
15+
<script src="{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}"></script>
1716
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js"></script>
1817
{{if .RequireSimpleMDE}}
1918
<script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js"></script>
@@ -115,8 +114,6 @@
115114
<script src="{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js"></script>
116115
<script src="{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js"></script>
117116
<script src="{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js"></script>
118-
119-
<!-- JavaScript -->
120117
<script src="{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}"></script>
121118
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
122119
{{if .EnableHeatmap}}

templates/pwa/serviceworker_js.tmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ var STATIC_CACHE = 'static-cache-v1';
22
var urlsToCache = [
33
// js
44
'{{StaticUrlPrefix}}/vendor/plugins/jquery.areyousure/jquery.are-you-sure.js',
5-
'{{StaticUrlPrefix}}/vendor/plugins/jquery/jquery.min.js?v=3.4.1',
6-
'{{StaticUrlPrefix}}/vendor/plugins/jquery-migrate/jquery-migrate.min.js?v=3.0.1',
75
'{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}',
86
'{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}',
97
'{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}',
108
'{{StaticUrlPrefix}}/js/gitgraph.js?v={{MD5 AppVer}}',
9+
'{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}',
1110
'{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js',
1211
'{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js',
1312
'{{StaticUrlPrefix}}/vendor/plugins/emojify/emojify.custom.js',

web_src/js/jquery.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import $ from 'jquery';
2+
import 'jquery-migrate';
3+
4+
$.migrateMute = true;
5+
window.$ = window.jQuery = $;

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
entry: {
99
index: ['./web_src/js/index'],
1010
swagger: ['./web_src/js/swagger'],
11+
jquery: ['./web_src/js/jquery'],
1112
},
1213
devtool: false,
1314
output: {
@@ -77,6 +78,8 @@ module.exports = {
7778
}),
7879
],
7980
performance: {
81+
maxEntrypointSize: 512000,
82+
maxAssetSize: 512000,
8083
assetFilter: (filename) => {
8184
return !filename.endsWith('.map') && filename !== 'swagger.js';
8285
}

0 commit comments

Comments
 (0)