mozilla / payments-ui

**DEPRECATED & UNMAINTAINED** The payments frontend interface
Other
126 stars 26 forks source link

replace jquery with fetch polyfill #84

Closed kumar303 closed 9 years ago

kumar303 commented 9 years ago

I don't think we're using JQuery for anything other than its XHR abstraction, right? We could replace it with the ES6 fetch polyfill: https://github.com/github/fetch :

fetch('/users.json')
  .then(function(response) {
    return response.json()
  }).then(function(json) {
    console.log('parsed json', json)
  }).catch(function(ex) {
    console.log('parsing failed', ex)
  })
muffinresearch commented 9 years ago

Nothing I can't get rid of easily. :+1:

muffinresearch commented 9 years ago

Would be good to start graphing the bundle sizes. If only to see it drop considerably when we remove Jquery :)

kumar303 commented 9 years ago

+1

we would need the obligatory http://arepaymentsslimyet.com of course

kumar303 commented 9 years ago

This could also be our chance to add a networking layer that can be easily mocked/stubbed for testing. For example, we want to be able to make assertions about how components use their state to do API requests and how they set state based on responses.