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 |
…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 |
|
Starting to write this up here: johnnyreilly/blog.johnnyreilly.com#1109 |
|
@copilot review the |
Reviewed at Possible low-risk hotspots to keep an eye on:
Everything else I reviewed looks neutral or slightly better for runtime cost (no obvious new heavy loops/allocations in hot paths). No code changes made. |
src/**/*.tsfiles changed in this PR