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

Remove jquery and use framework specificly for ajax calls or write own ajax calls #1

Open
peteruithoven opened this issue Jul 23, 2015 · 3 comments

Comments

@peteruithoven
Copy link
Member

Remove jquery and use framework specificly for ajax calls or write own ajax calls.

Maybe we can use the upcoming fetch()?
http://jakearchibald.com/2015/thats-so-fetch/

Looks like it isn't included in Babel, maybe we can use the following polyfill: https://github.com/github/fetch

casperlamboo added a commit that referenced this issue Jul 23, 2015
@peteruithoven
Copy link
Member Author

Slight downside is that it isn't Node.js compatible, but there is a Node.js specific alternative: https://github.com/bitinn/node-fetch
Maybe, in the future we can do some kind of conditional platform check.

@peteruithoven
Copy link
Member Author

In the mean time we've readded jQuery's ajax because fetch was lacking timeout functionality.
A solution could be adding a timeout wrapper:
JakeChampion/fetch#175 (comment)

If we want to make the API universal/isomorphic we could use: isomorphic-fetch. But beside that it might be slightly easier to test (which I'm not sure of) I don't really see the point.

@peteruithoven peteruithoven reopened this Aug 14, 2015
@casperlamboo
Copy link
Contributor

Note that this is not a connection timeout. This is a response timeout. ... even if the timeout happens, the original request won't be aborted.

This means that when a gcode batch times out it's still plausible it is being send to the doodle box. The api will resend the batch and the same batch will be printed twice.

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

2 participants