Skip to content

Commit 8d81077

Browse files
authored
compile with 4.3 (#1330)
* compile with 4.3 * 4.2 -> 4.3 * run with 4.3.2 * fix test * update snapshots
1 parent 8d722ab commit 8d81077

File tree

1,408 files changed

+598
-11085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,408 files changed

+598
-11085
lines changed

.github/workflows/push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
matrix:
5151
node: [12, 14]
52-
ts: [3.8.3, 3.9.3, 4.0.3, 4.1.5, 4.2.4, next]
52+
ts: [3.8.3, 3.9.3, 4.0.3, 4.1.5, 4.2.4, 4.3.2, next]
5353
runs-on: ubuntu-latest
5454
steps:
5555
- uses: actions/checkout@v2
@@ -76,7 +76,7 @@ jobs:
7676
strategy:
7777
matrix:
7878
node: [12, 14]
79-
ts: [3.8.3, 3.9.3, 4.0.3, 4.1.5, 4.2.4, next]
79+
ts: [3.8.3, 3.9.3, 4.0.3, 4.1.5, 4.2.4, 4.3.2, next]
8080
runs-on: windows-latest
8181
steps:
8282
- uses: actions/checkout@v2

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"mocha": "^6.0.0",
9494
"prettier": "^2.0.5",
9595
"rimraf": "^2.6.2",
96-
"typescript": "^4.0.0",
96+
"typescript": "^4.3.2",
9797
"webpack": "^5.20.0",
9898
"webpack-cli": "^4.5.0"
9999
},

src/interfaces.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,8 @@ export interface ModuleResolutionCache
165165
moduleNameToDirectoryMap: CacheWithRedirects<PerModuleNameCache>;
166166
clear(): void;
167167
update(compilerOptions: typescript.CompilerOptions): void;
168-
getPackageJsonInfoCache?(): any;
169-
}
170-
// Until the API has been released and ts-loader is built against a version of TypeScript that contains it - see https://github.com/microsoft/TypeScript/blob/74993a2a64bb2e423b40204bb54ff749cdd4ef54/src/compiler/moduleNameResolver.ts#L458
171-
export interface TypeReferenceDirectiveResolutionCache {
172-
getOrCreateCacheForDirectory(
173-
directoryName: string,
174-
redirectedReference?: typescript.ResolvedProjectReference
175-
): Map<
176-
string,
177-
typescript.ResolvedTypeReferenceDirectiveWithFailedLookupLocations
178-
>;
179-
clear(): void;
180-
update(compilerOptions: typescript.CompilerOptions): void;
181168
}
169+
182170
export interface TSInstance {
183171
compiler: typeof typescript;
184172
compilerOptions: typescript.CompilerOptions;
@@ -187,7 +175,7 @@ export interface TSInstance {
187175
loaderOptions: LoaderOptions;
188176
rootFileNames: Set<string>;
189177
moduleResolutionCache?: ModuleResolutionCache;
190-
typeReferenceResolutionCache?: TypeReferenceDirectiveResolutionCache;
178+
typeReferenceResolutionCache?: typescript.TypeReferenceDirectiveResolutionCache;
191179
/**
192180
* a cache of all the files
193181
*/

test/comparison-tests/loaderOptionsCaching/expectedOutput-4.2/output.txt

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

test/comparison-tests/loaderOptionsCaching/expectedOutput-4.2/bundle.js renamed to test/comparison-tests/loaderOptionsCaching/expectedOutput-4.3/bundle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sub
2626
\********************************/
2727
/***/ (() => {
2828

29-
eval("const set = new Set([42]);\r\nfor (const value of set) {\r\n console.log(value);\r\n}\r\nconst string = 'Hello from es6 file';\r\nconsole.log(string);\r\n\n\n//# sourceURL=webpack:///./submodule-es6/index.ts?");
29+
eval("const set = new Set([42]);\nfor (const value of set) {\n console.log(value);\n}\nconst string = 'Hello from es6 file';\nconsole.log(string);\n\n\n//# sourceURL=webpack:///./submodule-es6/index.ts?");
3030

3131
/***/ }),
3232

@@ -36,7 +36,7 @@ eval("const set = new Set([42]);\r\nfor (const value of set) {\r\n console.lo
3636
\********************************/
3737
/***/ (() => {
3838

39-
eval("var string = 'Hello from es5 file';\r\nconsole.log(string);\r\n\n\n//# sourceURL=webpack:///./submodule-es5/index.ts?");
39+
eval("var string = 'Hello from es5 file';\nconsole.log(string);\n\n\n//# sourceURL=webpack:///./submodule-es5/index.ts?");
4040

4141
/***/ })
4242

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
asset bundle.js 5.08 KiB [emitted] (name: main)
2+
runtime modules 937 bytes 4 modules
3+
cacheable modules 248 bytes
4+
./app.ts 52 bytes [built] [code generated]
5+
./submodule-es5/index.ts 57 bytes [built] [code generated]
6+
./submodule-es6/index.ts 139 bytes [built] [code generated]
7+
webpack compiled successfully

test/comparison-tests/loaderOptionsCaching/expectedOutput-transpile-4.2/output.txt

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

test/comparison-tests/loaderOptionsCaching/expectedOutput-transpile-4.2/bundle.js renamed to test/comparison-tests/loaderOptionsCaching/expectedOutput-transpile-4.3/bundle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sub
2626
\********************************/
2727
/***/ (() => {
2828

29-
eval("const set = new Set([42]);\r\nfor (const value of set) {\r\n console.log(value);\r\n}\r\nconst string = 'Hello from es6 file';\r\nconsole.log(string);\r\n\n\n//# sourceURL=webpack:///./submodule-es6/index.ts?");
29+
eval("const set = new Set([42]);\nfor (const value of set) {\n console.log(value);\n}\nconst string = 'Hello from es6 file';\nconsole.log(string);\n\n\n//# sourceURL=webpack:///./submodule-es6/index.ts?");
3030

3131
/***/ }),
3232

@@ -36,7 +36,7 @@ eval("const set = new Set([42]);\r\nfor (const value of set) {\r\n console.lo
3636
\********************************/
3737
/***/ (() => {
3838

39-
eval("var string = 'Hello from es5 file';\r\nconsole.log(string);\r\n\n\n//# sourceURL=webpack:///./submodule-es5/index.ts?");
39+
eval("var string = 'Hello from es5 file';\nconsole.log(string);\n\n\n//# sourceURL=webpack:///./submodule-es5/index.ts?");
4040

4141
/***/ })
4242

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
asset bundle.js 5.08 KiB [emitted] (name: main)
2+
runtime modules 937 bytes 4 modules
3+
cacheable modules 248 bytes
4+
./app.ts 52 bytes [built] [code generated]
5+
./submodule-es5/index.ts 57 bytes [built] [code generated]
6+
./submodule-es6/index.ts 139 bytes [built] [code generated]
7+
webpack compiled successfully

test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-4.2/bundle.js renamed to test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-4.3/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ eval("\nexports.__esModule = true;\nvar a = __webpack_require__(/*! a */ \"./nod
2626
\*********************************/
2727
/***/ (() => {
2828

29-
eval("throw new Error(\"Module build failed (from ../../index.js):/nError: TypeScript emitted no output for /nodeModulesMeaningfulErrorWhenImportingTs/node_modules/a/index.ts. By default, ts-loader will not compile .ts files in node_modules./nYou should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option./nSee: https://github.com/Microsoft/TypeScript/issues/12358/n at makeSourceMapAndFinish (/workspaces/ts-loader/dist/index.js:53:18)/n at successLoader (/workspaces/ts-loader/dist/index.js:40:5)/n at Object.loader (/workspaces/ts-loader/dist/index.js:23:5)\");\n\n//# sourceURL=webpack:///./node_modules/a/index.ts?");
29+
eval("throw new Error(\"Module build failed (from ../../index.js):/nError: TypeScript emitted no output for /nodeModulesMeaningfulErrorWhenImportingTs/node_modules/a/index.ts. By default, ts-loader will not compile .ts files in node_modules./nYou should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option./nSee: https://github.com/Microsoft/TypeScript/issues/12358/n at makeSourceMapAndFinish (/workspaces/ts-loader/dist/index.js:52:18)/n at successLoader (/workspaces/ts-loader/dist/index.js:39:5)/n at Object.loader (/workspaces/ts-loader/dist/index.js:22:5)\");\n\n//# sourceURL=webpack:///./node_modules/a/index.ts?");
3030

3131
/***/ })
3232

test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-4.2/output.txt renamed to test/comparison-tests/nodeModulesMeaningfulErrorWhenImportingTs/expectedOutput-4.3/output.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Module build failed (from ../../index.js):
77
Error: TypeScript emitted no output for node_modules/a/index.ts. By default, ts-loader will not compile .ts files in node_modules.
88
You should not need to recompile .ts files there, but if you really want to, use the allowTsInNodeModules option.
99
See: https://github.com/Microsoft/TypeScript/issues/12358
10-
at makeSourceMapAndFinish (dist/index.js:53:18)
11-
at successLoader (dist/index.js:40:5)
12-
at Object.loader (dist/index.js:23:5)
10+
at makeSourceMapAndFinish (dist/index.js:52:18)
11+
at successLoader (dist/index.js:39:5)
12+
at Object.loader (dist/index.js:22:5)
1313
@ ./app.ts 3:8-20
1414

1515
webpack compiled with 1 error

test/comparison-tests/projectReferences/expectedOutput-4.2/lib/tsconfig.tsbuildinfo

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.d.ts","../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","./index.ts"],"fileInfos":["2dc8c927c9c162a773c6bb3cdc4f3286c23f10eedc67414028f9cb5951610f60",{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},"28ead8445f54a115ea5f778da4f4f80579fbae42ac6ccc3493626084ed335839"],"options":{"composite":true,"newLine":1,"skipLibCheck":true,"sourceMap":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[6,1,3,2,5,4]},"version":"4.3.2"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
asset bundle.js 2.6 KiB [emitted] (name: main)
2-
asset lib/tsconfig.tsbuildinfo 2.34 KiB [compared for emit]
2+
asset lib/tsconfig.tsbuildinfo 1.05 KiB [compared for emit]
33
asset lib/index.js.map 188 bytes [compared for emit]
44
asset lib/index.js 152 bytes [compared for emit]
55
asset lib/index.d.ts 84 bytes [compared for emit]

test/comparison-tests/projectReferences/expectedOutput-transpile-4.2/lib/tsconfig.tsbuildinfo

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.d.ts","../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","./index.ts"],"fileInfos":["2dc8c927c9c162a773c6bb3cdc4f3286c23f10eedc67414028f9cb5951610f60",{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},"28ead8445f54a115ea5f778da4f4f80579fbae42ac6ccc3493626084ed335839"],"options":{"composite":true,"newLine":1,"skipLibCheck":true,"sourceMap":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[6,1,3,2,5,4]},"version":"4.3.2"}

test/comparison-tests/projectReferences/expectedOutput-transpile-4.2/output.txt renamed to test/comparison-tests/projectReferences/expectedOutput-transpile-4.3/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
asset bundle.js 2.64 KiB [emitted] (name: main)
2-
asset lib/tsconfig.tsbuildinfo 2.34 KiB [compared for emit]
2+
asset lib/tsconfig.tsbuildinfo 1.05 KiB [compared for emit]
33
asset lib/index.js.map 188 bytes [compared for emit]
44
asset lib/index.js 152 bytes [compared for emit]
55
asset lib/index.d.ts 84 bytes [compared for emit]

test/comparison-tests/projectReferencesMultiple/expectedOutput-4.2/common/tsconfig.tsbuildinfo

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

0 commit comments

Comments
 (0)