angular.dart icon indicating copy to clipboard operation
angular.dart copied to clipboard

JSONP is not implement in AngularDart

Open matsko opened this issue 11 years ago • 16 comments

matsko avatar Jan 30 '14 08:01 matsko

How so?

pavelgj avatar Feb 03 '14 15:02 pavelgj

It was just never implemented into AngularDart. Try it out. Http treats it just like any other GET request.

matsko avatar Feb 03 '14 15:02 matsko

It looks like it is still not working. I can try to implement it.

vsavkin avatar May 24 '14 21:05 vsavkin

Sure, but the browsers which dart supports are CORS enabled, so is this even worth it?

On Sat, May 24, 2014 at 11:19 PM, Victor Savkin [email protected]:

It looks like it is still not working. I can try to implement it.

— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.dart/issues/467#issuecomment-44100033 .

mhevery avatar May 25 '14 13:05 mhevery

I think the concern is for APIs that do not provide CORS headers, but instead only use callbacks.

matsko avatar May 25 '14 14:05 matsko

Legacy services ?

On May 25, 2014 3:47:27 PM CEST, "Miško Hevery" [email protected] wrote:

Sure, but the browsers which dart supports are CORS enabled, so is this even worth it?

On Sat, May 24, 2014 at 11:19 PM, Victor Savkin [email protected]:

It looks like it is still not working. I can try to implement it.

— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.dart/issues/467#issuecomment-44100033 .


Reply to this email directly or view it on GitHub: https://github.com/angular/angular.dart/issues/467#issuecomment-44133578

vicb avatar May 25 '14 14:05 vicb

Agree with @matsko and @vicb.

It is a valid point, however, that because all the browsers Dart supports are CORS enabled, the chances are you won't need JSONP. So maybe it should not be in the core angular library. In this case, we should just remove the jsonp method from the Http service.

vsavkin avatar May 25 '14 14:05 vsavkin

Yes good point. Also, is it possible to call a Dart callback function in the method that JSONP works with JavaScript?

matsko avatar May 25 '14 15:05 matsko

@matsko it is possible (see https://www.dartlang.org/samples/jsonp/).

vsavkin avatar May 25 '14 15:05 vsavkin

So what is the status on jsonp ?

IMO it could be a nice addition (some servers won't support cors). Any estimate of the effort this PR would be ?

vicb avatar May 26 '14 05:05 vicb

I checked the AngularJS implementation of JSONP, and it is pretty straightforward. So I don't think implementing it for AngularDart will be challenging.

I can try to do it this week (if everyone is OK with adding JSONP support to AngularDart).

vsavkin avatar May 26 '14 23:05 vsavkin

I'm all for adding it if the effort is not that big - @vsavkin no rush as I think it's low priority considering the previous comments.

vicb avatar May 27 '14 08:05 vicb

@vicb I've implemented jsonp support, but I'm not 100% sure if it should be a part of AngularDart. The implementation does not depend on Angular in any way, and in theory can be use by other projects. On the other hand, it is less than 100LOC, so it may not be worth adding another dependency to the Angular project. Do you know what is the common practice? Should such things be extracted into separate projects or kept in Angular?

vsavkin avatar Jun 01 '14 16:06 vsavkin

I would tend to prefer a separate package for the reasons you give. What do others think ?

(I think there is already a jsonp package on pub, what are the differences ?)

On June 1, 2014 6:55:56 PM CEST, Victor Savkin [email protected] wrote:

@vicb I've implemented jsonp support, but I'm not 100% sure if it should be a part of AngularDart. The implementation does not depend on Angular in any way, and in theory can be use by other projects. On the other hand, it is less than 100LOC, so it may not be worth adding another dependency to the Angular project. Do you know what is the common practice? Should such things be extracted into separate projects or kept in Angular?


Reply to this email directly or view it on GitHub: https://github.com/angular/angular.dart/issues/467#issuecomment-44782499

vicb avatar Jun 01 '14 21:06 vicb

@vicb I looked at the JSONP package before doing the spike.

  • It does quite a bit more than Angular needs.
  • It depends on the js package.
  • The error handling appears to be broken.
  • Judging by the last commit, which was about seven months ago, it has not been worked on lately.
  • It uses the LGPL licence (not sure if it is a problem).

vsavkin avatar Jun 02 '14 12:06 vsavkin

Doing more should not be a problem (Dart has tree shaking). The other items are more problematic.

vicb avatar Jun 02 '14 12:06 vicb