-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix: restore customFileHandlers
provider
#3624
fix: restore customFileHandlers
provider
#3624
Conversation
❌ Build karma 468 failed (commit bc09f16a3e by @devoto13) |
❌ Build karma 467 failed (commit bc09f16a3e by @devoto13) |
return function (request, response, next) { | ||
const handler = customFileHandlers.find((handler) => handler.urlRegex.test(request.url)) | ||
|
||
if (customFileHandlers.length > 0 && !warningDone) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The awkward logic is here because handlers are added dynamically (e.g. https://github.com/angular/angular-cli/pull/19784/files#diff-7e99b8c9ae4a43ae87d525fccfd19e3c7449e3f12b3d0e07aedf208a8a451f3cL223) and we can't rely on the presence of the provider either, because it is always there.
So I resorted to checking that there is at least one custom handler is present when handling a request and printing the warning only once to avoid spamming the logs.
The check is not perfect as the warning is printed only when this handler is reached but this should be good enough in practice.
2a64e7c
to
9e12592
Compare
JFYI, Angular CLI 11.0 doesn't support Karma 6, thus the error is expected. Karma 6 is supported in Angular 11.1. See: angular/angular-cli#19815 (comment) |
✅ Build karma 469 completed (commit e5ae8e586a by @devoto13) |
@alan-agius4 Yes, I know. But people still upgrade to Karma 6 and get the error. I think it is better to have the warning to give the ecosystem time to adapt. This also affects older versions of |
✅ Build karma 468 completed (commit e5ae8e586a by @devoto13) |
@devoto13, Agreed! Although warnings as typically ignored. Strictly speaking in Angular CLI, they already get a warning of unmeet peer dependencies. |
@devoto13 Thank you very much! Really a good decision. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need an Issues: Release 7 blockers to remember to follow through.
The removal of `customFileHandlers` turned out to be more disruptive change than anticipated as this provider is still used by several popular plugins: karma-runner#3619, codymikol/karma-webpack#462, angular/angular-cli#19815. Hence we restore the provider and print a deprecation warning to make upgrading easier. This should give more time for the plugin authors to release new versions and users to adopt these versions.
9e12592
to
3078881
Compare
✅ Build karma 472 completed (commit a89096a703 by @devoto13) |
✅ Build karma 471 completed (commit a89096a703 by @devoto13) |
🎉 This PR is included in version 6.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The removal of `customFileHandlers` turned out to be more disruptive change than anticipated as this provider is still used by several popular plugins: karma-runner#3619, codymikol/karma-webpack#462, angular/angular-cli#19815. Hence we restore the provider and print a deprecation warning to make upgrading easier. This should give more time for the plugin authors to release new versions and users to adopt these versions.
## [6.0.1](karma-runner/karma@v6.0.0...v6.0.1) (2021-01-20) ### Bug Fixes * **server:** set maxHttpBufferSize to the socket.io v2 default ([karma-runner#3626](karma-runner#3626)) ([69baddc](karma-runner@69baddc)), closes [karma-runner#3621](karma-runner#3621) * restore `customFileHandlers` provider ([karma-runner#3624](karma-runner#3624)) ([25d9abb](karma-runner@25d9abb))
The removal of
customFileHandlers
turned out to be more disruptive change than anticipated as this provider is still used by several popular plugins: #3619, codymikol/karma-webpack#462, angular/angular-cli#19815. Hence we restore the provider and print a deprecation warning to make upgrading easier. This should give more time for the plugin authors to release new versions and users to adopt these versions.How it looks now: