Experiment with adding webpack 4 support back#1697
Conversation
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/74b74f2d-76ad-4022-9635-77d0c5acce76 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/e322b7ed-e010-4d60-9a2d-3672c9d55324 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/55527c90-acbb-42e1-b384-95f6fdfe9283 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
|
@copilot please consistently use |
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/84c8d79e-30f1-46f5-baf3-bc669466d3ba Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Done in 5d7ab2f. I updated the remaining strategy checks to consistently branch on |
| } from './interfaces'; | ||
| import { getInputFileNameFromOutput } from './instances'; | ||
|
|
||
| export const isWebpack5 = !!(webpack as any).sources; |
There was a problem hiding this comment.
Good catch — no, it wasn’t necessary there. I removed isWebpack5 from utils.ts and localized detection to instance setup in instances.ts in 78fa91f, so strategy still flows through instance.isWebpack5 without the extra utils export.
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/faa27c75-efcd-4e5a-8062-443dce3bf610 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
| (error: any) => error.loaderSource !== tsLoaderSource(loaderOptions) | ||
| ) | ||
| .forEach(error => module.addError(error)); | ||
| const webpackModule = module as any; |
There was a problem hiding this comment.
@copilot I don't think the webpack5 code needs to use webpackModule it can use module
There was a problem hiding this comment.
Updated in 7b3cd3e — webpack 5 path now uses module directly (getWarnings/getErrors/clearWarningsAndErrors) and keeps webpackModule only for the webpack 4 branch.
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/5d863b98-4c30-478e-8205-7c3a7387b0f1 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
|
@copilot please update CHANGELOG.md with this PR. This is a new feature so use that to determine version number |
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/5ab3e8ae-31b4-4a96-917d-adcd027e3593 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/5ab3e8ae-31b4-4a96-917d-adcd027e3593 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Updated in c8be7fc. I added a new Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| ); | ||
| } | ||
|
|
||
| function moduleHasErrors(module: webpack.Module, isWebpack5: boolean) { |
There was a problem hiding this comment.
@copilot the main branch doesn't have moduleHasErrors - why do we need it now?
There was a problem hiding this comment.
main is webpack-5-only, so it doesn’t need this guard. In this PR we reintroduced webpack 4 handling, where module errors are managed via mutable module.errors / module.warnings arrays and can already contain non-ts-loader errors. Without moduleHasErrors, ts-loader diagnostics get re-added at module level on top of existing errors, which changes/duplicates comparison output. We still always add diagnostics to compilation.errors; this guard only prevents module-level double-reporting in the webpack 4 path.
b5a3095 to
51e9fa2
Compare
|
@copilot |
…utput Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/df34fd80-1718-4769-8f01-fbc15f96c807 Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Investigated and fixed in |
|
@copilot after the last commit all |
Agent-Logs-Url: https://github.com/TypeStrong/ts-loader/sessions/22ab19a4-eb4b-4cf6-8efc-423776e48f2d Co-authored-by: johnnyreilly <1010525+johnnyreilly@users.noreply.github.com>
Fixed in |
Uh oh!
There was an error while loading. Please reload this page.