Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate test data for TypeScript 2.1 #406

Merged
merged 2 commits into from
Dec 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ env:
- TYPESCRIPT=typescript@1.7.5
- TYPESCRIPT=typescript@1.8.2
- TYPESCRIPT=typescript@2.0.9
- TYPESCRIPT=typescript@2.1.1
- TYPESCRIPT=typescript@2.1.4
- TYPESCRIPT=typescript@next
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.3.1

- [Rolled back re-exported const enums no longer break emit in watch mode as performance cost was too high](https://github.com/TypeStrong/ts-loader/pull/406) resolves #393

## v1.3.0

- [Introduce meaningful error when importing TypeScript from `node_modules`](https://github.com/TypeStrong/ts-loader/pull/399)
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ environment:
- TYPESCRIPT: typescript@1.7.5
- TYPESCRIPT: typescript@1.8.2
- TYPESCRIPT: typescript@2.0.9
- TYPESCRIPT: typescript@2.1.1
- TYPESCRIPT: typescript@2.1.4
- TYPESCRIPT: typescript@next
install:
- ps: Install-Product node $env:nodejs_version
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-loader",
"version": "1.3.0",
"version": "1.3.1",
"description": "TypeScript loader for webpack",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 9 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,17 @@ function getEmit(
const allDefinitionFiles = Object.keys(instance.files).filter(fp => definitionFileRegex.test(fp));
allDefinitionFiles.forEach(loader.addDependency.bind(loader));

/* - alternative approach to the below which is more correct but has a heavy performance cost
see https://github.com/TypeStrong/ts-loader/issues/393
with this approach constEnumReExportWatch test will pass; without it, not.

// Additionally make this file dependent on all imported files as well
// as any deeper recursive dependencies
let additionalDependencies = utils.collectAllDependencies(instance.dependencyGraph, filePath);
const additionalDependencies = utils.collectAllDependencies(instance.dependencyGraph, filePath);
*/

// Additionally make this file dependent on all imported files
const additionalDependencies = instance.dependencyGraph[filePath];
if (additionalDependencies) {
additionalDependencies.forEach(loader.addDependency.bind(loader));
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/comparison-tests/babel-issue92/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"jsx": "react",
"target": "es6"
}
}
3 changes: 3 additions & 0 deletions test/comparison-tests/constEnumReExportWatch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This test has been disabled as the extra correctness required for it to pass comes at the cost of too much performance loss.

https://github.com/TypeStrong/ts-loader/issues/393
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
/***/ function(module, exports) {

"use strict";
var BarEnum;
(function (BarEnum) {
BarEnum[BarEnum["Bar"] = 1] = "Bar";
})(exports.BarEnum || (exports.BarEnum = {}));
var BarEnum = exports.BarEnum;
})(BarEnum = exports.BarEnum || (exports.BarEnum = {}));
;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Asset Size Chunks Chunk Names
bundle.js 1.87 kB 0 [emitted] main
chunk {0} bundle.js (main) 310 bytes [rendered]
bundle.js 1.86 kB 0 [emitted] main
chunk {0} bundle.js (main) 302 bytes [rendered]
[0] ./.test/constEnumReExportWatch/app.ts 76 bytes {0} [built]
[1] ./.test/constEnumReExportWatch/foo.ts 77 bytes {0} [built]
[2] ./.test/constEnumReExportWatch/bar.ts 157 bytes {0} [built]
[2] ./.test/constEnumReExportWatch/bar.ts 149 bytes {0} [built]
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
/***/ function(module, exports) {

"use strict";
var BarEnum;
(function (BarEnum) {
BarEnum[BarEnum["Bar"] = 2] = "Bar";
})(exports.BarEnum || (exports.BarEnum = {}));
var BarEnum = exports.BarEnum;
})(BarEnum = exports.BarEnum || (exports.BarEnum = {}));
;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Asset Size Chunks Chunk Names
bundle.js 1.87 kB 0 [emitted] main
chunk {0} bundle.js (main) 310 bytes [rendered]
bundle.js 1.86 kB 0 [emitted] main
chunk {0} bundle.js (main) 302 bytes [rendered]
[0] ./.test/constEnumReExportWatch/app.ts 76 bytes {0}
[1] ./.test/constEnumReExportWatch/foo.ts 77 bytes {0}
[2] ./.test/constEnumReExportWatch/bar.ts 157 bytes {0} [built]
[2] ./.test/constEnumReExportWatch/bar.ts 149 bytes {0} [built]
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SyntaxError: Unexpected token (2:9)
at nextLoader (node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)
at node_modules\webpack-core\lib\NormalModuleMixin.js:292:15
at context.callback (node_modules\webpack-core\lib\NormalModuleMixin.js:148:14)
at Object.loader (dist\index.js:34:5)
at Object.loader (dist\index.js:37:5)
at WEBPACK_CORE_LOADER_EXECUTION (node_modules\webpack-core\lib\NormalModuleMixin.js:155:71)
at runSyncOrAsync (node_modules\webpack-core\lib\NormalModuleMixin.js:155:93)
at nextLoader (node_modules\webpack-core\lib\NormalModuleMixin.js:290:3)
Expand Down
2 changes: 1 addition & 1 deletion test/comparison-tests/errors/expectedOutput-2.1/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SyntaxError: Unexpected token (1:9)
at nextLoader (node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)
at node_modules\webpack-core\lib\NormalModuleMixin.js:292:15
at context.callback (node_modules\webpack-core\lib\NormalModuleMixin.js:148:14)
at Object.loader (dist\index.js:34:5)
at Object.loader (dist\index.js:37:5)
at WEBPACK_CORE_LOADER_EXECUTION (node_modules\webpack-core\lib\NormalModuleMixin.js:155:71)
at runSyncOrAsync (node_modules\webpack-core\lib\NormalModuleMixin.js:155:93)
at nextLoader (node_modules\webpack-core\lib\NormalModuleMixin.js:290:3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ chunk {0} bundle.js (main) 36 bytes [rendered]
[0] ./.test/html-webpack-plugin/app.ts 36 bytes {0} [built]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 556 kB 0
chunk {0} index.html 538 kB [rendered]
index.html 557 kB 0
chunk {0} index.html 540 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 540 bytes {0} [built]
[1] ./~/lodash/lodash.js 537 kB {0} [built]
[1] ./~/lodash/lodash.js 539 kB {0} [built]
[2] (webpack)/buildin/module.js 241 bytes {0} [built]
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ chunk {0} bundle.js (main) 22 bytes [rendered]
[0] ./.test/html-webpack-plugin/app.ts 22 bytes {0} [built]
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 556 kB 0
chunk {0} index.html 538 kB [rendered]
index.html 557 kB 0
chunk {0} index.html 540 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 540 bytes {0} [built]
[1] ./~/lodash/lodash.js 537 kB {0} [built]
[1] ./~/lodash/lodash.js 539 kB {0} [built]
[2] (webpack)/buildin/module.js 241 bytes {0} [built]
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
}
return Foo;
}());
exports.Foo = Foo;
var Bar = (function () {
function Bar() {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Asset Size Chunks Chunk Names
bundle.js 1.65 kB 0 [emitted] main
chunk {0} bundle.js (main) 247 bytes [rendered]
[0] ./.test/ignoreDiagnostics/app.ts 247 bytes {0} [built]
bundle.js 1.63 kB 0 [emitted] main
chunk {0} bundle.js (main) 228 bytes [rendered]
[0] ./.test/ignoreDiagnostics/app.ts 228 bytes {0} [built]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Asset Size Chunks Chunk Names
bundle.js 1.65 kB 0 [emitted] main
chunk {0} bundle.js (main) 247 bytes [rendered]
[0] ./.test/ignoreDiagnostics/app.ts 247 bytes {0} [built] [1 error]
bundle.js 1.63 kB 0 [emitted] main
chunk {0} bundle.js (main) 228 bytes [rendered]
[0] ./.test/ignoreDiagnostics/app.ts 228 bytes {0} [built] [1 error]

ERROR in ./.test/ignoreDiagnostics/app.ts
(9,5): error TS2322: Type '"b"' is not assignable to type 'Number'.
2 changes: 1 addition & 1 deletion test/comparison-tests/instance/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"compilerOptions": {
},
"files": [
"a.ts"
"i-dont-exist"
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Asset Size Chunks Chunk Names
bundle.js 1.75 kB 0 [emitted] main
chunk {0} bundle.js (main) 197 bytes [rendered]
[0] ./.test/simpleDependency/app.ts 51 bytes {0} [built] [1 error]
[0] ./.test/simpleDependency/app.ts 51 bytes {0} [1 error]
[1] ./.test/simpleDependency/dep.ts 70 bytes {0} [built]
[2] ./.test/simpleDependency/deeperDep.ts 76 bytes {0} [built]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Asset Size Chunks Chunk Names
bundle.js 1.75 kB 0 [emitted] main
chunk {0} bundle.js (main) 197 bytes [rendered]
[0] ./.test/simpleDependency/app.ts 51 bytes {0} [built]
[0] ./.test/simpleDependency/app.ts 51 bytes {0}
[1] ./.test/simpleDependency/dep.ts 70 bytes {0} [built]
[2] ./.test/simpleDependency/deeperDep.ts 76 bytes {0} [built]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Asset Size Chunks Chunk Names
bundle.js 1.75 kB 0 [emitted] main
chunk {0} bundle.js (main) 197 bytes [rendered]
[0] ./.test/simpleDependency/app.ts 51 bytes {0} [built] [1 error]
[0] ./.test/simpleDependency/app.ts 51 bytes {0} [1 error]
[1] ./.test/simpleDependency/dep.ts 70 bytes {0} [built]
[2] ./.test/simpleDependency/deeperDep.ts 76 bytes {0} [built]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Asset Size Chunks Chunk Names
bundle.js 1.75 kB 0 [emitted] main
chunk {0} bundle.js (main) 197 bytes [rendered]
[0] ./.test/simpleDependency/app.ts 51 bytes {0} [built]
[0] ./.test/simpleDependency/app.ts 51 bytes {0}
[1] ./.test/simpleDependency/dep.ts 70 bytes {0} [built]
[2] ./.test/simpleDependency/deeperDep.ts 76 bytes {0} [built]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

ERROR in tsconfig.json
error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017'
error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'esnext'

ERROR in tsconfig.json
error TS5024: Compiler option 'sourceMap' requires a value of type boolean.
Expand Down
8 changes: 4 additions & 4 deletions test/comparison-tests/vue/expectedOutput-2.1/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
/* 4 */
/***/ function(module, exports, __webpack_require__) {

module.exports={render:function (){var _vm=this;
return _vm._h('p', ["Hello from " + _vm._s(_vm.msg)])
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
return _h('p', ["Hello from " + _vm._s(_vm.msg)])
},staticRenderFns: []}
if (false) {
module.hot.accept()
Expand All @@ -195,8 +195,8 @@
/* 6 */
/***/ function(module, exports, __webpack_require__) {

module.exports={render:function (){var _vm=this;
return _vm._h('p', ["hallo " + _vm._s(_vm.msg)])
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
return _h('p', ["hallo " + _vm._s(_vm.msg)])
},staticRenderFns: []}
if (false) {
module.hot.accept()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
/* 4 */
/***/ function(module, exports, __webpack_require__) {

module.exports={render:function (){var _vm=this;
return _vm._h('p', ["Hello from " + _vm._s(_vm.msg)])
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
return _h('p', ["Hello from " + _vm._s(_vm.msg)])
},staticRenderFns: []}
if (false) {
module.hot.accept()
Expand All @@ -195,8 +195,8 @@
/* 6 */
/***/ function(module, exports, __webpack_require__) {

module.exports={render:function (){var _vm=this;
return _vm._h('p', ["hallo " + _vm._s(_vm.msg)])
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
return _h('p', ["hallo " + _vm._s(_vm.msg)])
},staticRenderFns: []}
if (false) {
module.hot.accept()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Asset Size Chunks Chunk Names
bundle.js 5.95 kB 0 [emitted] main
chunk {0} bundle.js (main) 4.35 kB [rendered]
bundle.js 5.99 kB 0 [emitted] main
chunk {0} bundle.js (main) 4.4 kB [rendered]
[0] ./.test/vue/index.vue 1.59 kB {0} [built]
[1] .!./~/vue-loader/lib/selector.js?type=script&index=0!./.test/vue/index.vue 355 bytes {0} [built]
[2] ./.test/vue/component.vue 1.6 kB {0} [built]
[3] .!./~/vue-loader/lib/selector.js?type=script&index=0!./.test/vue/component.vue 157 bytes {0} [built]
[4] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/component.vue 277 bytes {0} [built]
[4] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/component.vue 299 bytes {0} [built]
[5] ./.test/vue/helper.ts 100 bytes {0} [built]
[6] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/index.vue 272 bytes {0} [built]
[6] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/index.vue 294 bytes {0} [built]
8 changes: 4 additions & 4 deletions test/comparison-tests/vue/expectedOutput-2.1/output.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Asset Size Chunks Chunk Names
bundle.js 5.92 kB 0 [emitted] main
chunk {0} bundle.js (main) 4.33 kB [rendered]
bundle.js 5.97 kB 0 [emitted] main
chunk {0} bundle.js (main) 4.38 kB [rendered]
[0] ./.test/vue/index.vue 1.58 kB {0} [built]
[1] .!./~/vue-loader/lib/selector.js?type=script&index=0!./.test/vue/index.vue 355 bytes {0} [built]
[2] ./.test/vue/component.vue 1.59 kB {0} [built]
[3] .!./~/vue-loader/lib/selector.js?type=script&index=0!./.test/vue/component.vue 157 bytes {0} [built]
[4] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/component.vue 277 bytes {0} [built]
[4] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/component.vue 299 bytes {0} [built]
[5] ./.test/vue/helper.ts 100 bytes {0} [built]
[6] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/index.vue 272 bytes {0} [built]
[6] ./~/vue-loader/lib/template-compiler.js?id=[hot-module-hash]!./~/vue-loader/lib/selector.js?type=template&index=0!./.test/vue/index.vue 294 bytes {0} [built]