Skip to content
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

Deprecate BW::HTTP #308

Closed
clayallsopp opened this issue Oct 12, 2013 · 23 comments
Closed

Deprecate BW::HTTP #308

clayallsopp opened this issue Oct 12, 2013 · 23 comments

Comments

@clayallsopp
Copy link
Contributor

This is an idea I've been playing around with and I saw it voiced in the mailing list today.

AFNetworking is the defacto abstraction for URL handling, and it's a split between silly and irresponsible to allow folks to use an inferior abstraction over the plumbing. So for the next release(s) we deprecate, and remove it by 2.0.

FWIW, I don't use BW::HTTP in my apps, so I don't have a vested interest in maintaining or debugging it.

cc @qrush

@joshsmith
Copy link

I agree with this, and as someone relatively new to RM it is very confusing to people in the community. I was forced to decide between using BW::HTTP and AFMotion, and think correctly went with the latter. But the fact that I had to make that decision is not great.

@stefanvermaas
Copy link

So what's the status on this? Will this be deprecated? Or is this still an idea?

@qrush
Copy link
Contributor

qrush commented Nov 9, 2013

I am still +1 for this. I wish I would have used AFN from the start.

Sent from my iPhone

On Nov 9, 2013, at 4:42 AM, Stefan Vermaas notifications@github.com wrote:

So what's the status on this? Will this be deprecated? Or is this still an idea?


Reply to this email directly or view it on GitHub.

@stefanvermaas
Copy link

Ok cool. I'll keep this in mind!

@jamonholmgren
Copy link
Contributor

+1

@supermarin
Copy link
Contributor

As I unfortunately don't have time to maintain that, and it isn't the best code ever - feel free to deprecate whenever the world is ready.

@supermarin
Copy link
Contributor

@clayallsopp today i've played / tested an API, and for some basic http auth testing, bubble wrap seemed a bit more straightforward than AFMotion (tried afmotion first).

Not sure if we should really remove the http module, at least for beginners.

@andyjeffries
Copy link

I'd agree with @supermarin - I think BW makes it really easy to get started and is a useful step for incoming new developers.

@supermarin
Copy link
Contributor

I might rewrite it using NSURLSession, it should be way less code

@ahmeij
Copy link

ahmeij commented Mar 10, 2014

I found a nice write-up how to switch from BW to AF here: http://jamonholmgren.com/refactoring-from-bw-http-to-afmotion It doesn't look very complicated to start with

@jamonholmgren
Copy link
Contributor

Their APIs do map very well. There are some kinda weird things with AFMotion (actually AFNetworking), like re-using the same callback block for three events during file upload, but it's pretty easy.

AFMotion::Image.post("http://foo.bar.com/") do |result, form_data, progress|
  # Called before posting so you can append your file.
  if form_data
    form_data.appendPartWithFileData(avatar_data, name: "avatar", fileName:"avatar.png", mimeType: "image/png")
  elsif progress
    progress_percentage = (progress * 100.0).round(1)
    # update UI with progress %
  elsif result.success?
    p result.body.to_s
  else
    App.alert(result.error.localizedDescription)
  end
end

@clayallsopp
Copy link
Contributor Author

Here's a proposed deprecation pattern for BW::HTTP, which is optimized to prevent people continuing to use BubbleWrap 1.x just for HTTP compatibility (not an unreasonable desire):

  • Extract BW::HTTP into its own gem (bubble-wrap-http? motion-http?)
  • Until 2.x, bubble-wrap gem will require the HTTP gem but print deprecation messages on each use
  • After 2.x, remove HTTP gem dependency
  • require 'bubble-wrap/http' will forever print a message saying it has been removed and you need to add the new gem

cc @colinta & #354

@colinta
Copy link
Contributor

colinta commented Mar 31, 2014

This seems like a good plan - if deprecation is the route BW is gonna take, I think we need to go ahead and take it, know-what-I-mean? It's still getting heavy usage.

Maybe we can add to that message a recommendation to use AFNetworking/AFMotion.

@jamonholmgren
Copy link
Contributor

I like extracting to its own gem. It's obviously still popular even though it's demonstrably inferior to AFMotion. So, the people that care can give it first-class attention, and BubbleWrap development can continue unabated.

@qrush
Copy link
Contributor

qrush commented Apr 16, 2014

Huge 👏 for this. I'd be 👍 for a message to use AFNetworking instead
somewhere.

On Wed, Apr 16, 2014 at 1:43 PM, Clay Allsopp notifications@github.comwrote:

Closed #308 #308 via
b413626b413626
.

Reply to this email directly or view it on GitHubhttps://github.com//issues/308
.

clayallsopp added a commit that referenced this issue Apr 16, 2014
- 'bubble-wrap/http' is now deprecated and will be removed in 2.0, see #308

+ `BW::UIActivityViewController` wrapper added, see #335

+ `BW::NetworkIndicator` added, see #349

 + `BW::Location.get_compass` & `BW::Location.get_compass_once`see #348

+ `NSString#to_color` ARGB support, see #350

+ `Object#method` support for `BW::Reactor`, see #359

* Prevented a possible exception when stopping `BW::Location`, see #358

* Fixed a bug when requiring just 'bubble-wrap/ui'
@clayallsopp
Copy link
Contributor Author

@qrush done, added it in the warning output

BW 1.6.0.rc1 is on RubyGems with the deprecation, please try it out: http://rubygems.org/gems/bubble-wrap/versions/1.6.0.rc1

@rromanchuk
Copy link
Contributor

@clayallsopp great work. Very good decision.

@alloy
Copy link

alloy commented Apr 17, 2014

I concur, great maintainer and user-education decision, @clayallsopp!

@cyberfox
Copy link

Ergh; I understand the decision, but I just put a bunch of code using BW::HTTP in an app I'm building, and am not looking forward to tearing it out. I guess one advantage would be that hopefully AFNetworking can be used on an async queue, instead of just a runloop?

@qrush
Copy link
Contributor

qrush commented Apr 18, 2014

Honestly, you shouldn't ship an app you're going to use for non-recreational purposes with BW::HTTP. AFNetworking is just so much better and battle tested. You owe it to yourself and your users to use AF.

@jamonholmgren
Copy link
Contributor

@cyberfox: I wrote a blog post that gives you a jump start on refactoring from BW::HTTP to AFMotion.

http://jamonholmgren.com/refactoring-from-bw-http-to-afmotion

Hope it helps.

@cyberfox
Copy link

I appreciate that BW::HTTP is being extracted as a gem. In trying to use AFMotion, I have not found it to be a suitable replacement for my straightforward uses. It's possible that more 'advanced' uses may paradoxically work better. Thanks for extracting BW::HTTP instead of just getting rid of it.

tutuming pushed a commit to tutuming/BubbleWrap that referenced this issue Apr 21, 2014
tutuming pushed a commit to tutuming/BubbleWrap that referenced this issue Apr 21, 2014
- 'bubble-wrap/http' is now deprecated and will be removed in 2.0, see rubymotion-community#308

+ `BW::UIActivityViewController` wrapper added, see rubymotion-community#335

+ `BW::NetworkIndicator` added, see rubymotion-community#349

 + `BW::Location.get_compass` & `BW::Location.get_compass_once`see rubymotion-community#348

+ `NSString#to_color` ARGB support, see rubymotion-community#350

+ `Object#method` support for `BW::Reactor`, see rubymotion-community#359

* Prevented a possible exception when stopping `BW::Location`, see rubymotion-community#358

* Fixed a bug when requiring just 'bubble-wrap/ui'
@cyberfox
Copy link

Happily with rubymotion-community/afmotion@06fd55cc and rubymotion-community/afmotion@12caa46f my simple use cases are functioning with AFMotion. Thanks very much @clayallsopp !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests