statebus 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +10 -5
- package/package.json +2 -2
- package/server.js +8 -5
package/client.js
CHANGED
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
function braid_http_mount (prefix, url) {
|
|
62
|
+
throw "Sorry, braid_http_mount is disabled! Tell mike you're using it, and he'll re-enable it."
|
|
63
|
+
|
|
62
64
|
var preprefix = prefix.slice(0,-1)
|
|
63
65
|
var has_prefix = new RegExp('^' + preprefix)
|
|
64
66
|
var is_absolute = /^https?:\/\//
|
|
@@ -553,12 +555,15 @@
|
|
|
553
555
|
improve_react()
|
|
554
556
|
window.ignore_flashbacks = false
|
|
555
557
|
if (statebus_server !== 'none') {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
558
|
+
// Disable "braid_mode" for now
|
|
559
|
+
if (clientjs_option('braid_mode'))
|
|
560
|
+
console.log('braid_mode is disabled for now. Tell mike that you\'re using it, and he\'ll re-enable it!')
|
|
561
|
+
// if (clientjs_option('braid_mode')) {
|
|
562
|
+
// console.log('Using Braid-HTTP!')
|
|
563
|
+
// braid_http_mount ('/*', statebus_server)
|
|
564
|
+
// } else {
|
|
560
565
|
bus.net_mount ('/*', statebus_server)
|
|
561
|
-
}
|
|
566
|
+
// }
|
|
562
567
|
}
|
|
563
568
|
|
|
564
569
|
if (window.statebus_backdoor) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "statebus",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"description": "Synchronize state.",
|
|
5
5
|
"main": "statebus.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"repository": "invisible-college/statebus",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"bcrypt-nodejs": "0.0.3",
|
|
20
|
-
"
|
|
20
|
+
"braid-http": "^1.3.82",
|
|
21
21
|
"chokidar": "^4.0.3",
|
|
22
22
|
"coffeescript": "^2.3.1",
|
|
23
23
|
"cookie": "^0.3.1",
|
package/server.js
CHANGED
|
@@ -3,8 +3,8 @@ var fs = require('fs'),
|
|
|
3
3
|
|
|
4
4
|
// Import braidify if it's available
|
|
5
5
|
try {
|
|
6
|
-
var braidify = require('
|
|
7
|
-
console.log('Found
|
|
6
|
+
var braidify = require('braid-http').http_server
|
|
7
|
+
console.log('Found braid-http library. Braid-HTTP enabled!')
|
|
8
8
|
} catch (e) {
|
|
9
9
|
var braidify = undefined
|
|
10
10
|
}
|
|
@@ -219,7 +219,10 @@ function import_server (bus, options)
|
|
|
219
219
|
res.end()
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
|
|
222
|
+
// Braidify the request
|
|
223
|
+
braidify && braidify(req, res); if (req.is_multiplexer) return
|
|
224
|
+
|
|
225
|
+
// Handle subscription
|
|
223
226
|
if (req.subscribe) {
|
|
224
227
|
res.startSubscription({ onClose: end_it_all })
|
|
225
228
|
console.log('yay subscription!')
|
|
@@ -237,7 +240,7 @@ function import_server (bus, options)
|
|
|
237
240
|
// Note: if body === undefined, we need to send the
|
|
238
241
|
// equivalent of a 404. This is missing in braid spec:
|
|
239
242
|
// https://github.com/braid-org/braid-spec/issues/110
|
|
240
|
-
res.
|
|
243
|
+
res.sendUpdate({body: body || 'null'})
|
|
241
244
|
|
|
242
245
|
// Or just return the current version
|
|
243
246
|
else {
|
|
@@ -2416,7 +2419,7 @@ function import_server (bus, options)
|
|
|
2416
2419
|
'statebus.js', 'client.js'].map((f) => fs.readFileSync('node_modules/statebus/' + f))
|
|
2417
2420
|
if (bus.options.braid_mode)
|
|
2418
2421
|
files.unshift(fs.readFileSync(
|
|
2419
|
-
'node_modules/
|
|
2422
|
+
'node_modules/braid-http/braid-http-client.js'
|
|
2420
2423
|
))
|
|
2421
2424
|
res.send(files.join(';\n'))
|
|
2422
2425
|
})
|