Skip to content

Commit 0325009

Browse files
committed
feat(systemjs0.20): remove support for type-checking
1 parent 9020e5b commit 0325009

35 files changed

+1427
-3342
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ build/
55
components/
66
coverage/
77
tmp/
8+
oldsrc/
9+
oldtest/

README.md

+20-48
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ TypeScript loader for SystemJS
77

88
## Overview ##
99

10-
A plugin for [SystemJS](https://github.com/systemjs/systemjs) which enables you to ```System.import``` TypeScript files directly. The files are compiled in the browser and compilation errors written to the console.
10+
A plugin for [SystemJS](https://github.com/systemjs/systemjs) which enables you to ```System.import``` TypeScript files directly. The files are transpiled in the browser and compilation errors written to the console.
1111

12-
Starting with JSPM 0.17.0 (currently in beta) this plugin will be the officially supported mechanism for transpiling TypeScript. It provides the ability to type-check files while loading them, which is not currently possible with the built-in SystemJS TypeScript transpiler.
12+
Starting with JSPM 0.17.0 (currently in beta) this plugin will be the officially supported mechanism for transpiling TypeScript. It provides the ability to transpile TypeScript and ES2015+ files on the fly when then are loaded by SystemJS.
1313

14-
plugin-typescript uses TypeScript ^2.1.0
15-
For TypeScript 2.0.x use plugin-typescript 5.2.9
14+
For SystemJS @0.19 use plugin-typescript 5.3.3
1615
For TypeScript 1.8.1 use plugin-typescript 4.0.16
1716
For TypeScript 1.7.5 and below use plugin-typescript 2.x.x
1817

@@ -70,13 +69,11 @@ System.config({
7069
});
7170
```
7271

73-
This will tell SystemJS to transpile all modules (.js and .ts) using plugin-typescript.
74-
75-
#### Plus: for full type-checking add ```packages``` configuration ####
72+
This will tell SystemJS to transpile all modules (.js and .ts) using plugin-typescript. It is also possible to configure plugin-typescript to load specific files, using ```packages``` configuration
7673

7774
```js
7875
System.config({
79-
transpiler: "ts",
76+
transpiler: "babel",
8077
packages: {
8178
"src": {
8279
"defaultExtension": "ts",
@@ -103,56 +100,35 @@ System.config({
103100
typescriptOptions: {
104101
module: "system",
105102
noImplicitAny: true,
106-
typeCheck: true, // also accepts "strict"
107103
tsconfig: true // also accepts a path
108104
}
109105
});
110106
```
111107

112-
All the usual TypeScript compiler options are supported, as well as these additional ones:
113-
114-
#### typeCheck ####
108+
It is also possible to override the default configuration for specific files, using ```packages``` configuration:
115109

116-
A boolean flag which controls whether the files are type-checked or simply transpiled. Type-checking does add some overhead to the build process as typings need to be loaded and the compiler has more work to do.
110+
```js
111+
System.config({
112+
transpiler: "babel",
113+
packages: {
114+
"src": {
115+
"defaultExtension": "ts",
116+
"typescriptOptions": {
117+
"noImplicitAny": true
118+
}
119+
}
120+
}
121+
});
122+
```
117123

118-
By default compiler errors are written to the console but the build is allowed to continue. To change this behaviour you can use ```typeCheck: "strict"``` in which case the build will be failed when compiler errors are encountered.
124+
All the usual TypeScript compiler options are supported, as well as these additional ones:
119125

120126
#### tsconfig ####
121127

122128
A boolean flag which instructs the plugin to load configuration from "tsconfig.json". To override the location of the file set this option to the path of the configuration file, which will be resolved using normal SystemJS resolution.
123129

124130
Compiler options which do not conflict with those required by plugin-typescript will be loaded from the ```compilerOptions``` section of the file. Any declaration files contained in the ```files``` array will also be loaded if type-checking is enabled.
125131

126-
#### types ####
127-
128-
The ```types``` compiler option tells the type-checker which packages have typings available under the *@types* scoped package. As an example if you have installed typings at ```@types/react``` then add ```react``` to the array of strings:
129-
```json
130-
{
131-
"typescriptOptions": {
132-
"types": ["react"]
133-
}
134-
}
135-
```
136-
To install typings from @types using jspm:
137-
```sh
138-
jspm install npm:@types/react
139-
```
140-
141-
#### typings ####
142-
143-
The ```typings``` compiler option tells the type-checker which packages contain their own typings and where they are located, it is an object map:
144-
145-
```js
146-
"typescriptOptions": {
147-
"typings": {
148-
"rxjs": "Rx.d.ts", // relative to root of package
149-
"myownpackage": true // all js files have typings with the same name
150-
}
151-
}
152-
```
153-
154-
If a package contains typings for *all* js files in the package then the value should be set to ```true```, otherwise it should contain the path of the bundled typings file, relative to the root of the project.
155-
156132
## Features ##
157133

158134
#### Hot-Reload support ####
@@ -168,10 +144,6 @@ Rollup is supported when transpiling with ```module: "es6"```. It can help to re
168144

169145
When compiling in the browser, compiler errors contain a link to the exact location of the error in the source. This is particularly helpful if you are using Chrome DevTools as your IDE.
170146

171-
#### Type-checking over multiple packages ####
172-
173-
The type-checker runs across multiple packages if the imported file resolves to a typescript file. This means that if you do ```import "mypackage/index"``` and that resolves to a typescript file then that import will be properly type-checked. You no longer have to handcraft an external declaration file for 'mypackage'.
174-
175147
#### Override TypeScript version ####
176148

177149
To override the version of TypeScript used by the plugin, add an override to the ```jspm``` section of your package.json

0 commit comments

Comments
 (0)