Skip to content

Commit 157aa02

Browse files
committed
feat: drop support for webpack 1 and 3
We drop support for webpack < 4.0 to simplify our codebase and prepare for further refactoring. BREAKING CHANGE: 🧨 Dropped support for webpack 2.0 and webpack 3.0
1 parent a7dd2a2 commit 157aa02

File tree

12 files changed

+241
-2649
lines changed

12 files changed

+241
-2649
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ jobs:
5050
packages:
5151
- webpack@5.0.0-alpha.5 ts-loader@^5.0.0 vue-loader@^15.2.4
5252
- webpack@^4.0.0 ts-loader@^5.0.0 vue-loader@^15.2.4
53-
- webpack@^3.10.0 ts-loader@^3.4.0 vue-loader@^13.5.0
54-
- webpack@^2.7.0 ts-loader@^3.4.0 vue-loader@^13.5.0
5553

5654
steps:
5755
- uses: actions/checkout@v1
@@ -117,11 +115,14 @@ jobs:
117115
118116
- name: Install dependencies
119117
run: yarn install --frozen-lockfile
118+
119+
- name: Install semantic-release
120+
run: yarn global add semantic-release@16.0.0-beta.18
120121

121122
- name: Download build artifact
122123
uses: actions/download-artifact@v1
123124
with:
124125
name: lib
125126

126127
- name: Release
127-
run: yarn exec semantic-release
128+
run: semantic-release

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
## Installation
1717

18-
This plugin requires minimum **webpack 2.3**, **TypeScript 2.1** and optionally **ESLint 6.0.0** or **TSLint 4.0**
18+
This plugin requires minimum **webpack 4.0**, **TypeScript 2.1** and optionally **ESLint 6.0.0** or **TSLint 4.0**
19+
20+
If you depend on **webpack 2.0** or **webpack 3.0**, please use [older version](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v3.1.1) of the plugin.
1921

2022
```sh
2123
# with npm
@@ -273,26 +275,21 @@ We hope this will be resolved in future; the issue can be tracked [here](https:/
273275

274276
This plugin provides some custom webpack hooks (all are sync):
275277

276-
| Event name | Hook Access Key | Description | Params |
277-
| --------------------------------------- | -------------------- | ------------------------------------------------------------------------------ | ------------------------------------------- |
278-
| `fork-ts-checker-cancel` | `cancel` | Cancellation has been requested | `cancellationToken` |
279-
| `fork-ts-checker-waiting` | `waiting` | Waiting for results | `hasTsLint` |
280-
| `fork-ts-checker-service-before-start` | `serviceBeforeStart` | Async plugin that can be used for delaying `fork-ts-checker-service-start` | - |
281-
| `fork-ts-checker-service-start` | `serviceStart` | Service will be started | `tsconfigPath`, `tslintPath`, `memoryLimit` |
282-
| `fork-ts-checker-service-start-error` | `serviceStartError` | Cannot start service | `error` |
283-
| `fork-ts-checker-service-out-of-memory` | `serviceOutOfMemory` | Service is out of memory | - |
284-
| `fork-ts-checker-receive` | `receive` | Plugin receives diagnostics and lints from service | `diagnostics`, `lints` |
285-
| `fork-ts-checker-emit` | `emit` | Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` |
286-
| `fork-ts-checker-done` | `done` | Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` |
287-
288-
The **Event name** is there for backward compatibility with webpack 2/3. Regardless
289-
of the version of webpack (2, 3 or 4) you are using, we will always access plugin hooks with **Hook Access Keys** as
290-
described below.
278+
| Hook Access Key | Description | Params |
279+
| -------------------- | ------------------------------------------------------------------------------ | ------------------------------------------- |
280+
| `cancel` | Cancellation has been requested | `cancellationToken` |
281+
| `waiting` | Waiting for results | `hasTsLint` |
282+
| `serviceBeforeStart` | Async plugin that can be used for delaying `fork-ts-checker-service-start` | - |
283+
| `serviceStart` | Service will be started | `tsconfigPath`, `tslintPath`, `memoryLimit` |
284+
| `serviceStartError` | Cannot start service | `error` |
285+
| `serviceOutOfMemory` | Service is out of memory | - |
286+
| `receive` | Plugin receives diagnostics and lints from service | `diagnostics`, `lints` |
287+
| `emit` | Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` |
288+
| `done` | Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` |
291289

292290
### Accessing plugin hooks
293291

294-
All plugin hooks are compatible with both [webpack](https://webpack.js.org) version
295-
4 and version 2. To access plugin hooks and tap into the event, we need to use
292+
To access plugin hooks and tap into the event, we need to use
296293
the `getCompilerHooks` static method. When we call this method with a [webpack compiler instance](https://webpack.js.org/api/node/),
297294
it returns the series of [tapable](https://github.com/webpack/tapable)
298295
hooks where you can pass in your callbacks.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
"nativescript-vue-template-compiler": "^2.4.0",
135135
"prettier": "^1.14.3",
136136
"rimraf": "^3.0.0",
137-
"semantic-release": "^16.0.0-beta.18",
138137
"ts-loader": "^5.0.0",
139138
"tslint": "^5.11.0",
140139
"tslint-config-prettier": "^1.16.0",

src/hooks.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,9 @@ type ForkTsCheckerHookMap = Record<
1616
ForkTsCheckerHooks,
1717
SyncHook | AsyncSeriesHook
1818
>;
19-
type ForkTsCheckerLegacyHookMap = Record<ForkTsCheckerHooks, string>;
2019

2120
const compilerHookMap = new WeakMap<webpack.Compiler, ForkTsCheckerHookMap>();
2221

23-
export const legacyHookMap: ForkTsCheckerLegacyHookMap = {
24-
serviceBeforeStart: 'fork-ts-checker-service-before-start',
25-
cancel: 'fork-ts-checker-cancel',
26-
serviceStartError: 'fork-ts-checker-service-start-error',
27-
waiting: 'fork-ts-checker-waiting',
28-
serviceStart: 'fork-ts-checker-service-start',
29-
receive: 'fork-ts-checker-receive',
30-
serviceOutOfMemory: 'fork-ts-checker-service-out-of-memory',
31-
emit: 'fork-ts-checker-emit',
32-
done: 'fork-ts-checker-done'
33-
};
34-
3522
function createForkTsCheckerWebpackPluginHooks(): ForkTsCheckerHookMap {
3623
return {
3724
serviceBeforeStart: new AsyncSeriesHook([]),

0 commit comments

Comments
 (0)