-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
Add v2.0 Migration Guide #1090
Add v2.0 Migration Guide #1090
Conversation
Very nice! 👍 |
Very nice, but we were talking of removing P.S. Regarding the deprecated methods should we try to wrap the methods in some kind of deprecation closure that will output a warning? All internal use should by now be removed so that leaves external uses. I was thinking of something like function deprecated(func, name) {
var callCount = 0;
var warn = typeof console !== "undefined" && (console.warn || console.log).bind(console);
return function() {
if(callCount++ === 0){
warn(util.format("[deprecated] The use of sinon.%s has been deprecated. Refer to the migration docs", name));
}
func.apply(this, arguments);
}
}
exports.mock = deprecated( require("./sinon/mock"), "mock") );
// etc |
We can use a node util function instead of writing our own: https://nodejs.org/api/util.html#util_util_deprecate_function_string |
@jonnyreeves : not sure which response you are awaiting :)? We have talked several times about removing |
All methods called out in the migration guide as deprecated now write a message to the console when they are invoked via the I have chosen to not mark |
So in looking at the failing tests I can see my approach for wrapping the Event constructors is flawed as they are going to be invoked via What's strange is that the sandbox tests are now failing; I'll have to take a deeper look into that as marking the utils as deprecated should not have had any other side-effects 😖 |
@jonnyreeves : What do you mean by migration plan? An actual document in Re the |
@fatso83 I mean that we probably shouldn't mark IMHO we should ship 2.0 with |
OK tracked down the failure here, 3 parts:
Just need to patch up deprecating |
@jonnyreeves Yes, I think mochify will fail the test if there is a |
@jonnyreeves : the migration plan you proposed for Re the wrap function: why did you end up not using |
@jonnyreeves I think there needs to be an additional option for phantomic to not exit with 1 if an error was logged (it is caused here). |
return function () { | ||
// Watch out for IE7 and below! :( | ||
if (typeof console !== "undefined") { | ||
if (console.warn) { |
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.
Not seeing much trace of the console.info
instead of console.warn
thing you talked about for PhantomJS?
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.
Ah sorry I have not pushed the changes mentioned above as I was waiting on
the sandbox cjs work to land first.
On Wed, 27 Jul 2016, 23:33 Carl-Erik Kopseng, [email protected]
wrote:
In lib/sinon/util/core/deprecated.js
#1090 (comment):@@ -0,0 +1,24 @@
+/*eslint no-console: 0 */
+"use strict";
+
+// wrap returns a function that will invoke the supplied function and print a deprecation warning to the console each
+// time it is called.
+exports.wrap = function (func, msg) {
- return function () {
// Watch out for IE7 and below! :(
if (typeof console !== "undefined") {
if (console.warn) {
Not seeing much trace of the console.info instead of console.warn thing
you talked about for PhantomJS?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sinonjs/sinon/pull/1090/files/131555150b9b8785bea6923702d7102e3fe9732f#r72536795,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMN-edIe5DVMCZV_IBMnUSuJjIdGk3Qks5qZ9yYgaJpZM4JI4nR
.
This needs to be rebased to include #1088, no? |
Yep, I'll sort it out this evening / this weekend free time depending :) On Thu, 28 Jul 2016 at 10:58 Carl-Erik Kopseng [email protected]
|
1315551
to
74eddc6
Compare
a) it doesn't copy the If you feel strongly I can switch it over to use |
OK; all functions marked as deprecated in the I believe the only outstanding questions are around how the |
@fatso83 I was not aware we were dropping support for ES3 (legacy) browsers in 2.x; I'm more than happy to revert this back to using |
@jonnyreeves: maybe this highlights the fact that we should explicitly define which browser versions we are supporting going forwards? I am quite sure @mroderick said something about not wanting to support < IE10 (or was it IE11?) in some issue, and I replied that I agreed, and that those needing to support older browsers could use the 1.x branch. I was unable to find that discussion right now using the issue tracker search engine right now. I really don't think we should support anything not supporting ES5 going forwards. Preferably, I'd drop everything pre IE11 as that means we could drop Dropping browser support should be part of a migration document, I suppose. |
One hint to browser support in |
Good call @fatso83; I've updated the README to add both a Saucelabs build status badge and a Saucelabs Browser Matrix badge - you can preview this here. Looks like the status is not being pulled through at the moment, we may have to tinker. According to the saucelabs guide, we need to:
I don't have a login for saucelabs - would you or @mroderick be able to take a look for me please? |
@jonnyreeves: In my car, on my way home from vacation, so I just sent you the credentials by email. |
Cheers @fatso83; added I've pushed a commit to master which exposes the |
Sure it's been pushed? Last commit was 4 hours ago. |
@jonnyreeves There was a pull request on min-webdriver that should have made this work. The property it's using is |
@jonnyreeves Also please message me / private twitter so I can send you our SauceLabs account. |
Nice! But your empty commit is not actually empty. I would also prefer to rebase this commit away before merging. As a Sinon member you should be able to trigger rebuilds in Travis. |
@jonnyreeves I mean, the content of the commit seems fine, just the commit name makes no sense 😄 |
@jonnyreeves : the badges are showing in the README, btw :) LGTM, too, btw, so just remove the last commit and merge it at will. |
* Add Migration Guide to docs * Mark sinon core utils and sinon.Event as deprecated. * Update `README.md` to provide Browser Support Matrix.
66fe46d
to
c48c505
Compare
Whoops, sorry about that last commit; accidentally took a non-ruby publish script I was hacking around on along for the ride! 💃 All commits squashed; could someone give it a quick once over and then make it so, please? |
Boom. |
👍 @fatso83 You’ve been 5 seconds faster than me 🚀 |
The migration guide is clear about the use of sinon-test. However, The docs for sinon-test do not explain what --edit This gist gives me my best guess: something about using If someone could explain the exact function I'd be happy to write some docs over at the sinon-test repo. |
@sephie You are totally correct about that omission, and one I was pondering last Friday 😄 I found the previous description for you on the WayBack Machine. AFAIK, you basically use it as a wrapper around the |
That's another way to do it. 😆 PR is up over at sinon-test |
sinon.Event
and friends as deprecated.Went through all the pull requests opened since the initial kick off of the CJSify work and tried to reason about the changes to the public API.
Wasn't 100% where to the put the migration guide, but the
docs
folder felt like a good place :)