Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f357e44
Refactor Architect#ajax
EtienneLem Oct 9, 2014
c3a546b
Remove date from compiled files
EtienneLem Oct 31, 2014
81c7a7b
Use `in` operator to verify if object has key
EtienneLem Oct 31, 2014
47da137
Holy CoffeeScript
EtienneLem Oct 31, 2014
bf2be21
[cleanup]
EtienneLem Mar 18, 2015
80bbc8f
Port the whole thing to CommonJS
EtienneLem Mar 19, 2015
5629001
Add custom workers
EtienneLem Mar 20, 2015
52a602b
Handle JSONP multiple arguments
EtienneLem Mar 20, 2015
1574de9
Add specs
EtienneLem Mar 24, 2015
53516cf
Refactor/DRY required params
EtienneLem Mar 24, 2015
fa2dc12
Mock workers process
EtienneLem Mar 24, 2015
a1377da
Do not append .js to workersSuffix
EtienneLem Mar 24, 2015
d95b310
Enqueue jobs and add maximum threads
EtienneLem Mar 24, 2015
37debd5
Spec defaults
EtienneLem Mar 24, 2015
577a30a
[dist]
EtienneLem Mar 24, 2015
b52fc3d
Rename “getWorkersPathForType” -> “getWorkerPathForType”
EtienneLem Jun 25, 2015
0d032fa
:lipstick:
EtienneLem Jun 25, 2015
df37443
[webpack] Resolve .js & .coffee files
EtienneLem Jun 29, 2015
f704be8
No more short-lived workers
EtienneLem Jun 29, 2015
19f951e
[dist]
EtienneLem Jun 29, 2015
3e07c88
Do not wrap rejected worker response in new Error
EtienneLem Jun 30, 2015
df7132b
[dist]
EtienneLem Jun 30, 2015
159f7d0
Allow setting custom X-Requested-With value
rafbm Aug 27, 2015
33834f0
[dist]
rafbm Aug 27, 2015
ac19203
Wrap JSONP Worker’s importScripts in try/catch
EtienneLem Sep 11, 2015
2f5f90d
Allow setting 'withCredentials' on XMLHttpRequest
rafbm Oct 2, 2015
504b0a9
[dist]
rafbm Oct 2, 2015
5e777e7
Fix polyfills arguments
EtienneLem Nov 11, 2016
f1452fa
[dist]
EtienneLem Nov 11, 2016
afa6de4
Fix polyfills’ handleRequest
EtienneLem Nov 11, 2016
4e72367
[dist]
EtienneLem Nov 11, 2016
bbbbb3d
Use yarn
EtienneLem Mar 3, 2017
e46cfd3
[spec] Add mocha
EtienneLem Mar 3, 2017
a032ac3
[spec] Fix overspecified spec
EtienneLem Mar 3, 2017
66ee1cf
Use blobs
EtienneLem Mar 3, 2017
48e8d1f
Fix `globalScope` being undefined in minified jsonp worker
EtienneLem Mar 6, 2017
477aa13
Support passing `fn` as a string in WorkerPolyfill
EtienneLem Mar 6, 2017
f586a3b
Use a different JSONP callback name when using the default one
EtienneLem Jul 27, 2017
b34faed
Add `usePolyfill` option to default workers
EtienneLem Jul 27, 2017
a216997
[dist]
EtienneLem Jul 27, 2017
5fed74f
Memoize worker per native/polyfill
EtienneLem Jul 27, 2017
22cb1eb
Use a Promise in WorkerPolyfill#importScripts
EtienneLem Jul 27, 2017
0fa08c8
[dist]
EtienneLem Jul 27, 2017
4b6456d
Add `timeout` option to Architect#ajax
EtienneLem Apr 30, 2018
1115988
Use XHR’s specific events instead of `onreadystatechange`
EtienneLem May 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Gemfile.lock
build
node_modules
25 changes: 0 additions & 25 deletions CHANGELOG.md

This file was deleted.

2 changes: 0 additions & 2 deletions Gemfile

This file was deleted.

File renamed without changes.
53 changes: 0 additions & 53 deletions Rakefile

This file was deleted.

73 changes: 0 additions & 73 deletions app/assets/javascripts/architect.coffee.erb

This file was deleted.

2 changes: 0 additions & 2 deletions app/assets/javascripts/architect/version.coffee.erb

This file was deleted.

27 changes: 0 additions & 27 deletions app/assets/javascripts/architect/worker.coffee

This file was deleted.

12 changes: 0 additions & 12 deletions app/assets/javascripts/architect/workers/ajax_worker.coffee

This file was deleted.

21 changes: 0 additions & 21 deletions app/assets/javascripts/architect/workers/jsonp_worker.coffee

This file was deleted.

4 changes: 0 additions & 4 deletions app/assets/javascripts/architect/workers/proxy_worker.coffee

This file was deleted.

13 changes: 0 additions & 13 deletions app/assets/javascripts/workers/ajax_worker.coffee

This file was deleted.

9 changes: 0 additions & 9 deletions app/assets/javascripts/workers/jsonp_worker.coffee

This file was deleted.

21 changes: 0 additions & 21 deletions architect.gemspec

This file was deleted.

1 change: 1 addition & 0 deletions dist/architect.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions examples/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
var Architect = require('architect')
architect = new Architect()

//
// JSONP
//
// architect.jsonp({ url: 'https://api.github.com/users/etiennelem' })
// .then(function(e) { console.log('JSONP:', e) })
//
// architect.jsonp({ url: 'https://api.github.com/users/etiennelem' }, { usePolyfill: true })
// .then(function(e) { console.log('JSONP (Polyfill):', e) })
//
// architect.jsonp({ url: 'nope' })
// .then(function(e) { console.log('JSONP (Shouldn’t log):', e) })
// .catch(function(e) { console.log('JSONP Error:', e) })
//
// architect.jsonp({ url: 'nope' }, { usePolyfill: true })
// .then(function(e) { console.log('JSONP (Shouldn’t log):', e) })
// .catch(function(e) { console.log('JSONP Error (Polyfill):', e) })
//
// architect.jsonp({ url: 'http://foo' }, { usePolyfill: true })
// .then(function(e) { console.log('JSONP (Shouldn’t log):', e) })
// .catch(function(e) { console.log('JSONP Error (Polyfill):', e) })

//
// Ajax
//

// Error
architect.ajax({ url: 'https://foo' })
.then(() => { throw 'Should not throw' })
.catch(console.warn) // Has no `timeout`

// Timeout
architect.ajax({ url: 'https://httpbin.org/get', dataType: 'json', timeout: 16 })
.then(() => { throw 'Should not throw' })
.catch(console.warn) // Has `timeout`

// Success
architect.ajax({ url: 'https://httpbin.org/get', dataType: 'json' })
.then(console.log)
.catch(() => { throw 'Should not throw' })

//
// Custom
//
// architect.work({
// type: 'foozle',
// data: 'foo',
// fn: function(data) {
// return (data + 'zle').toUpperCase()
// },
// }).then(function(e) { console.log('CUSTOM:', e) })
//
// architect.work({
// type: 'bar',
// data: 'foo',
// fn: `function(data) {
// return (data + 'bar')
// }`,
// }).then(function(e) { console.log('CUSTOM (STRING FN):', e) })
//
// architect.work({
// type: 'promise',
// data: 'foo',
// fn: function(data) {
// return new Promise(function(resolve, reject) {
// setTimeout(function() {
// resolve(data + 'zle')
// }, 1000)
// })
// },
// }).then(function(e) { console.log('CUSTOM (Promise):', e) })

//
// $.ajax style
//
// architect.ajax({
// url: 'https://api.github.com/users/etiennelem',
// dataType: 'json',
// success: function(e) { console.log('AJAX:', e) }
// })
9 changes: 9 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Architect: Examples</title>
</head>
<body>
<script src="/build/examples.js"></script>
</body>
</html>
Loading