Skip to content

feat(http): add support for JSONP requests#2905

Closed
caitp wants to merge 1 commit into
angular:masterfrom
caitp:jsonp
Closed

feat(http): add support for JSONP requests#2905
caitp wants to merge 1 commit into
angular:masterfrom
caitp:jsonp

Conversation

@caitp
Copy link
Copy Markdown
Contributor

@caitp caitp commented Jul 6, 2015

Dart is broken, WIP

Closes #2818

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to manually fix clang-format errors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you run gulp enforce-format, it should give you the script to run to automatically fix all clang complaints.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script is what produced the bad sources, out just looks really really bad

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 8, 2015

anyone who knows anything about dart have an idea here? the JS code is happy

@tbosch tbosch added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jul 8, 2015
@jeffbcross
Copy link
Copy Markdown
Contributor

@caitp The latest travis build #6453 looks like it's just choking on TypeScript errors. Can you point to a build where dart errors were apparent?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing this missing semicolon, and moving async.done to the next line will get rid of all ts2dart errors.

@jeffbcross
Copy link
Copy Markdown
Contributor

I've started addressing some of the dart issues on my fork: https://github.com/jeffbcross/angular/tree/pr-2905

I'll get back into it tomorrow and will connect with you on the right approach to get this working in dart, which is still not completely clear to me. Requires a little more research into dart.

@jeffbcross
Copy link
Copy Markdown
Contributor

Yeah, I think my fork is not the direction to go. We'll most likely just need to create a browser_jsonp.dart similar to how I did with browser_xhr, rather than use the DomAdapter facade like I was trying to do.

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 10, 2015

PTAL --- it's working locally for me on dart2js and production js, and passing all cjs tests

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 10, 2015

actually, a slight fixup was needed for cjs that broke the dart build --- it seems ts2dart doesn't handle "protected" properties

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 10, 2015

Just blocked on dart-archive/ts2dart#240 I guess

@jeffbcross
Copy link
Copy Markdown
Contributor

I merged dart-archive/ts2dart#240, but will have to revisit Monday because there's a release process for ts2dart that I'm not familiar with.

@jeffbcross
Copy link
Copy Markdown
Contributor

Though you could update the PR to use latest ts2dart package if you want to see if Travis goes green.

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 11, 2015

I'll add a commit to test that tonight just in case the patch wasn't enough

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 11, 2015

well that didn't work

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 11, 2015

I'm not sure why the benchmark uses !isJsObject({}) rather than just JitChangeDetection.isSupported()?

@jeffbcross
Copy link
Copy Markdown
Contributor

Whoa, Travis is actually green! Is this ready for review, @caitp?

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 13, 2015

yes, by all means =)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dart's TypeError class doesn't let me attach an arbitrary message. I guess Dart doesn't use it as a catch-all exception the way JS does

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this expectation. It would pass under any circumstance because you're comparing two string literals.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the wording makes sense but in practice it doesn't really work. We do need some kind of UNREACHABLE() assertion though

@jeffbcross
Copy link
Copy Markdown
Contributor

Left some minor comments, mostly around tests being written in a way where expectations could be skipped, or aren't valid,

I'll cut the ts2dart release this afternoon, and with the comments addressed, should be good to merge. I'll wait to give it green label until ts2dart is released.

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 13, 2015

yeah, will make the suggested changes

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented Jul 14, 2015

Those commits should address the review comments, still waiting on the ts2dart release so that I can pull that in here. I'll squash when checking in

@jeffbcross
Copy link
Copy Markdown
Contributor

TS2Dart has been updated: 3810e4b

@jeffbcross
Copy link
Copy Markdown
Contributor

LGTM! Merge when Travis goes green.

@jeffbcross jeffbcross added pr_state: LGTM action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer state: WIP labels Jul 15, 2015
@caitp caitp closed this in 81abc39 Jul 15, 2015
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(http): add JsonP and JsonPBackend

4 participants