-
Notifications
You must be signed in to change notification settings - Fork 208
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
Comments
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 |
So what's the status on this? Will this be deprecated? Or is this still an idea? |
I am still +1 for this. I wish I would have used AFN from the start. Sent from my iPhone
|
Ok cool. I'll keep this in mind! |
+1 |
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. |
@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. |
I'd agree with @supermarin - I think BW makes it really easy to get started and is a useful step for incoming new developers. |
I might rewrite it using NSURLSession, it should be way less code |
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 |
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 |
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):
|
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. |
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. |
Huge 👏 for this. I'd be 👍 for a message to use AFNetworking instead On Wed, Apr 16, 2014 at 1:43 PM, Clay Allsopp notifications@github.comwrote:
|
- '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'
@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 |
@clayallsopp great work. Very good decision. |
I concur, great maintainer and user-education decision, @clayallsopp! |
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? |
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. |
@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. |
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. |
- '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'
Happily with rubymotion-community/afmotion@06fd55cc and rubymotion-community/afmotion@12caa46f my simple use cases are functioning with AFMotion. Thanks very much @clayallsopp ! |
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
The text was updated successfully, but these errors were encountered: