-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Proposal: extract fake xhr and fake server to separate module #1453
Comments
Absolutely in favor of extracting them. Your plan to deprecate and then remove makes sense. I'm wondering though whether we should deprecate in a major and remove in a following major, since most people will receive implicit upgrades in their builds through ^ dependencies. |
We talked about this before, and all agreed back then, so yeah: still in favor. @mantoni The caret won't upgrade major versions, will it? Thought it would do patches and minor versions, but not major. That would make very little sense. Don't see the big point in deprecating now that we eliminated most hurdles for doing major releases more frequently, but if it helps in any way: sure, why not. |
@fatso83 Yes, |
Like the concept. Not a fan of the tests and source living next to each other (mass hysteria), but that's something we can work on later.
Can we work on a better name?
Agreed. Question: If we keep pulling things out (like |
All suggestions welcome |
I'm not opposed to finding a better name, but perhaps |
My goal with this effort is to remove Fake XHR and Fake Server from the sinon core offering, and publish it entirely separately. I don't think they're necessary for the vast majority of users/projects. Fake XHR has incomplete spec coverage, is very complicated and attracts a not insignificant amount of bug reports but not very many pull requests. As a standalone package we will get a clearer picture of how much it is being used. Ultimately, I think that the sinon core offering should consist of
|
I totally agree with what @mroderick has just said. Maybe we could call it However, I think that as sooner as we remove it, the better. Recently I've been reading a lot about how Go is designed and I'm increasingly more attracted to providing users the bare minimum for them to build on top of the features we provide in an elegant an concise way. IMO having I think that adding deprecation warnings on minor/patches would be good so that people can prepare their code and adopt the next major ASAP. We could even add those warnings before doing any action regarding the separation of repositories/packages since this already demonstrates our intention of deprecating it quite ahead of time. Anyway, I think I have already lengthened too much. TL;DR I agree |
I've updated the description above to better match the opinions put forth. |
Great stuff, Morgan, but I am not sure I quite understand these points in the new description:
I do understand that it makes sense to start adding deprecation warnings (that I assume says "stop using these APIs - start using the separate libs
Please elaborate, as I think I might fail to understand your intent 😸 |
Perhaps I was being unclear; When I wrote
I meant to say that since we're releasing a new |
Would Sinon-server then become independent package? Would it continue to be maintained? It is quite useful, at least for a niche application where we need to run integration tests through an external framework (e.g. Protractor/Webdriver) without Sinon itself, but intercepting and stubbing out real XHR requests in the browser through Sinon-server injected into the browser by this framework (so the tests themselves are still run outside of the browser). I.e. our application only needs (in fact, relies on) Sinon-server functionality. Providing it as a (much smaller) stand-alone package (as was done in 1.x!) would actually be quite nice. Without it, we'd have to run an "external" server that would increase the complexity of test setup. |
@dinvlad If you read the issue description at the top, you will see that the extracted package (with the proposed name |
Sounds reasonable. @mroderick, thanks for working on it! |
Why |
It's a Japanese adjective, meaning "fake" ... i.e. fake xhr, fake server, fake news, etc. |
I've created the |
Seeing as this has been merged into the core, I am closing it. |
I would like to propose that we excise fake xhr and fake server from
sinon
and publish them as a separate module.Down the line, I would like to remove them from core sinon, and just have them live their own life.
Strategy
xhr
andserver
, publish them under a new namenise
(偽 - adjective "fake" in Japanese ... "fake server", "fake xhr", etc).nise
back intosinon
, keeping exactly the same api, adding deprecation warningsMAJOR
version, that removes old deprecations, and usesnise
for fake xhr and servernise
fromsinon
in a new major versionFor the first part, I have created a temporary repository under my name: https://github.com/mroderick/nise and have started importing things.
I am trying to leave the source and tests fairly unchanged for now. If we want to make significant improvements to this module, let's do that when it is extracted completely.
Open questions and tasks
The text was updated successfully, but these errors were encountered: