Skip to content

Commit 7617044

Browse files
committed
Fix HMR and backtrack for SFC support now that PHPStorm supports them
Of course I wasted forever migrating OUT of SFCs only to go back to them.
1 parent 626a63d commit 7617044

File tree

4 files changed

+149
-17
lines changed

4 files changed

+149
-17
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"lodash": "^4.17.11",
99
"socket.io-client": "^2.1.1",
1010
"vee-validate": "^2.1.0-beta.2",
11-
"vue": "^2.5.7",
11+
"vue": "^2.6.4",
1212
"vue-axios": "^2.1.1",
1313
"vue-i18n": "^8.6.0",
1414
"vue-router": "^3.0.1",
@@ -31,6 +31,7 @@
3131
"clean-webpack-plugin": "^0.1.19",
3232
"css-loader": "^2.1.0",
3333
"cssnano": "^4.0.3",
34+
"fork-ts-checker-webpack-plugin": "^0.5.2",
3435
"glob-all": "^3.1.0",
3536
"html-webpack-plugin": "^3.2.0",
3637
"mini-css-extract-plugin": "^0.5.0",
@@ -48,8 +49,9 @@
4849
"uglifyjs-webpack-plugin": "^2.1.1",
4950
"vue-devtools": "^3.1.9",
5051
"vue-feather-icons": "^4.7.1",
52+
"vue-loader": "^15.6.2",
5153
"vue-mc": "^0.2.4",
52-
"vue-template-compiler": "^2.5.16",
54+
"vue-template-compiler": "^2.6.4",
5355
"vueify-insert-css": "^1.0.0",
5456
"webpack": "^4.29.0",
5557
"webpack-assets-manifest": "^3.1.1",

resources/assets/scripts/components/server/components/filemanager/FileRow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default Vue.component('file-row', {
5050

5151
this.contextMenuVisible = true;
5252

53-
const menuWidth = (this.$refs.contextMenu as VueType).$el.offsetWidth;
53+
const menuWidth = (this.$refs.contextMenu as VueType).$el.clientWidth;
5454
const positionElement = e.clientX - Math.round(menuWidth / 2);
5555

5656
(this.$refs.contextMenu as VueType).$el.setAttribute('style', `left: ${positionElement}; top: ${e.clientY}`);

webpack.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
99
const ShellPlugin = require('webpack-shell-plugin');
1010
const PurgeCssPlugin = require('purgecss-webpack-plugin');
1111
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
12+
const VueLoaderPlugin = require('vue-loader/lib/plugin');
13+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
1214

1315
const isProduction = process.env.NODE_ENV === 'production';
1416

@@ -27,6 +29,10 @@ let plugins = [
2729
integrity: true,
2830
integrityHashes: ['sha384'],
2931
}),
32+
new VueLoaderPlugin(),
33+
new ForkTsCheckerWebpackPlugin({
34+
vue: true,
35+
}),
3036
];
3137

3238
if (isProduction) {
@@ -72,6 +78,7 @@ const typescriptLoaders = [
7278
options: {
7379
appendTsSuffixTo: [/\.vue$/],
7480
experimentalWatchApi: true,
81+
transpileOnly: true,
7582
}
7683
}
7784
];
@@ -133,6 +140,10 @@ module.exports = {
133140
],
134141
},
135142
},
143+
{
144+
test: /\.vue$/,
145+
use: 'vue-loader',
146+
},
136147
{
137148
test: /\.ts$/,
138149
exclude: /node_modules/,

yarn.lock

Lines changed: 133 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,20 @@
725725
version "1.13.6"
726726
resolved "http://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.13.6.tgz#128d1685a7c34d31ed17010fc87d6a12c1de6976"
727727

728+
"@vue/component-compiler-utils@^2.5.1":
729+
version "2.5.2"
730+
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.5.2.tgz#a8d57e773354ab10e4742c7d6a8dd86184d4d7be"
731+
dependencies:
732+
consolidate "^0.15.1"
733+
hash-sum "^1.0.2"
734+
lru-cache "^4.1.2"
735+
merge-source-map "^1.1.0"
736+
postcss "^7.0.14"
737+
postcss-selector-parser "^5.0.0"
738+
prettier "1.16.3"
739+
source-map "~0.6.1"
740+
vue-template-es2015-compiler "^1.8.2"
741+
728742
"@webassemblyjs/ast@1.5.9":
729743
version "1.5.9"
730744
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.5.9.tgz#b2770182678691ab4949d593105c15d4074fedb6"
@@ -1200,7 +1214,7 @@ assign-symbols@^1.0.0:
12001214
version "1.0.0"
12011215
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
12021216

1203-
async-each@^1.0.0:
1217+
async-each@^1.0.0, async-each@^1.0.1:
12041218
version "1.0.1"
12051219
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
12061220

@@ -1247,6 +1261,14 @@ axios@^0.18.0:
12471261
follow-redirects "^1.3.0"
12481262
is-buffer "^1.1.5"
12491263

1264+
babel-code-frame@^6.22.0:
1265+
version "6.26.0"
1266+
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
1267+
dependencies:
1268+
chalk "^1.1.3"
1269+
esutils "^2.0.2"
1270+
js-tokens "^3.0.2"
1271+
12501272
babel-eslint@^8.2.3:
12511273
version "8.2.3"
12521274
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf"
@@ -1361,14 +1383,14 @@ blob@0.0.4:
13611383
version "0.0.4"
13621384
resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921"
13631385

1386+
bluebird@^3.1.1, bluebird@^3.5.3:
1387+
version "3.5.3"
1388+
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7"
1389+
13641390
bluebird@^3.5.1:
13651391
version "3.5.1"
13661392
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
13671393

1368-
bluebird@^3.5.3:
1369-
version "3.5.3"
1370-
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7"
1371-
13721394
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
13731395
version "4.11.8"
13741396
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
@@ -1410,7 +1432,7 @@ brace-expansion@^1.1.7:
14101432
balanced-match "^1.0.0"
14111433
concat-map "0.0.1"
14121434

1413-
braces@^2.3.0, braces@^2.3.1:
1435+
braces@^2.3.0, braces@^2.3.1, braces@^2.3.2:
14141436
version "2.3.2"
14151437
resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
14161438
dependencies:
@@ -1713,6 +1735,24 @@ chokidar@^2.0.2:
17131735
optionalDependencies:
17141736
fsevents "^1.1.2"
17151737

1738+
chokidar@^2.0.4:
1739+
version "2.1.0"
1740+
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.0.tgz#5fcb70d0b28ebe0867eb0f09d5f6a08f29a1efa0"
1741+
dependencies:
1742+
anymatch "^2.0.0"
1743+
async-each "^1.0.1"
1744+
braces "^2.3.2"
1745+
glob-parent "^3.1.0"
1746+
inherits "^2.0.3"
1747+
is-binary-path "^1.0.0"
1748+
is-glob "^4.0.0"
1749+
normalize-path "^3.0.0"
1750+
path-is-absolute "^1.0.0"
1751+
readdirp "^2.2.1"
1752+
upath "^1.1.0"
1753+
optionalDependencies:
1754+
fsevents "^1.2.7"
1755+
17161756
chownr@^1.0.1:
17171757
version "1.0.1"
17181758
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181"
@@ -1979,6 +2019,12 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0:
19792019
version "1.1.0"
19802020
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
19812021

2022+
consolidate@^0.15.1:
2023+
version "0.15.1"
2024+
resolved "https://registry.yarnpkg.com/consolidate/-/consolidate-0.15.1.tgz#21ab043235c71a07d45d9aad98593b0dba56bab7"
2025+
dependencies:
2026+
bluebird "^3.1.1"
2027+
19822028
constants-browserify@^1.0.0:
19832029
version "1.0.0"
19842030
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
@@ -3030,6 +3076,17 @@ foreach@^2.0.5:
30303076
version "2.0.5"
30313077
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
30323078

3079+
fork-ts-checker-webpack-plugin@^0.5.2:
3080+
version "0.5.2"
3081+
resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-0.5.2.tgz#a73b3630bd0a69409a6e4824e54c03a62fe82d8f"
3082+
dependencies:
3083+
babel-code-frame "^6.22.0"
3084+
chalk "^2.4.1"
3085+
chokidar "^2.0.4"
3086+
micromatch "^3.1.10"
3087+
minimatch "^3.0.4"
3088+
tapable "^1.0.0"
3089+
30333090
forwarded@~0.1.2:
30343091
version "0.1.2"
30353092
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
@@ -3099,7 +3156,7 @@ fsevents@^1.1.2:
30993156
nan "^2.9.2"
31003157
node-pre-gyp "^0.10.0"
31013158

3102-
fsevents@^1.2.2:
3159+
fsevents@^1.2.2, fsevents@^1.2.7:
31033160
version "1.2.7"
31043161
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4"
31053162
dependencies:
@@ -3289,6 +3346,10 @@ hash-base@^3.0.0:
32893346
inherits "^2.0.1"
32903347
safe-buffer "^5.0.1"
32913348

3349+
hash-sum@^1.0.2:
3350+
version "1.0.2"
3351+
resolved "https://registry.yarnpkg.com/hash-sum/-/hash-sum-1.0.2.tgz#33b40777754c6432573c120cc3808bbd10d47f04"
3352+
32923353
hash.js@^1.0.0, hash.js@^1.0.3:
32933354
version "1.1.3"
32943355
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846"
@@ -3805,7 +3866,7 @@ js-levenshtein@^1.1.3:
38053866
version "1.1.6"
38063867
resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d"
38073868

3808-
js-tokens@^3.0.0:
3869+
js-tokens@^3.0.0, js-tokens@^3.0.2:
38093870
version "3.0.2"
38103871
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
38113872

@@ -4141,6 +4202,13 @@ lru-cache@^4.0.1, lru-cache@^4.1.1:
41414202
pseudomap "^1.0.2"
41424203
yallist "^2.1.2"
41434204

4205+
lru-cache@^4.1.2:
4206+
version "4.1.5"
4207+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
4208+
dependencies:
4209+
pseudomap "^1.0.2"
4210+
yallist "^2.1.2"
4211+
41444212
lru-cache@^5.1.1:
41454213
version "5.1.1"
41464214
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
@@ -4213,11 +4281,17 @@ merge-descriptors@1.0.1:
42134281
version "1.0.1"
42144282
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
42154283

4284+
merge-source-map@^1.1.0:
4285+
version "1.1.0"
4286+
resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646"
4287+
dependencies:
4288+
source-map "^0.6.1"
4289+
42164290
methods@~1.1.2:
42174291
version "1.1.2"
42184292
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
42194293

4220-
micromatch@^3.1.4, micromatch@^3.1.8, micromatch@^3.1.9:
4294+
micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8, micromatch@^3.1.9:
42214295
version "3.1.10"
42224296
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
42234297
dependencies:
@@ -4530,6 +4604,10 @@ normalize-path@^2.1.1:
45304604
dependencies:
45314605
remove-trailing-separator "^1.0.1"
45324606

4607+
normalize-path@^3.0.0:
4608+
version "3.0.0"
4609+
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
4610+
45334611
normalize-range@^0.1.2:
45344612
version "0.1.2"
45354613
resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
@@ -5539,6 +5617,10 @@ precss@^3.1.2:
55395617
postcss-preset-env "^3.2.2"
55405618
postcss-property-lookup "^2.0.0"
55415619

5620+
prettier@1.16.3:
5621+
version "1.16.3"
5622+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.3.tgz#8c62168453badef702f34b45b6ee899574a6a65d"
5623+
55425624
pretty-error@^2.0.2:
55435625
version "2.1.1"
55445626
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
@@ -5762,6 +5844,14 @@ readdirp@^2.0.0:
57625844
readable-stream "^2.0.2"
57635845
set-immediate-shim "^1.0.1"
57645846

5847+
readdirp@^2.2.1:
5848+
version "2.2.1"
5849+
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525"
5850+
dependencies:
5851+
graceful-fs "^4.1.11"
5852+
micromatch "^3.1.10"
5853+
readable-stream "^2.0.2"
5854+
57655855
reduce-css-calc@^2.0.0:
57665856
version "2.1.4"
57675857
resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-2.1.4.tgz#c20e9cda8445ad73d4ff4bea960c6f8353791708"
@@ -6876,7 +6966,7 @@ unset-value@^1.0.0:
68766966
has-value "^0.3.1"
68776967
isobject "^3.0.0"
68786968

6879-
upath@^1.0.0, upath@^1.0.5:
6969+
upath@^1.0.0, upath@^1.0.5, upath@^1.1.0:
68806970
version "1.1.0"
68816971
resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd"
68826972

@@ -7011,10 +7101,24 @@ vue-feather-icons@^4.7.1:
70117101
dependencies:
70127102
babel-helper-vue-jsx-merge-props "^2.0.2"
70137103

7104+
vue-hot-reload-api@^2.3.0:
7105+
version "2.3.1"
7106+
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz#b2d3d95402a811602380783ea4f566eb875569a2"
7107+
70147108
vue-i18n@^8.6.0:
70157109
version "8.6.0"
70167110
resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-8.6.0.tgz#63848b183cf6f100436bcdd84382416e43b07188"
70177111

7112+
vue-loader@^15.6.2:
7113+
version "15.6.2"
7114+
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.6.2.tgz#892741d96260936ff69e892f72ec361ba4d100d2"
7115+
dependencies:
7116+
"@vue/component-compiler-utils" "^2.5.1"
7117+
hash-sum "^1.0.2"
7118+
loader-utils "^1.1.0"
7119+
vue-hot-reload-api "^2.3.0"
7120+
vue-style-loader "^4.1.0"
7121+
70187122
vue-mc@^0.2.4:
70197123
version "0.2.4"
70207124
resolved "https://registry.yarnpkg.com/vue-mc/-/vue-mc-0.2.4.tgz#93569cb6e08e2d1c52968a74cce8a6b2c9bda66a"
@@ -7029,17 +7133,32 @@ vue-router@^3.0.1:
70297133
version "3.0.1"
70307134
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.1.tgz#d9b05ad9c7420ba0f626d6500d693e60092cc1e9"
70317135

7032-
vue-template-compiler@^2.5.16:
7033-
version "2.5.16"
7034-
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.16.tgz#93b48570e56c720cdf3f051cc15287c26fbd04cb"
7136+
vue-style-loader@^4.1.0:
7137+
version "4.1.2"
7138+
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"
7139+
dependencies:
7140+
hash-sum "^1.0.2"
7141+
loader-utils "^1.0.2"
7142+
7143+
vue-template-compiler@^2.6.4:
7144+
version "2.6.4"
7145+
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.4.tgz#0feacfe35e3386033bf4fe31ab4ff1dc1a0c5dec"
70357146
dependencies:
70367147
de-indent "^1.0.2"
70377148
he "^1.1.0"
70387149

7039-
vue@^2.2, vue@^2.5.7:
7150+
vue-template-es2015-compiler@^1.8.2:
7151+
version "1.8.2"
7152+
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.8.2.tgz#dd73e80ba58bb65dd7a8aa2aeef6089cf6116f2a"
7153+
7154+
vue@^2.2:
70407155
version "2.5.16"
70417156
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.16.tgz#07edb75e8412aaeed871ebafa99f4672584a0085"
70427157

7158+
vue@^2.6.4:
7159+
version "2.6.4"
7160+
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.4.tgz#8a5a44e5740d8b8423a420c8655c97663421fb4d"
7161+
70437162
vueify-insert-css@^1.0.0:
70447163
version "1.0.0"
70457164
resolved "https://registry.yarnpkg.com/vueify-insert-css/-/vueify-insert-css-1.0.0.tgz#57e5d791907e8c9d87ae6de099a2174bd0a7f990"

0 commit comments

Comments
 (0)