Location: In person, Chicago jQCon
Attending: DaveMethvin, markelog, gibson042, m_gol
link Versioning
- If we are going npm we should obey semantic versioning
- The .then() change will be breaking
- Might as well remove other things like .andSelf()
- New versioning
- 1.x now jquery-legacy-3.x
- 2.x now jquery 3.x
link Deferred pull request for Promise/A compat on .then()
- Comments on the PR
- A branch with tests applied:
- https://github.com/jquery/jquery/tree/standard-then-tests (run
grunt promises-aplus-tests
)
- https://github.com/jquery/jquery/tree/standard-then-tests (run
link xhr
- Design goal: allow standalone usage
- Simple xhr module in a wrapper
1
2
3
4
5
6
7
8
9
10
|
|
- Simple case:
jQuery.xhr( url, options ).then( handlerA ).then( handlerB )
- beforeSend case:
1
2
3
4
5
|
|
- Super-advanced case:
1
2
3
4
5
6
|
|
- Does an unsent Promise that has mutability violate the Promise/A+ spec? Or does the mutability only apply to the resolution? No. Does not appear to apply to the returned promise, which can be augmented, only to the resolved value of the promise
- options necessary to functionality: method, user, pass, body, query (RFC), beforeSend
- options nice to keep: cache, ifModified, headers
- jxrPromise: .abort(), .xhr property
- Rejects on: Exception, timeout, abort
- what about 4xx/5xx? or a 0 (network error)
- implied success:
jQuery.xhr( url ).then( jQuery.xhr.rejectHTTPError )
- implied failure:
jQuery.xhr( url ).catch( jQuery.xhr.ifResponse )
- implied success:
- Resolved value: raw native xhr
- Rejected value: Error object, potentially with .xhr property, .options object