Replace jquery getJSON and get with native fetch #2591
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace jquery getJSON and get with native fetch
Pull Request Type
Related issue
Original giant PR #2360
Description
This PR replaces the calls to jquery's networking functions (
getJSONandget) with thefetchAPI that is available in all browsers these days. It doesn't remove the jquery dependency as it's still used in quite a few other places in FreeTube, I'll change those in future PRs.The idea is to split up my giant jquery PR into smaller more manageable ones, as that makes them easier to test and less likely that bugs sneak into them.
Testing (for code that is not small enough to be easily understandable)
Set version in the
package.jsonfile to0.16.0and check that the "Update available..." banner shows upClick the proxy test button, if you have a proxy it will succeed. If you don't have a proxy you can check that the error handling works by looking in the devtools console
Video with segments: https://youtu.be/nFDBxBUfE74
Video without segments: https://youtu.be/0bvZ70wgZVM
Desktop (please complete the following information):