-
Notifications
You must be signed in to change notification settings - Fork 476
Being able to receive warnings in custom handlers #250
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
Comments
I cannot find issue #296 (in the jquery-migrate project), which one is that? |
Sorry I meant #196. I don't expect we'll change those details since we've advocated their use in several tickets at this point. If you'd like to use it and add a comment to that effect please file a PR. Adding a handler interface is always more complicated that you might think, it needs to define what happens for multiple listeners and there's the possibility of recursion (e.g., a warning handler calling a jQuery method that itself generates a warning). Yes all of those things can be defined, guarded, or documented away but given the small number of use cases I think we have acceptable solutions already. |
Ok, thank you for your responses! I will try to monkey-patch |
An example would be when using jquery-migrate in unit tests:
jQuery.migrateWarningHandler(warning => failTheUnitTest(warning))
or one could throw an exception possibly.
Migrate warnings would then fail the build, so problems are discovered early.
See This PR in jquery-ui for context.
(Ideally it would be possible to use both in 1.4.x and 3.x, since that is what jquery-ui uses)
The text was updated successfully, but these errors were encountered: