-
Notifications
You must be signed in to change notification settings - Fork 11
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
JavaScript cleanup #421
JavaScript cleanup #421
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@eddieantonio why shouldn't we use jquery |
It's one more dependency that we don't really need when we're doing DOM manipulation that can be done without jQuery. Do the same with a lot less code! |
} | ||
|
||
/** | ||
* use xhttp to load search results in place | ||
* use AJAX to load search results in place |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddieantonio why is ajax favoured over xhttp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AJAX refers to any asynchronous HTTP request, whether it's done with the crusty old XMLHttpRequest
API or the newer, less error-prone fetch()
API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aah was asking why use fetch over XMLHttpRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aah was asking why use fetch over XMLHttpRequest
I've personally always went with XMLHttpRequest because it's what I was taught/learned first! Fetch is new to me but I'm aware that it is the future so I'll try to work at using it more go forward.
If I remember right, fetch handles some things better than XMLHttpRequest does (did?). I think I have a short tutorial tucked away for why the newer is better: just holler and I can pull it over the weekend or something 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Glad to know the javascript is working without me
This is a series of refactors, style tweaks, and changes, including:
fetch()
consistently instead ofXMLHTTPRequest
I mostly worked on
index.js
, not really doing anything more than running ESLint onrecordings.js
.EDIT: one casualty is waiting for the
fetch()
in our loading bar tests because Cypress doesn't currently supportfetch()
BUT, they're working on it!