Skip to content

Commit 7128f1e

Browse files
committed
refactor(tsc): deprecate hooks api (#3793)
1 parent 9f54a24 commit 7128f1e

File tree

14 files changed

+55
-706
lines changed

14 files changed

+55
-706
lines changed

packages/language-core/schemas/vue-tsconfig.deprecated.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
"experimentalRfc436": {
5858
"deprecated": true
5959
},
60+
"hooks": {
61+
"deprecated": true,
62+
"type": "array",
63+
"description": "Deprecated since v2.0.0.",
64+
"markdownDescription": "https://github.com/vuejs/language-tools/pull/2217"
65+
},
6066
"narrowingTypesInInlineHandlers": {
6167
"deprecated": true
6268
},

packages/language-core/schemas/vue-tsconfig.schema.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@
6161
"default": [ ],
6262
"markdownDescription": "Plugins to be used in the SFC compiler."
6363
},
64-
"hooks": {
65-
"type": "array",
66-
"markdownDescription": "https://github.com/vuejs/language-tools/pull/2217"
67-
},
6864
"optionsWrapper": {
6965
"type": "array",
7066
"default": [

packages/language-core/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export interface VueCompilerOptions {
4949
withDefaults: string[];
5050
};
5151
plugins: VueLanguagePlugin[];
52-
hooks: string[];
5352

5453
// experimental
5554
experimentalDefinePropProposal: 'kevinEdition' | 'johnsonEdition' | false;

packages/language-core/src/utils/ts.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ function getPartialVueCompilerOptions(
178178

179179
result.plugins = plugins;
180180
}
181-
if (rawOptions.hooks) {
182-
result.hooks = rawOptions.hooks
183-
.map(resolvePath)
184-
.filter((hook): hook is NonNullable<typeof hook> => !!hook);
185-
}
186181
if (rawOptions.experimentalAdditionalLanguageModules) {
187182
result.experimentalAdditionalLanguageModules = rawOptions.experimentalAdditionalLanguageModules
188183
.map(resolvePath)
@@ -268,7 +263,6 @@ export function resolveVueCompilerOptions(vueOptions: Partial<VueCompilerOptions
268263
...vueOptions.macros,
269264
},
270265
plugins: vueOptions.plugins ?? [],
271-
hooks: vueOptions.hooks ?? [],
272266

273267
// experimental
274268
experimentalDefinePropProposal: vueOptions.experimentalDefinePropProposal ?? false,

packages/tsc-eslint-hook/LICENSE

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

packages/tsc-eslint-hook/README.md

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

packages/tsc-eslint-hook/package.json

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

packages/tsc-eslint-hook/src/index.ts

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

packages/tsc-eslint-hook/tsconfig.json

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

packages/tsc/bin/vue-tsc.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const tsPkg = require('typescript/package.json');
55
const readFileSync = fs.readFileSync;
66
const tscPath = require.resolve('typescript/lib/tsc');
77
const proxyApiPath = require.resolve('../out/index');
8-
const { state } = require('../out/shared');
98

109
fs.readFileSync = (...args) => {
1110
if (args[0] === tscPath) {
@@ -56,16 +55,4 @@ fs.readFileSync = (...args) => {
5655
return readFileSync(...args);
5756
};
5857

59-
(function main() {
60-
try {
61-
require(tscPath);
62-
}
63-
catch (err) {
64-
if (err === 'hook') {
65-
state.hook.worker.then(main);
66-
}
67-
else {
68-
throw err;
69-
}
70-
}
71-
})();
58+
require(tscPath);

0 commit comments

Comments
 (0)