@cendarsoss/pusher-js 8.4.11

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.
Files changed (425) hide show
  1. package/.editorconfig +14 -0
  2. package/.github/ISSUE_TEMPLATE.md +11 -0
  3. package/.github/PULL_REQUEST_TEMPLATE.md +14 -0
  4. package/.github/dependabot.yml +14 -0
  5. package/.github/stale.yml +26 -0
  6. package/.github/workflows/release.yml +112 -0
  7. package/.github/workflows/release_pr.yml +43 -0
  8. package/.github/workflows/run-tests.yml +62 -0
  9. package/.gitmodules +3 -0
  10. package/.prettierrc +2 -0
  11. package/CHANGELOG.md +928 -0
  12. package/DELTA_COMPRESSION.md +365 -0
  13. package/DELTA_USAGE.md +179 -0
  14. package/IMPLEMENTATION_SUMMARY.md +261 -0
  15. package/IMPORT_GUIDE.md +638 -0
  16. package/LIBRARY_STRUCTURE_ANALYSIS.md +940 -0
  17. package/LICENCE +19 -0
  18. package/Makefile +14 -0
  19. package/README.md +709 -0
  20. package/TAG_FILTERING_CLIENT.md +471 -0
  21. package/bower.json +19 -0
  22. package/bun.lock +2695 -0
  23. package/dist/node/filter.js +252 -0
  24. package/dist/node/filter.js.map +1 -0
  25. package/dist/node/pusher.js +4434 -0
  26. package/dist/node/pusher.js.map +1 -0
  27. package/dist/web/filter.mjs +252 -0
  28. package/dist/web/filter.mjs.map +1 -0
  29. package/dist/web/pusher.mjs +5889 -0
  30. package/dist/web/pusher.mjs.map +1 -0
  31. package/examples/delta-compression-example.html +372 -0
  32. package/examples/delta-seamless-example.html +185 -0
  33. package/index.d.ts +36 -0
  34. package/integration_tests_server/index.js +176 -0
  35. package/integration_tests_server/package-lock.json +1177 -0
  36. package/integration_tests_server/package.json +15 -0
  37. package/interactive/.env +16 -0
  38. package/interactive/CONFLATION_TEST.md +73 -0
  39. package/interactive/DELTA_COMPRESSION_TESTING.md +262 -0
  40. package/interactive/bun.lock +208 -0
  41. package/interactive/package-lock.json +1075 -0
  42. package/interactive/package.json +32 -0
  43. package/interactive/public/app.js +1363 -0
  44. package/interactive/public/bundle-entry.js +14 -0
  45. package/interactive/public/conflation-test.html +508 -0
  46. package/interactive/public/conflation-test.js +785 -0
  47. package/interactive/public/delta-compression.js +1090 -0
  48. package/interactive/public/dist/bundle.js +5857 -0
  49. package/interactive/public/index.html +392 -0
  50. package/interactive/public/main.js +20 -0
  51. package/interactive/public/style.css +823 -0
  52. package/interactive/server.js +246 -0
  53. package/interactive/test-bundle.html +89 -0
  54. package/interactive/test-delta.js +146 -0
  55. package/node.js +1 -0
  56. package/package.json +94 -0
  57. package/pusher-with-encryption/index.js +1 -0
  58. package/react-native/index.d.ts +29 -0
  59. package/react-native/index.js +1 -0
  60. package/spec/config/jasmine/helpers/reporter.js +14 -0
  61. package/spec/config/jasmine/integration.json +13 -0
  62. package/spec/config/jasmine/unit.json +13 -0
  63. package/spec/config/jasmine/webpack.integration.js +33 -0
  64. package/spec/config/jasmine/webpack.unit.js +30 -0
  65. package/spec/config/karma/available_browsers.json +4957 -0
  66. package/spec/config/karma/config.ci.js +25 -0
  67. package/spec/config/karma/config.common.js +50 -0
  68. package/spec/config/karma/config.integration.js +26 -0
  69. package/spec/config/karma/config.unit.js +10 -0
  70. package/spec/config/karma/config.worker.js +34 -0
  71. package/spec/config/karma/integration.js +24 -0
  72. package/spec/config/karma/unit.js +20 -0
  73. package/spec/javascripts/helpers/mocks.js +274 -0
  74. package/spec/javascripts/helpers/node/integration.js +33 -0
  75. package/spec/javascripts/helpers/node/mock-dom-dependencies.ts +1 -0
  76. package/spec/javascripts/helpers/pusher_integration.js +1 -0
  77. package/spec/javascripts/helpers/pusher_integration_class.ts +12 -0
  78. package/spec/javascripts/helpers/timers/promises.js +9 -0
  79. package/spec/javascripts/helpers/waitsFor.js +37 -0
  80. package/spec/javascripts/helpers/web/integration.js +44 -0
  81. package/spec/javascripts/helpers/worker/mock-dom-dependencies.js +1 -0
  82. package/spec/javascripts/integration/core/cluster_config_spec.js +153 -0
  83. package/spec/javascripts/integration/core/falling_back_spec.js +195 -0
  84. package/spec/javascripts/integration/core/pusher_spec/index.js +68 -0
  85. package/spec/javascripts/integration/core/pusher_spec/test_builder.js +715 -0
  86. package/spec/javascripts/integration/core/timeout_configuration_spec.js +200 -0
  87. package/spec/javascripts/integration/core/transport_lists_spec.js +103 -0
  88. package/spec/javascripts/integration/index.node.js +12 -0
  89. package/spec/javascripts/integration/index.web.js +63 -0
  90. package/spec/javascripts/integration/index.worker.js +13 -0
  91. package/spec/javascripts/integration/web/dom/jsonp_spec.js +97 -0
  92. package/spec/javascripts/integration/web/dom/script_request_spec.js +90 -0
  93. package/spec/javascripts/polyfills/index.js +105 -0
  94. package/spec/javascripts/unit/core/channels/channel_spec.js +355 -0
  95. package/spec/javascripts/unit/core/channels/channels_spec.js +94 -0
  96. package/spec/javascripts/unit/core/channels/encrypted_channel_spec.js +343 -0
  97. package/spec/javascripts/unit/core/channels/presence_channel_spec.js +553 -0
  98. package/spec/javascripts/unit/core/channels/private_channel_spec.js +182 -0
  99. package/spec/javascripts/unit/core/config_spec.js +507 -0
  100. package/spec/javascripts/unit/core/connection/connection_manager_spec.js +656 -0
  101. package/spec/javascripts/unit/core/connection/connection_spec.js +286 -0
  102. package/spec/javascripts/unit/core/connection/handshake_spec.js +160 -0
  103. package/spec/javascripts/unit/core/connection/protocol_spec.js +420 -0
  104. package/spec/javascripts/unit/core/defaults_spec.js +26 -0
  105. package/spec/javascripts/unit/core/events_dispatcher_spec.js +385 -0
  106. package/spec/javascripts/unit/core/http/http_polling_socket_spec.js +60 -0
  107. package/spec/javascripts/unit/core/http/http_request_spec.js +185 -0
  108. package/spec/javascripts/unit/core/http/http_socket_spec.js +370 -0
  109. package/spec/javascripts/unit/core/http/http_streaming_socket_spec.js +56 -0
  110. package/spec/javascripts/unit/core/http/http_xhr_request_spec.js +164 -0
  111. package/spec/javascripts/unit/core/logger_spec.js +133 -0
  112. package/spec/javascripts/unit/core/pusher_spec.js +613 -0
  113. package/spec/javascripts/unit/core/pusher_with_encryption_spec.js +18 -0
  114. package/spec/javascripts/unit/core/strategies/best_connected_ever_strategy_spec.js +104 -0
  115. package/spec/javascripts/unit/core/strategies/delayed_strategy_spec.js +95 -0
  116. package/spec/javascripts/unit/core/strategies/first_connected_strategy_spec.js +68 -0
  117. package/spec/javascripts/unit/core/strategies/if_strategy_spec.js +165 -0
  118. package/spec/javascripts/unit/core/strategies/sequential_strategy_spec.js +213 -0
  119. package/spec/javascripts/unit/core/strategies/transport_strategy_spec.js +250 -0
  120. package/spec/javascripts/unit/core/strategies/websocket_prioritized_cached_strategy_spec.js +400 -0
  121. package/spec/javascripts/unit/core/timeline/timeline_spec.js +153 -0
  122. package/spec/javascripts/unit/core/transports/assistant_to_the_transport_manager_spec.js +223 -0
  123. package/spec/javascripts/unit/core/transports/hosts_and_ports_spec.js +85 -0
  124. package/spec/javascripts/unit/core/transports/transport_connection_spec.js +585 -0
  125. package/spec/javascripts/unit/core/transports/transport_manager_spec.js +64 -0
  126. package/spec/javascripts/unit/core/user_spec.js +303 -0
  127. package/spec/javascripts/unit/core/utils/periodic_timer_spec.js +74 -0
  128. package/spec/javascripts/unit/core/utils/timers_spec.js +157 -0
  129. package/spec/javascripts/unit/core/utils/url_store_spec.js +14 -0
  130. package/spec/javascripts/unit/core/watchlist_spec.js +48 -0
  131. package/spec/javascripts/unit/core_with_runtime/auth/channel_authorizer_spec.js +137 -0
  132. package/spec/javascripts/unit/core_with_runtime/auth/deprecated_channel_authorizer_spec.js +48 -0
  133. package/spec/javascripts/unit/core_with_runtime/auth/user_authorizer_spec.js +128 -0
  134. package/spec/javascripts/unit/core_with_runtime/readme.md +5 -0
  135. package/spec/javascripts/unit/index.node.js +11 -0
  136. package/spec/javascripts/unit/index.web.js +12 -0
  137. package/spec/javascripts/unit/index.worker.js +11 -0
  138. package/spec/javascripts/unit/isomorphic/transports/hosts_and_ports_spec.js +82 -0
  139. package/spec/javascripts/unit/isomorphic/transports/transports_spec.js +202 -0
  140. package/spec/javascripts/unit/node/timeline_sender_spec.js +83 -0
  141. package/spec/javascripts/unit/web/dom/dependency_loader_spec.js +249 -0
  142. package/spec/javascripts/unit/web/dom/jsonp_request_spec.js +130 -0
  143. package/spec/javascripts/unit/web/dom/script_receiver_factory_spec.js +68 -0
  144. package/spec/javascripts/unit/web/http/http_xdomain_request_spec.js +222 -0
  145. package/spec/javascripts/unit/web/pusher_authorizer_spec.js +64 -0
  146. package/spec/javascripts/unit/web/timeline/timeline_sender_spec.js +131 -0
  147. package/spec/javascripts/unit/web/transports/hosts_and_ports_spec.js +127 -0
  148. package/spec/javascripts/unit/web/transports/transports_spec.js +444 -0
  149. package/spec/javascripts/unit/worker/channel_authorizer_spec.js +156 -0
  150. package/spec/javascripts/unit/worker/timeline_sender_spec.js +76 -0
  151. package/src/core/auth/auth_transports.ts +18 -0
  152. package/src/core/auth/channel_authorizer.ts +64 -0
  153. package/src/core/auth/deprecated_channel_authorizer.ts +56 -0
  154. package/src/core/auth/options.ts +76 -0
  155. package/src/core/auth/user_authenticator.ts +62 -0
  156. package/src/core/base64.ts +49 -0
  157. package/src/core/channels/channel.ts +173 -0
  158. package/src/core/channels/channel_table.ts +7 -0
  159. package/src/core/channels/channels.ts +86 -0
  160. package/src/core/channels/encrypted_channel.ts +150 -0
  161. package/src/core/channels/filter.ts +342 -0
  162. package/src/core/channels/members.ts +80 -0
  163. package/src/core/channels/metadata.ts +5 -0
  164. package/src/core/channels/presence_channel.ts +113 -0
  165. package/src/core/channels/private_channel.ts +25 -0
  166. package/src/core/config.ts +189 -0
  167. package/src/core/connection/callbacks.ts +21 -0
  168. package/src/core/connection/connection.ts +160 -0
  169. package/src/core/connection/connection_manager.ts +371 -0
  170. package/src/core/connection/connection_manager_options.ts +14 -0
  171. package/src/core/connection/handshake/handshake_payload.ts +10 -0
  172. package/src/core/connection/handshake/index.ts +90 -0
  173. package/src/core/connection/protocol/action.ts +8 -0
  174. package/src/core/connection/protocol/message-types.ts +11 -0
  175. package/src/core/connection/protocol/protocol.ts +166 -0
  176. package/src/core/defaults.ts +66 -0
  177. package/src/core/delta/channel_state.ts +194 -0
  178. package/src/core/delta/decoders.ts +129 -0
  179. package/src/core/delta/index.ts +10 -0
  180. package/src/core/delta/manager.ts +504 -0
  181. package/src/core/delta/types.ts +60 -0
  182. package/src/core/errors.ts +69 -0
  183. package/src/core/events/callback.ts +6 -0
  184. package/src/core/events/callback_registry.ts +75 -0
  185. package/src/core/events/callback_table.ts +7 -0
  186. package/src/core/events/dispatcher.ts +84 -0
  187. package/src/core/http/ajax.ts +24 -0
  188. package/src/core/http/http_factory.ts +16 -0
  189. package/src/core/http/http_polling_socket.ts +24 -0
  190. package/src/core/http/http_request.ts +81 -0
  191. package/src/core/http/http_socket.ts +220 -0
  192. package/src/core/http/http_streaming_socket.ts +19 -0
  193. package/src/core/http/request_hooks.ts +9 -0
  194. package/src/core/http/socket_hooks.ts +11 -0
  195. package/src/core/http/state.ts +7 -0
  196. package/src/core/http/url_location.ts +6 -0
  197. package/src/core/logger.ts +66 -0
  198. package/src/core/options.ts +61 -0
  199. package/src/core/pusher-licence.js +7 -0
  200. package/src/core/pusher-with-encryption.js +1 -0
  201. package/src/core/pusher-with-encryption.ts +14 -0
  202. package/src/core/pusher.js +10 -0
  203. package/src/core/pusher.ts +412 -0
  204. package/src/core/reachability.ts +7 -0
  205. package/src/core/socket.ts +14 -0
  206. package/src/core/strategies/best_connected_ever_strategy.ts +81 -0
  207. package/src/core/strategies/delayed_strategy.ts +48 -0
  208. package/src/core/strategies/first_connected_strategy.ts +31 -0
  209. package/src/core/strategies/if_strategy.ts +34 -0
  210. package/src/core/strategies/sequential_strategy.ts +129 -0
  211. package/src/core/strategies/strategy.ts +8 -0
  212. package/src/core/strategies/strategy_builder.ts +67 -0
  213. package/src/core/strategies/strategy_options.ts +18 -0
  214. package/src/core/strategies/strategy_runner.ts +6 -0
  215. package/src/core/strategies/transport_strategy.ts +144 -0
  216. package/src/core/strategies/websocket_prioritized_cached_strategy.ts +157 -0
  217. package/src/core/timeline/level.ts +7 -0
  218. package/src/core/timeline/timeline.ts +90 -0
  219. package/src/core/timeline/timeline_sender.ts +33 -0
  220. package/src/core/timeline/timeline_transport.ts +11 -0
  221. package/src/core/transports/assistant_to_the_transport_manager.ts +104 -0
  222. package/src/core/transports/ping_delay_options.ts +7 -0
  223. package/src/core/transports/transport.ts +54 -0
  224. package/src/core/transports/transport_connection.ts +241 -0
  225. package/src/core/transports/transport_connection_options.ts +8 -0
  226. package/src/core/transports/transport_hooks.ts +16 -0
  227. package/src/core/transports/transport_manager.ts +52 -0
  228. package/src/core/transports/transports_table.ts +12 -0
  229. package/src/core/transports/url_scheme.ts +13 -0
  230. package/src/core/transports/url_schemes.ts +47 -0
  231. package/src/core/user.ts +186 -0
  232. package/src/core/util.ts +34 -0
  233. package/src/core/utils/collections.ts +353 -0
  234. package/src/core/utils/factory.ts +79 -0
  235. package/src/core/utils/flat_promise.ts +10 -0
  236. package/src/core/utils/timers/abstract_timer.ts +39 -0
  237. package/src/core/utils/timers/index.ts +39 -0
  238. package/src/core/utils/timers/scheduling.ts +11 -0
  239. package/src/core/utils/timers/timed_callback.ts +5 -0
  240. package/src/core/utils/url_store.ts +48 -0
  241. package/src/core/watchlist.ts +31 -0
  242. package/src/d.ts/constants/index.d.ts +5 -0
  243. package/src/d.ts/faye-websocket/faye-websocket.d.ts +21 -0
  244. package/src/d.ts/global/global.d.ts +1 -0
  245. package/src/d.ts/module/module.d.ts +12 -0
  246. package/src/d.ts/tweetnacl-util/index.d.ts +6 -0
  247. package/src/d.ts/window/events.d.ts +4 -0
  248. package/src/d.ts/window/sockjs.d.ts +3 -0
  249. package/src/d.ts/window/websocket.d.ts +4 -0
  250. package/src/d.ts/window/xmlhttprequest.d.ts +3 -0
  251. package/src/filter.ts +5 -0
  252. package/src/index.ts +8 -0
  253. package/src/runtimes/interface.ts +60 -0
  254. package/src/runtimes/isomorphic/auth/xhr_auth.ts +90 -0
  255. package/src/runtimes/isomorphic/default_strategy.ts +155 -0
  256. package/src/runtimes/isomorphic/http/http.ts +32 -0
  257. package/src/runtimes/isomorphic/http/http_xhr_request.ts +35 -0
  258. package/src/runtimes/isomorphic/runtime.ts +62 -0
  259. package/src/runtimes/isomorphic/timeline/xhr_timeline.ts +50 -0
  260. package/src/runtimes/isomorphic/transports/transport_connection_initializer.ts +19 -0
  261. package/src/runtimes/isomorphic/transports/transports.ts +83 -0
  262. package/src/runtimes/node/net_info.ts +10 -0
  263. package/src/runtimes/node/runtime.ts +68 -0
  264. package/src/runtimes/react-native/net_info.ts +42 -0
  265. package/src/runtimes/react-native/runtime.ts +65 -0
  266. package/src/runtimes/web/auth/jsonp_auth.ts +51 -0
  267. package/src/runtimes/web/browser.ts +24 -0
  268. package/src/runtimes/web/default_strategy.ts +201 -0
  269. package/src/runtimes/web/dom/dependencies.ts +16 -0
  270. package/src/runtimes/web/dom/dependency_loader.ts +93 -0
  271. package/src/runtimes/web/dom/json2.js +486 -0
  272. package/src/runtimes/web/dom/jsonp_request.ts +52 -0
  273. package/src/runtimes/web/dom/script_receiver.ts +8 -0
  274. package/src/runtimes/web/dom/script_receiver_factory.ts +57 -0
  275. package/src/runtimes/web/dom/script_request.ts +85 -0
  276. package/src/runtimes/web/http/http.ts +8 -0
  277. package/src/runtimes/web/http/http_xdomain_request.ts +37 -0
  278. package/src/runtimes/web/net_info.ts +50 -0
  279. package/src/runtimes/web/runtime.ts +174 -0
  280. package/src/runtimes/web/timeline/jsonp_timeline.ts +34 -0
  281. package/src/runtimes/web/transports/transport_connection_initializer.ts +39 -0
  282. package/src/runtimes/web/transports/transports.ts +67 -0
  283. package/src/runtimes/worker/auth/fetch_auth.ts +69 -0
  284. package/src/runtimes/worker/net_info.ts +10 -0
  285. package/src/runtimes/worker/runtime.ts +75 -0
  286. package/src/runtimes/worker/timeline/fetch_timeline.ts +39 -0
  287. package/tsconfig.json +18 -0
  288. package/types/spec/javascripts/helpers/node/mock-dom-dependencies.d.ts +1 -0
  289. package/types/spec/javascripts/helpers/pusher_integration_class.d.ts +4 -0
  290. package/types/src/core/auth/auth_transports.d.ts +9 -0
  291. package/types/src/core/auth/channel_authorizer.d.ts +3 -0
  292. package/types/src/core/auth/deprecated_channel_authorizer.d.ts +18 -0
  293. package/types/src/core/auth/options.d.ts +48 -0
  294. package/types/src/core/auth/user_authenticator.d.ts +3 -0
  295. package/types/src/core/base64.d.ts +1 -0
  296. package/types/src/core/channels/channel.d.ts +25 -0
  297. package/types/src/core/channels/channel_table.d.ts +5 -0
  298. package/types/src/core/channels/channels.d.ts +12 -0
  299. package/types/src/core/channels/encrypted_channel.d.ts +15 -0
  300. package/types/src/core/channels/filter.d.ts +33 -0
  301. package/types/src/core/channels/members.d.ts +14 -0
  302. package/types/src/core/channels/metadata.d.ts +4 -0
  303. package/types/src/core/channels/presence_channel.d.ts +13 -0
  304. package/types/src/core/channels/private_channel.d.ts +5 -0
  305. package/types/src/core/config.d.ts +31 -0
  306. package/types/src/core/connection/callbacks.d.ts +18 -0
  307. package/types/src/core/connection/connection.d.ts +16 -0
  308. package/types/src/core/connection/connection_manager.d.ts +50 -0
  309. package/types/src/core/connection/connection_manager_options.d.ts +11 -0
  310. package/types/src/core/connection/handshake/handshake_payload.d.ts +8 -0
  311. package/types/src/core/connection/handshake/index.d.ts +12 -0
  312. package/types/src/core/connection/protocol/action.d.ts +7 -0
  313. package/types/src/core/connection/protocol/message-types.d.ts +10 -0
  314. package/types/src/core/connection/protocol/protocol.d.ts +10 -0
  315. package/types/src/core/defaults.d.ts +26 -0
  316. package/types/src/core/delta/channel_state.d.ts +23 -0
  317. package/types/src/core/delta/decoders.d.ts +12 -0
  318. package/types/src/core/delta/index.d.ts +4 -0
  319. package/types/src/core/delta/manager.d.ts +27 -0
  320. package/types/src/core/delta/types.d.ts +50 -0
  321. package/types/src/core/errors.d.ts +28 -0
  322. package/types/src/core/events/callback.d.ts +5 -0
  323. package/types/src/core/events/callback_registry.d.ts +11 -0
  324. package/types/src/core/events/callback_table.d.ts +5 -0
  325. package/types/src/core/events/dispatcher.d.ts +14 -0
  326. package/types/src/core/http/ajax.d.ts +16 -0
  327. package/types/src/core/http/http_factory.d.ts +13 -0
  328. package/types/src/core/http/http_polling_socket.d.ts +3 -0
  329. package/types/src/core/http/http_request.d.ts +17 -0
  330. package/types/src/core/http/http_socket.d.ts +32 -0
  331. package/types/src/core/http/http_streaming_socket.d.ts +3 -0
  332. package/types/src/core/http/request_hooks.d.ts +6 -0
  333. package/types/src/core/http/socket_hooks.d.ts +8 -0
  334. package/types/src/core/http/state.d.ts +6 -0
  335. package/types/src/core/http/url_location.d.ts +5 -0
  336. package/types/src/core/logger.d.ts +11 -0
  337. package/types/src/core/options.d.ts +36 -0
  338. package/types/src/core/pusher-with-encryption.d.ts +5 -0
  339. package/types/src/core/pusher.d.ts +56 -0
  340. package/types/src/core/reachability.d.ts +5 -0
  341. package/types/src/core/socket.d.ts +12 -0
  342. package/types/src/core/strategies/best_connected_ever_strategy.d.ts +10 -0
  343. package/types/src/core/strategies/delayed_strategy.d.ts +15 -0
  344. package/types/src/core/strategies/first_connected_strategy.d.ts +8 -0
  345. package/types/src/core/strategies/if_strategy.d.ts +10 -0
  346. package/types/src/core/strategies/sequential_strategy.d.ts +16 -0
  347. package/types/src/core/strategies/strategy.d.ts +6 -0
  348. package/types/src/core/strategies/strategy_builder.d.ts +5 -0
  349. package/types/src/core/strategies/strategy_options.d.ts +16 -0
  350. package/types/src/core/strategies/strategy_runner.d.ts +5 -0
  351. package/types/src/core/strategies/transport_strategy.d.ts +15 -0
  352. package/types/src/core/strategies/websocket_prioritized_cached_strategy.d.ts +20 -0
  353. package/types/src/core/timeline/level.d.ts +6 -0
  354. package/types/src/core/timeline/timeline.d.ts +25 -0
  355. package/types/src/core/timeline/timeline_sender.d.ts +13 -0
  356. package/types/src/core/timeline/timeline_transport.d.ts +6 -0
  357. package/types/src/core/transports/assistant_to_the_transport_manager.d.ts +14 -0
  358. package/types/src/core/transports/ping_delay_options.d.ts +6 -0
  359. package/types/src/core/transports/transport.d.ts +8 -0
  360. package/types/src/core/transports/transport_connection.d.ts +35 -0
  361. package/types/src/core/transports/transport_connection_options.d.ts +6 -0
  362. package/types/src/core/transports/transport_hooks.d.ts +13 -0
  363. package/types/src/core/transports/transport_manager.d.ts +14 -0
  364. package/types/src/core/transports/transports_table.d.ts +10 -0
  365. package/types/src/core/transports/url_scheme.d.ts +11 -0
  366. package/types/src/core/transports/url_schemes.d.ts +4 -0
  367. package/types/src/core/user.d.ts +21 -0
  368. package/types/src/core/util.d.ts +8 -0
  369. package/types/src/core/utils/collections.d.ts +18 -0
  370. package/types/src/core/utils/factory.d.ts +29 -0
  371. package/types/src/core/utils/flat_promise.d.ts +6 -0
  372. package/types/src/core/utils/timers/abstract_timer.d.ts +10 -0
  373. package/types/src/core/utils/timers/index.d.ts +9 -0
  374. package/types/src/core/utils/timers/scheduling.d.ts +8 -0
  375. package/types/src/core/utils/timers/timed_callback.d.ts +4 -0
  376. package/types/src/core/utils/url_store.d.ts +4 -0
  377. package/types/src/core/watchlist.d.ts +8 -0
  378. package/types/src/runtimes/interface.d.ts +43 -0
  379. package/types/src/runtimes/isomorphic/auth/xhr_auth.d.ts +3 -0
  380. package/types/src/runtimes/isomorphic/default_strategy.d.ts +5 -0
  381. package/types/src/runtimes/isomorphic/http/http.d.ts +3 -0
  382. package/types/src/runtimes/isomorphic/http/http_xhr_request.d.ts +3 -0
  383. package/types/src/runtimes/isomorphic/runtime.d.ts +2 -0
  384. package/types/src/runtimes/isomorphic/timeline/xhr_timeline.d.ts +6 -0
  385. package/types/src/runtimes/isomorphic/transports/transport_connection_initializer.d.ts +1 -0
  386. package/types/src/runtimes/isomorphic/transports/transports.d.ts +5 -0
  387. package/types/src/runtimes/node/net_info.d.ts +6 -0
  388. package/types/src/runtimes/node/runtime.d.ts +3 -0
  389. package/types/src/runtimes/react-native/net_info.d.ts +8 -0
  390. package/types/src/runtimes/react-native/runtime.d.ts +3 -0
  391. package/types/src/runtimes/web/auth/jsonp_auth.d.ts +3 -0
  392. package/types/src/runtimes/web/browser.d.ts +19 -0
  393. package/types/src/runtimes/web/default_strategy.d.ts +5 -0
  394. package/types/src/runtimes/web/dom/dependencies.d.ts +4 -0
  395. package/types/src/runtimes/web/dom/dependency_loader.d.ts +10 -0
  396. package/types/src/runtimes/web/dom/jsonp_request.d.ts +10 -0
  397. package/types/src/runtimes/web/dom/script_receiver.d.ts +7 -0
  398. package/types/src/runtimes/web/dom/script_receiver_factory.d.ts +10 -0
  399. package/types/src/runtimes/web/dom/script_request.d.ts +9 -0
  400. package/types/src/runtimes/web/http/http.d.ts +2 -0
  401. package/types/src/runtimes/web/http/http_xdomain_request.d.ts +3 -0
  402. package/types/src/runtimes/web/net_info.d.ts +7 -0
  403. package/types/src/runtimes/web/runtime.d.ts +3 -0
  404. package/types/src/runtimes/web/timeline/jsonp_timeline.d.ts +6 -0
  405. package/types/src/runtimes/web/transports/transport_connection_initializer.d.ts +1 -0
  406. package/types/src/runtimes/web/transports/transports.d.ts +2 -0
  407. package/types/src/runtimes/worker/auth/fetch_auth.d.ts +3 -0
  408. package/types/src/runtimes/worker/net_info.d.ts +6 -0
  409. package/types/src/runtimes/worker/runtime.d.ts +3 -0
  410. package/types/src/runtimes/worker/timeline/fetch_timeline.d.ts +6 -0
  411. package/vite.config.js +52 -0
  412. package/vite.config.node.js +72 -0
  413. package/webpack/config.node.js +26 -0
  414. package/webpack/config.react-native.js +35 -0
  415. package/webpack/config.shared.js +50 -0
  416. package/webpack/config.web.js +36 -0
  417. package/webpack/config.worker.js +42 -0
  418. package/webpack/dev.server.js +17 -0
  419. package/webpack/hosting_config.js +6 -0
  420. package/with-encryption/index.d.ts +29 -0
  421. package/with-encryption/index.js +4 -0
  422. package/worker/index.d.ts +29 -0
  423. package/worker/index.js +1 -0
  424. package/worker/with-encryption/index.d.ts +29 -0
  425. package/worker/with-encryption/index.js +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,928 @@
1
+ # Changelog
2
+
3
+ ## 8.4.0
4
+
5
+ - [CHANGED] Dependencies minor versions updated to latest versions
6
+
7
+ ## 8.3.0
8
+
9
+ - [CHANGED] Update cached re-connect strategy to prioritize WebSocket
10
+
11
+ ## 8.2.0
12
+
13
+ - [CHANGED] Remove WebSocket retry limit.
14
+
15
+ ## 8.1.0
16
+
17
+ - [CHANGED] Move @types dependencies to devDependencies
18
+ - [CHANGED] Upgrade typescript to 5.1.3
19
+
20
+ ## 8.0.2
21
+
22
+ - [CHANGED] Fix React Native support.
23
+
24
+ ## 8.0.1
25
+
26
+ - [FIXED] Fix 'window is not defined' error in the worker context
27
+ - [FIXED] Specify the right status when an error is thrown for the pusher worker instance
28
+
29
+ ## 8.0.0
30
+
31
+ - [CHANGED] Specifying a cluster when instantiating the Pusher object is now mandatory. An exception is thrown if the cluster setting is missing.
32
+
33
+ ## 7.6.0
34
+
35
+ - [ADDED] Introduce headersProvider and paramsProvider to channel authorization and user authentication in order to allow for changing header and param values after the Pusher object is initialized.
36
+
37
+ ## 7.5.0
38
+
39
+ - [ADDED] Watchlist Online Status
40
+
41
+ ## 7.4.1
42
+
43
+ - [CHANGED] Authorization error message.
44
+
45
+ ## 7.4.0
46
+
47
+ * [CHANGED] Use secure random generator instead of pseudo-random generator
48
+ * [CHANGED] Replace git protocol with HTTPS in gitsubmodules file
49
+ * [ADDED] Allow presence channel authorization to depend on user authentication
50
+
51
+ ## 7.3.0
52
+
53
+ * [FIXED] Restore previously exported types
54
+
55
+ ## 7.2.0
56
+
57
+ * [ADDED] Add support for subscription_count event
58
+
59
+ ## 7.1.1-beta
60
+
61
+ [FIXED] Exported Typescript types in index.d.ts
62
+
63
+ ## 7.1.0-beta
64
+
65
+ [ADDED] Support for authenticating users with the `signin` method
66
+
67
+ [ADDED] Support for binding to events sent to a specific authenticated user
68
+
69
+ [UPDATED] The initialization of the `Pusher` object has been changed. Two new parameters were introduced: `userAuthentication` and `channelAuthorization`.
70
+
71
+ [DEPRECATED] The Pusher object parameters `auth`, `authEndpoint`, and `authTransport` are still supported, but deprecated. They have been replaced with the `channelAuthorization` parameter.
72
+
73
+ ## 7.0.6
74
+
75
+ * [FIXED] pusher-js/worker can now be bundled and used in a web worker context
76
+
77
+ ## 7.0.5
78
+
79
+ * [FIXED] pusher-js/worker is now built by webpack with umd libraryTarget, which
80
+ allows it to be bundled as described in the README
81
+
82
+ ## 7.0.4
83
+
84
+ * [FIXED] References to nonexistent source map #570
85
+
86
+ ## 7.0.3 (2021-01-25)
87
+
88
+ [UPDATED] Bumped version of faye-websocket (used only by the node runtime) from
89
+ 0.9.4 to 0.11.3. Thanks to @Akhawais for the PR.
90
+
91
+ [UPDATED] Bumped version of @react-native-community/netinfo (used only by the
92
+ react-native runtime) from 4.1.1 to 5.9.7. Thanks to @Yinabled for the PR.
93
+
94
+ [ADDED] We were missing a react-native key in `package.json`. Thanks to @giaset
95
+ for the PR
96
+
97
+ [ADDED] Support for importing the worker builds (solving issue #499)
98
+
99
+ ## 7.0.2 (2020-11-26)
100
+
101
+ [FIXED] Removes `AuthInfo` type from react-native and with-encryption builds.
102
+ This type was removed everywhere else in v7.0.0. See [issue
103
+ 512](https://github.com/pusher/pusher-js/issues/512)
104
+
105
+ ## 7.0.1 (2020-11-02)
106
+
107
+ [FIXED] Channels no longer get stuck in the `subscriptionPending` state
108
+ after a failed request to an auth endpoint. [Fixes Issue
109
+ 255](https://github.com/pusher/pusher-js/issues/255)
110
+
111
+ ## 7.0.0 (2020-07-30)
112
+
113
+ [UPDATED] Type signatures for authorizer callback. Previously the authorizer
114
+ callback had 2 arguments, the first was a boolean indicating that the second
115
+ was an error. Switched for a more conventional `function(err, data)` signature.
116
+ **This is a breaking change, if you use a custom authorizer**
117
+
118
+ [UPDATED] Types of errors emitted on `pusher:subscription_error` events.
119
+ Previously this event just contained the status code the auth endpoint
120
+ returned. This was replaced with a (hopefully) more error object with a message
121
+ and a `status` key.
122
+ **This is a breaking change, if you depend on the status in the
123
+ `pusher:subscription_error` event**
124
+
125
+ [FIXED] Stop wrapping websocket errors multiple times. [Fixes issue
126
+ 464](https://github.com/pusher/pusher-js/issues/464)
127
+ **This might be a breaking change, if you depend on the structure of `'error'` events
128
+ emitted by `pusher.connection`**
129
+
130
+ [FIXED] Stop swallowing errors thrown by handlers on encrypted channels.
131
+ Previously errors thrown by handlers bound to encrypted channels were caught
132
+ and ignored. This was unintentional and undesirable. [Fixes Issue
133
+ 437](https://github.com/pusher/pusher-js/issues/437)
134
+
135
+ ## 6.0.3 (2020-05-14)
136
+
137
+ [FIXED] Added typescript declarations for the pusher-js/with-encryption build
138
+
139
+ [REMOVED] Unnecessary dummy tweetnacl types for react-native (thanks to
140
+ @dmitrybirin)
141
+
142
+ [UPDATED] Copyright years (thanks to @annzenkina)
143
+
144
+ ## 6.0.2 (2020-04-30)
145
+
146
+ [FIXED] React-native import broken in release 6.0.1
147
+
148
+ ## 6.0.1 (2020-04-30)
149
+
150
+ [CHANGED] Moved tweetnacl from `devDependencies` to `dependencies`. No
151
+ additional code is included in the bundle, but this gives the typescript
152
+ compiler access to the tweetnacl types
153
+
154
+ [FIXED] Typescript declarations for react-native. These were supposed to be
155
+ included in 6.0.0 but the commit was missed
156
+
157
+ ## 6.0.0 (2020-04-27)
158
+
159
+ [CHANGED] The default builds for web and worker no longer support encrypted
160
+ channels. To use encrypted channels in web/worker you must import
161
+ `pusher-js/with-encryption` or use the
162
+ `pusher-with-encryption.js`/`pusher-with-encryption.min.js` bundles
163
+
164
+ [CHANGED] `forceTLS` now defaults to `true`
165
+
166
+ [REMOVED] the `encrypted` option - this was deprecated in `4.3.0`. The library
167
+ defaults to TLS anyway. Setting `encrypted` to `false` will **NOT** change
168
+ behaviour
169
+
170
+ [FIXED] `activityTimeout` and `pongTimeout` options now work as described in
171
+ the docs.
172
+
173
+ [NEW] Typescript declarations for react-native
174
+
175
+ [NEW] Support for encrypted-channels in react-native and workers
176
+
177
+ ## 5.1.1 (2020-02-12)
178
+
179
+ [FIXED] An issue with typescript declarations which caused builds to fail on
180
+ typescript projects dependent on pusher-js
181
+
182
+ ## 5.1.0 (2020-02-11)
183
+
184
+ [NEW] Include typescript declarations
185
+
186
+ [CHANGED] Make stats opt in rather than opt out - Previously we sent some
187
+ metrics about connection strategies to stats.pusher.com by default, it could be
188
+ disabled by passing the `disableStats` option. This functionality is now off by
189
+ default and can be enabled by passing the `enableStats` option
190
+
191
+ [FIXED] An issue where local tests would hang for 300s if a browser wasn't
192
+ available
193
+
194
+ ## 5.0.3 (2019-11-18)
195
+
196
+ [NEW] Log a warning when there is an auth error
197
+
198
+ [CHANGED] Default logger now uses console.warn and console.error
199
+
200
+ [CHANGED] Improved log messages
201
+
202
+ ## 5.0.2 (2019-09-25)
203
+
204
+ [FIXED] Utilise new API for @react-native-community/netinfo suppressing
205
+ deprecation warnings
206
+
207
+ [CHANGED] output an ES6 module from typescript to allow webpack to optimise the
208
+ bundle more effectively (thanks to @stof for this change)
209
+
210
+ [CHANGED] Use prettier to format source
211
+
212
+ ## 5.0.1 (2019-09-02)
213
+
214
+ [FIXED] We no longer include an unnecessary Buffer polyfill in bundles
215
+
216
+ ## 5.0.0 (2019-07-19)
217
+
218
+ This is a major version bump but should only contain breaking change for
219
+ react-native users.
220
+
221
+ [CHANGED] The react-native build now assumes @react-native-community/netinfo is
222
+ available in the host project. This change was necessary since netinfo was
223
+ removed from react-native core.
224
+
225
+ [CHANGED] The reconnect strategy is no longer built with a DSL. This makes the
226
+ code much more easily optimised by the javascript engine and should improve
227
+ load times significantly. Thanks to @stof for his contribution.
228
+
229
+ [CHANGED] The project is now built with recent versions of webpack and
230
+ typescript. All other build deps were updated and the build process was
231
+ simplified.
232
+
233
+ [FIXED] An issue that broke encrypted channels in node has been resolved
234
+
235
+ [FIXED] Some consistently flaky tests were fixed and we switched to headless
236
+ browsers for test runs where possible (including in CI).
237
+
238
+ [CHANGED] The node dependencies are now bundled in the node dist file so that
239
+ web/react-native users don't need to install unnecessary dependencies
240
+
241
+ ## 4.4.0 (2019-02-14)
242
+
243
+ [NEW] Callbacks bound to client events on presence channels will be called with an extra argument containing the `user_id` of the message sender
244
+
245
+ [NEW] Warn when trying to trigger client-events to a channel that isn't subscribed
246
+
247
+ ## 4.3.1 (2018-09-03)
248
+
249
+ [FIXED] Honour protocol error codes received after connection succeeds
250
+
251
+ ## 4.3.0 (2018-08-13)
252
+
253
+ [NEW] This release adds support for end to end encrypted channels, a new feature for Channels. Read more [in our docs](https://pusher.com/docs/client_api_guide/client_encrypted_channels).
254
+
255
+ [DEPRECATED] Renamed `encrypted` option to `forceTLS` - `encrypted` will still work!
256
+
257
+ ## 4.2.2 (2018-01-04)
258
+
259
+ [FIXED] Do not warn about a missing cluster when the host is explicitly set.
260
+
261
+ [FIXED] Only log with a custom logger when configured (prevents double
262
+ logging).
263
+
264
+ [FIXED] Update React Native NetInfo usage due to deprecated modules.
265
+
266
+ [NEW] Add `wsPath` option (see README.md for details).
267
+
268
+ Many thanks to @sunweiyang, @rajivm and @WillSewell for their contributions!
269
+
270
+ ## 4.2.1 (2017-09-28)
271
+
272
+ [FIXED] Correct version numbers in file headers (v4.2.0 still showed 4.1.0).
273
+
274
+ ## 4.2.0 (2017-09-28)
275
+
276
+ [FIXED] Fixed an issue where pusher-js would not attempt to subscribe to
277
+ channels that were in the process of being subscribed to when the connection
278
+ failed.
279
+
280
+ [FIXED] Does not attempt to call `handlesActivityChecks` on an undefined
281
+ connection instance anymore. Fixes issues #82 and #233.
282
+
283
+ [NEW] More helpful error messages can now be logged, with URLs.
284
+
285
+ [CHANGED] Various improvements in README.md.
286
+
287
+ Many thanks to @hengwoon, @leesio, @juliangruber and Heng for their
288
+ contributions to this release!
289
+
290
+ ## 4.1.0 (2017-04-20)
291
+
292
+ [NEW] Enable custom authorizers. For more information,
293
+ [see here](https://github.com/pusher/pusher-js#authorizer-function).
294
+
295
+ [NEW] Send credentials with Fetch requests in workers.
296
+
297
+ [NEW] Replace main file with Node.js version and add new browser field. This
298
+ also makes `require('pusher-js')` work out of the box.
299
+
300
+ [FIXED] Change `.done` to `.then` in React Native.
301
+
302
+ [FIXED] Include minified files when installing with Bower.
303
+
304
+ [CHANGED] Change `pusher` to `socket` for instance names in the readme.
305
+
306
+ Many thanks to @ejlangev, @piperchester, @wawyed, @mgalgs, @jamesfisher,
307
+ @kubik369 & @mrbabbs for their contributions to this release!
308
+
309
+ ## 4.0.0 (2016-12-01)
310
+
311
+ New major version released due to breaking changes.
312
+
313
+ [CHANGED] rename bind_all to bind_global
314
+
315
+ [NEW] unbind_global to remove global bindings
316
+
317
+ [CHANGED] unbind_all now removes global bindings as well as event specific
318
+
319
+ [NEW] expose context to pusher level bindings
320
+
321
+ ## 3.2.4 (2016-10-29)
322
+
323
+ [FIXED] Subscriptions are reinstated correctly after a disconnection and
324
+ reconnection. Regression introduced in 3.2.3.
325
+
326
+ ## 3.2.3 (2016-10-22)
327
+
328
+ [NEW] Cancelled subscriptions are now re-instated on subsequent `subscribe`
329
+ calls, allowing arbitrary chains of `subscribe`/`unsubscribe` calls, where the
330
+ final method is always respected regardless of the timings.
331
+ See [PR 201](https://github.com/pusher/pusher-js/pull/201) for details.
332
+
333
+ ## 3.2.2 (2016-10-03)
334
+
335
+ [FIXED] Fix unsubscribe behaviour while subscription is pending (thanks to @hot-leaf-juice).
336
+
337
+ ## 3.2.1 (2016-08-02)
338
+
339
+ [FIXED] Removes instances of evalling for global scope in timers module.
340
+
341
+ ## 3.2.0 (2016-08-01)
342
+
343
+ [FIXED] CSP Issue with 3.1 in Chrome extension background context. #168
344
+
345
+ [FIXED] Stringifying circular JSON structures for React Native. #182
346
+
347
+ [NEW] Add a new global unbind method.
348
+
349
+ [INTERNAL] Uses webpack define plugin to specify the global for each runtime.
350
+
351
+ ## 3.1.0 (2016-05-08)
352
+
353
+ [NEW] New builds for ReactNative, NodeJS and Web Workers. The first two are available on NPM. The last is available as a download.
354
+
355
+ [FIXED] The library no longer swallows connected exceptions. (#105)
356
+
357
+ [FIXED] Callback removal issues in Safari 9 (#125 #129)
358
+
359
+ [CHANGED] Monkey-patching the DependencyLoader when self-hosting no longer supported. New steps in README.
360
+
361
+ [CHANGED] HTTP fallbacks are now included as part of the main file and are not therefore dynamically loaded.
362
+
363
+ [INTERNAL] Ported to TypeScript.
364
+
365
+ [INTERNAL] The library is split into a core directory and a runtimes directory to make a separation between platform-independent and platform-specific code.
366
+
367
+ [INTERNAL] Uses Webpack as a bundler.
368
+
369
+ [INTERNAL] Testing suites for NodeJS and workers.
370
+
371
+ [INTERNAL] TravisCI + Browserstack setup.
372
+
373
+ [INTERNAL] NodeJS and ReactNative builds use XMLHttpRequest polyfills for authorization and session timelines. Workers use the `fetch` API.
374
+
375
+ ## 3.1.0-pre
376
+
377
+ [NEW] Added Pusher.logToConsole to log to console as a short-hand for writing a Pusher.log function to do so
378
+
379
+ ## 3.0.0 (2015-04-23)
380
+
381
+ [NEW] Introduce package.json, pusher-js will be published on NPM !
382
+
383
+ [NEW] added header/footer for UMD, allows CommonJS loaders to use pusher-js
384
+
385
+ [CHANGED] Remove the Flash fallback
386
+
387
+ [FIXED] double-unsubscribe is now idempotent
388
+
389
+ [FIXED] Serve only distribution files via Bower
390
+
391
+ [INTERNAL] Cleaned up a lot of the build process, makes contributing easier
392
+
393
+ ## 2.2.4 (2015-02-13)
394
+
395
+ [FIXED] Dependency loader not using HTTPS for encrypted connections on pages loaded via HTTP
396
+
397
+ ## 2.2.3 (2014-09-10)
398
+
399
+ [FIXED] Wrong encoding of HTTP heartbeats
400
+
401
+ [FIXED] Missing httpPath parameter for sockjs transport
402
+
403
+ [FIXED] Auth query strings no longer start with `&`
404
+
405
+ ## 2.2.2 (2014-06-09)
406
+
407
+ [CHANGED] Updated the HTTPS CDN URL to `https://js.pusher.com`
408
+
409
+ ## 2.2.1 (2014-05-28)
410
+
411
+ [FIXED] Exception triggered by ping being sent when disconnected
412
+
413
+ ## 2.2.0 (2014-04-14)
414
+
415
+ No changes since 2.2.0-rc3, just changed the version number.
416
+
417
+ ## 2.2.0-rc3 (2014-03-26)
418
+
419
+ [NEW] Added third argument to the bind method on event emitters to allow binding of context to callbacks
420
+
421
+ [CHANGED] Changed the primary WebSocket fallback to WSS instead of HTTP
422
+
423
+ [FIXED] Exception when aborting timers, which caused infinite connection loop on IE8
424
+
425
+ ## 2.2.0-rc2 (2014-02-25)
426
+
427
+ [NEW] Dependency loader will retry fetching additional resources if they fail to load
428
+
429
+ [CHANGED] Refactored internals to reduce main file size by over 1KB
430
+
431
+ [CHANGED] Improved heartbeat handling for HTTP transports
432
+
433
+ [CHANGED] Removed wssHost and httpsHost options, reverted to a single domain regardless of encryption
434
+
435
+ [CHANGED] Added extra 1s to the cached transport timeout
436
+
437
+ [CHANGED] Updated the stats protocol
438
+
439
+ [FIXED] MozWebSocket is not assigned to WebSocket anymore
440
+
441
+ [FIXED] Socket listeners are always unbound after closing the connection
442
+
443
+ ## 2.2.0-rc1 (2014-01-14)
444
+
445
+ [NEW] XHR streaming and polling transports were extracted from SockJS
446
+
447
+ [NEW] Reduced the number of roundtrips required by HTTP streaming and polling transports for connecting from 3 to 1
448
+
449
+ [NEW] Refactored the connection strategy to be faster and more reliable for clients using HTTP
450
+
451
+ [NEW] Added new options - `wssHost` and `httpsHost` for encrypted connections
452
+
453
+ [NEW] HTTP streaming and polling are now supported on Opera
454
+
455
+ [CHANGED] Reduced the size of sockjs.js
456
+
457
+ [FIXED] Issue with SockJS streaming not being able to reconnect
458
+
459
+ ## 2.1.6 (2014-01-09)
460
+
461
+ [NEW] Ping on offline events to detect disconnections quicker
462
+
463
+ [CHANGED] Added an exception when handshake does not contain the activity timeout
464
+
465
+ [FIXED] Encrypted transports not being cached correctly
466
+
467
+ ## 2.1.5 (2013-12-16)
468
+
469
+ [NEW] Server can suggest a lower activity timeout in the handshake
470
+
471
+ [CHANGED] Updated the protocol to version 7
472
+
473
+ [CHANGED] Transports are cached separately for encrypted connections
474
+
475
+ [CHANGED] Updated the stats protocol
476
+
477
+ [FIXED] Removed the `Protocol` variable leaking into the global scope
478
+
479
+ [FIXED] Flash check was occasionally raising exceptions on old Firefox releases
480
+
481
+ ## 2.1.4 (2013-11-26)
482
+
483
+ [NEW] Added the `Pusher.prototype.allChannels` method
484
+
485
+ [NEW] Implemented the `enabledTransports` option
486
+
487
+ [NEW] Implemented the `disabledTransports` option
488
+
489
+ [CHANGED] Connections are not closed anymore after receiving an offline event
490
+
491
+ [CHANGED] Connections are still attempted, even if the browser indicates it's offline
492
+
493
+ [CHANGED] When not connected, an online event will trigger a new connection attempt immediately
494
+
495
+ [CHANGED] Updated the stats protocol
496
+
497
+ ## 2.1.3 (2013-10-21)
498
+
499
+ [CHANGED] Updated the json2 library
500
+
501
+ [FIXED] Catch exceptions when accessing localStorage and parsing its contents
502
+
503
+ [FIXED] Flush transport cache if it's corrupted
504
+
505
+ [FIXED] Stop raising exceptions when stats requests fail
506
+
507
+ [CHANGED] Don't report stats when offline
508
+
509
+ [CHANGED] Raise an error when trying to send a client event without the `client-` prefix
510
+
511
+ ## 2.1.2 (2013-08-09)
512
+
513
+ [FIXED] Race condition in SockJS heartbeats
514
+
515
+ [FIXED] Exception in dependency loader when a file happens to be loaded twice
516
+
517
+ [CHANGED] Improved metric reporting
518
+
519
+ ## 2.1.1 (2013-07-08)
520
+
521
+ [FIXED] Disable transports that raise protocol errors
522
+
523
+ [FIXED] Keep trying all transports if a handshake raises an error
524
+
525
+ [CHANGED] Send less verbose error and closed event logs to stats
526
+
527
+ [FIXED] Add missing `connecting_in` event
528
+
529
+ [FIXED] Catch exceptions raised when accessing `window.localStorage` in some environments
530
+
531
+ ## 2.1.0 (2013-06-17)
532
+
533
+ [NEW] Added support for clusters
534
+
535
+ [CHANGED] All configuration options can be passed to the Pusher constructor
536
+
537
+ [DEPRECATED] Global configuration options should not be used anymore
538
+
539
+ [FIXED] SockJS issues on some versions of Opera
540
+
541
+ ## 2.0.5 (2013-05-28)
542
+
543
+ [FIXED] Working connections being closed when a parallel handshake failed in a specific way
544
+
545
+ [CHANGED] Warnings are always sent to Pusher.log if it's available
546
+
547
+ [FIXED] Handshake errors not being emitted
548
+
549
+ [FIXED] Authorizing two connections simultaneously to the same channel using JSONP
550
+
551
+ [CHANGED] Sending more detailed connection logs
552
+
553
+ ## 2.0.4 (2013-04-26)
554
+
555
+ [FIXED] Exception when WebSocket was closed uncleanly immediately after opening
556
+
557
+ [FIXED] Removed SockJS exception when receiving a handshake after closing the connection
558
+
559
+ ## 2.0.3 (2013-04-24)
560
+
561
+ [CHANGED] Transports are now considered working only after getting an initial message
562
+
563
+ [NEW] Added `ignoreNullOrigin` flag to Pusher constructor to ignore null origin checks in SockJS for PhoneGap
564
+
565
+ [FIXED] Exceptions in private browsing mode on (Mobile) Safari while caching transport info
566
+
567
+ [FIXED] Unbinding callback that hasn't been bound caused removal of last registered callback
568
+
569
+ [FIXED] Exceptions while closing connections in Safari
570
+
571
+ ## 2.0.2 (2013-04-16)
572
+
573
+ [FIXED] WebSockets not being disabled after rapid, unclean disconnections
574
+
575
+ ## 2.0.1 (2013-04-11)
576
+
577
+ [FIXED] Issues with disabling Flash transport
578
+
579
+ [FIXED] Error while checking for Flash support in some environments
580
+
581
+ [FIXED] Race condition on disconnections and retries
582
+
583
+ [FIXED] Reporting errors when connection was closed correctly
584
+
585
+ ## 2.0.0 (2013-03-19)
586
+
587
+ [CHANGED] Completely redesigned connection strategy
588
+
589
+ [CHANGED] HTTP fallbacks (built using SockJS) are now used if WebSockets and Flash transports both fail to connect (previously only used if neither WebSockets nor Flash were supported)
590
+
591
+ [NEW] Connection metrics are now submitted to Pusher's stats service
592
+
593
+ [NEW] Added disableFlash boolean option to Pusher constructor
594
+
595
+ [CHANGED] Updated web-socket-js and sockjs-client libraries
596
+
597
+ [FIXED] Improved HTTP fallback reliability
598
+
599
+ ## 1.12.7 (2013-02-25)
600
+
601
+ [CHANGED] Various improvements and fixes for HTTP fallbacks
602
+
603
+ ## 1.12.6 (2013-02-19)
604
+
605
+ [CHANGED] Flash is now detected before fetching fallback files
606
+
607
+ [CHANGED] Empty app key are now raising warnings
608
+
609
+ [FIXED] Fixed local variable leak
610
+
611
+ [FIXED] Reconnecting caused pusher:subscription_succeeded to be emitted more than once
612
+
613
+ ## 1.12.5 (2012-10-31)
614
+
615
+ [CHANGED] Improved connection timeout strategy.
616
+
617
+ ## 1.12.4 (2012-10-08)
618
+
619
+ [NEW] Added experimental fallback used when Flash fallback fails.
620
+
621
+ ## 1.12.3 (2012-10-01)
622
+
623
+ [FIXED] Error when Flash fallback files are served cross-domain.
624
+
625
+ ## 1.12.2 (2012-07-18)
626
+
627
+ [FIXED] Issues with Flash fallback when port 843 is blocked.
628
+
629
+ [FIXED] Binding to events with names of Object's native methods.
630
+
631
+ ## 1.12.1 (2012-05-03)
632
+
633
+ [CHANGED] The error argument passed into `socket.onerror()` is included with the error emitted to the user.
634
+
635
+ [FIXED] impermanentlyClosing to impermanentlyClosing state machine transition.
636
+
637
+ ## 1.12.0 (2012-04-14)
638
+
639
+ [NEW] Use `channel.members.me` to get the id and info for the local presence user. See the docs for more information: http://pusher.com/docs
640
+
641
+ [NEW] Send extra headers and query parameters with the private/presence channel authentication requests sent to your server. This is useful for, amongst other things, frameworks that require cross-site request forgery validation. See the docs for more information: http://pusher.com/docs
642
+
643
+ [FIXED] `channel.subscribed` not set to `false` when `disconnect` event occurs on the connection.
644
+
645
+ [UPGRADE] The linked version of web-socket-js. This includes a switch to the WebSocket version defined in RFC 6455. For the full list of changes in web-socket-js, see <https://github.com/gimite/web-socket-js/compare/bb5797cad5244dc86410e35726ef886bbc49afe9...2ee87e910e92f2366d562efebbbec96349924df3>.
646
+
647
+ [REMOVED] `channel.members.add()`, `channel.members.remove()` and `channel.members.clear()`.
648
+
649
+ ## 1.11.2 (2012-03-15)
650
+
651
+ [FIXED] Mobile Safari crashing after receiving data on closed connection.
652
+
653
+ [FIXED] Attempt to transition from impermanentlyClosing to connected.
654
+
655
+ ## 1.11.1 (2012-03-09)
656
+
657
+ [NEW] Unit tests run twice as fast.
658
+
659
+ [CHANGED] The reconnection attempt following a dropped connection will happen a minimum of one second after the connection was previously established.
660
+
661
+ [FIXED] Calling connect after some failed connection attempts means the attempt to connect is delayed.
662
+
663
+ [FIXED] Connection closing after calling disconnect is not emitted to the developer.
664
+
665
+ ## 1.11.0 (2012-01-03)
666
+
667
+ [NEW] You can now unbind from an event.
668
+
669
+ [NEW] Internal errors are now logged with `console.error` if available. You can override this behaviour by modifying the `Pusher.warn` function.
670
+
671
+ [NEW] Warning logged to `console.error` in the following cases: no api key supplied to initialiser, authentication failure connecting to private/presence channel, attempt to connect using `ws://` for application which have designated themselves as secure only, or unexpected errors returned by Pusher.
672
+
673
+ [NEW] Stale connections between the Pusher client and server are now detected and re-established.
674
+
675
+ [CHANGED] You may no longer bind to pusher_internal events.
676
+
677
+ [REMOVED] Pusher.Channel.is_private
678
+
679
+ [REMOVED] Pusher.Channel.is_presence
680
+
681
+ ## 1.10.1 (2011-12-1)
682
+
683
+ [NEW] Changed `channel.trigger()` to return a boolean indicating whether the message was actually sent.
684
+
685
+ [NEW] Private and public channels now emit `pusher:subscription_succeeded` events. This is consistent with presence channels.
686
+
687
+ [CHANGED] Renamed the `subscription_error` event to `pusher:subscription_error`.
688
+
689
+ ## 1.9.6 (2011-11-16)
690
+
691
+ [FIXED] Issue in Mozilla Firefox 8, where making a connection to non-ssl websocket endpoint from a secure page results in a security exception.
692
+
693
+ ## 1.9.5 (2011-11-15)
694
+
695
+ [FIXED] NetInfo listening as to not clobber the window.ononline and window.onoffline variables. Fixes issue #9.
696
+
697
+ [FIXED] Loading of web-socket-js on Mozilla browsers with MozWebSocket, issue #10.
698
+
699
+ [UPGRADE] Test framework to run in most browsers (IE6+, FF3+, Opera 11.52+, Safari, Chrome). Includes various other improvements to tests and testing infrastructure.
700
+
701
+ [NEW] Smarter SSL only error detection. If a connection is closed by pusher with an error saying that the app is in SSL only mode, then we will now force all future connection attempts to use SSL.
702
+
703
+ [NEW] Added guards around the JSON.parse calls in the Ajax Authoriser for private and presence channels.
704
+
705
+ ## 1.9.4 (2011-09-12)
706
+
707
+ [FIX] Fixed bug which meant that presence channels only worked correctly when `user_info` was supplied. It's now possible to use presence channels without specifying `user_info` (`user_id` is required).
708
+
709
+ ## 1.9.3 (2011-08-19)
710
+
711
+ [FIX] Fixed JSON dependency loading properly, rather than bundling it always.
712
+
713
+ ## 1.9.2 (2011-08-04)
714
+
715
+ [NEW] Cleverer reconnection behaviour.
716
+
717
+ If Connection is connected and the window.ononffline event is fired, this indicates that the computer has lost its connection to the local router. In response, the Connection immediately closes the socket.
718
+
719
+ If Connection is disconnected and waiting to reattempt a connection, and the window.ononline event is fired, the Connection tries to connect immediately, rather than waiting for the current waiting period to elapse.
720
+
721
+ If the window is about to attempt a connection and the window.navigator.onLine variable is false, the Connection immediately goes to the unavailable state.
722
+
723
+ Note: window.ononline, window.onoffline and window.navigator.onLine are only supported by some browsers.
724
+
725
+ [NEW] If channel authentication AJAX request returns a status code that is not 200, a `subscription_error` event is triggered. The `subscription_error` can be bound to so that the library user can respond to the failure.
726
+
727
+ [FIX] Works with IE7 again, after being broken in 1.9.0.
728
+
729
+ [FIX] Traffic Light connection status demo works in installations of Firefox 3.6 without Firebug.
730
+
731
+ ## 1.9.1 (2011-07-18)
732
+
733
+ [FIX] Client events triggering fixed (broken by 1.9.0)
734
+
735
+ [FIX] Removed verbose logging of internal state machine transitions
736
+
737
+ ## 1.9.0 (2011-07-15)
738
+
739
+ [NEW] New API to allow binding to changes in connection state. See blog post for details.
740
+
741
+ [NEW] Support for Firefox 6 native WebSocket using MozWebSocket prefix
742
+
743
+ [REMOVED] Old connection state events: `pusher:connection_established`, `pusher:connection_failed`, `pusher:connection_disconnected`.
744
+
745
+ [CHANGED] Socket id now accessed via `pusher.connection.socket_id` rather than `pusher.socket_id`.
746
+
747
+ ## 1.8.6 (2011-08-19)
748
+
749
+ [NEW] Support for Firefox 6 native WebSocket using MozWebSocket prefix
750
+
751
+ ## 1.8.5 (2011-06-18)
752
+
753
+ [FIX] Fix the fact that member was being added to the global scope
754
+
755
+ [CHANGE] `Pusher.log` function now always receives a single string argument rather than multiple arguments, making it easier to use. If you want more control, you can over-ride `Pusher.debug`
756
+
757
+ ## 1.8.4 (2011-06-18)
758
+
759
+ [FIX] When using multiple presence channels concurrently, the members object for each channel now operates as expected
760
+
761
+ ## 1.8.3 (2011-04-19)
762
+
763
+ [FIX] Delay Pusher initialization until document.body is defined. This fixes an issue in Firefox < 4 & IE which occasionally caused a "document.body is null" error when loading the flash fallback.
764
+
765
+ [UPGRADE] Upgraded linked version of web-socket-js. Amongst other things this removes the dependency on FABridge and reduces the minified size of fallback dependencies by 13KB.
766
+ For the full list of changes in web-socket-js see <https://github.com/gimite/web-socket-js/compare/6640d9d806972ea1720a273d09e8919464bcd131...bb5797cad5244dc86410e35726ef886bbc49afe9>
767
+
768
+ ## 1.8.2 (2011-03-29)
769
+
770
+ [BUGFIX] When loaded onto a HTTPS page, load pusher dependencies from HTTPS.
771
+
772
+ ## 1.8.1 (2011-03-21)
773
+
774
+ [BUGFIX] Minor fix which could have allowed `member_removed` to be triggered with nil.
775
+
776
+ [CHANGE] Increased default connection timeout to reduce likelyhood of timeouts on first connection attempt. This is now configurable as `Pusher.connection_timeout`.
777
+
778
+ ## 1.8.0 (2011-02-10)
779
+
780
+ [NEW] Support triggering client events with new API
781
+
782
+ channel.trigger('client-myeventname', {
783
+ some: 'data'
784
+ })
785
+
786
+ [NEW] Support for new socket presence interface, and changed javascript API. The `subscription_succeeded` event now returns an iterator object:
787
+
788
+ presence_channel.bind('pusher:subscription_succeeded', function(members) {
789
+ members.each(function(member) {
790
+ console.log(member.id, member.info)
791
+ })
792
+ })
793
+
794
+ Also, the member object passed to `member_added` and `member_removed` now has attributes `id` and `info` rather than `user_id` and `user_info`.
795
+
796
+ [CHANGED] Improved javascript debug console logging.
797
+
798
+ ## 1.7.6 (2011-03-29)
799
+
800
+ [BUGFIX] When loaded onto a HTTPS page, load pusher dependencies from HTTPS [backported from 1.8.2].
801
+
802
+ ## 1.7.5 (2011-03-21)
803
+
804
+ [CHANGE] Increased default connection timeout to reduce likelyhood of timeouts on first connection attempt. This is now configurable as `Pusher.connection_timeout` [backported from 1.8.1].
805
+
806
+ ## 1.7.4 (2011-02-09)
807
+
808
+ [FIXED] Javascript error was raised in the case that neither native WebSockets nor Flash were available.
809
+
810
+ [FIXED] Updated linked version of web-socket-js, which fixes issue connecting from Android, allows connection attempts to timeout and retry correctly. For full details see <https://github.com/gimite/web-socket-js/compare/2776dcfbf7847a5e19505432d8d63f8814e37b52...6640d9d806972ea1720a273d09e8919464bcd131>
811
+
812
+ ## 1.7.3 (2011-02-01)
813
+
814
+ [FIXED] Pusher could fail to initialize in IE 7 & 8 when dependencies cached
815
+
816
+ ## 1.7.2 (2011-01-25)
817
+
818
+ [FIXED] pusher.min.js now loads minified rather than unminified dependencies.
819
+
820
+ [CHANGED] Using JBundle for bundling the distribution. This should not in any way affect the minified files, it just simplifies building them.
821
+
822
+ ## 1.7.1
823
+
824
+ Wrap timeout around connections so that silently hanging connections are retried.
825
+
826
+ More robust reconnection logic, with initially shorter reconnect delay, but with increasing backoff.
827
+
828
+ ## 1.7.0
829
+
830
+ Encrypted apps: apps can now be configured to connect via SSL only. There is a corresponding setting in your dashboard which will reject non encrypted connections.
831
+
832
+ var pusher = new Pusher('your-key', {
833
+ encrypted: true
834
+ })
835
+
836
+ Note that the second argument to the Pusher constructor for setting channel names has been removed. You should use `pusher.subscribe instead`. THIS NO LONGER WORKS:
837
+
838
+ var pusher = new Pusher('your-key', 'channel-name') # DOES NOT WORK
839
+
840
+ ## 1.6.4
841
+
842
+ JSONp support for presence and private channels
843
+
844
+ Configurable transport for channel auths. JSONp allows for cross-domain channel authorization (ie. embedable widgets)
845
+
846
+ Pusher.channel_auth_transport = 'jsonp';
847
+
848
+ The default is Ajax for backwards compatibility. Ajax mode POSTS to Pusher.channel_auth_endpoint, whereas JSONp GETs.
849
+
850
+ For JSONp to work, your server must wrap the response in the callback name provided as a query parameter. Ruby example (using Pusher Gem) and Rails:
851
+
852
+ auth = Pusher[channel_name].authenticate(params[:socket_id], {
853
+ :user_id => current_user.id,
854
+ :user_info => {:name => current_user.name}
855
+ })
856
+
857
+ render :text => params[:callback] + "(" + JSON.generate(auth) + ");"
858
+
859
+ ## 1.6.3
860
+
861
+ Fixed presence bug for removed duplicate members.
862
+
863
+ If I connect as the same user in different browser windows or tabs, clients should trigger remove that member from a channel's member list only when the last window/tab is closed.
864
+
865
+ See http://pusher.tenderapp.com/discussions/questions/11-presence-of-friends for discussion.
866
+
867
+ ## 1.6.2
868
+
869
+ Dynamically load Javascript and Flash dependencies only for browsers that need them. Including pusher.js will:
870
+
871
+ IE: require JSON2, require and activate Flash fallback.
872
+ Firefox 3.6x: require and activate Flash fallback
873
+ Chrome, Safari: don't require anything. These browsers already have WebSocket and JSON support.
874
+
875
+ This saves a lot of bandwidth and makes page loads faster.
876
+
877
+ ## 1.6
878
+
879
+ Initial Presence support. Subscribing to presence channels allows you to respond to people entering and leaving the channel in your UI, to show who is has a connection open. More documentation here: http://pusherapp.com/docs/presence.
880
+
881
+ ## 1.5
882
+
883
+ Updated the library to use a version of the swf file hosted by Pusher. This makes it more convenient to integrate and avoids version conflicts in future.
884
+
885
+ Add some full-stack integration tests that interact with the production Pusher environment.
886
+
887
+ ## 1.4.3
888
+
889
+ Trigger pusher:connection\_failed if no websocket is defined, allowing the event to work on iphones etc.
890
+
891
+ ## 1.4.2
892
+
893
+ * Removed switch\_to\_secure and switch\_to\_unsecure in favour of automatic failover to ssl
894
+ * Generate internal events pusher:connection\_disconnected and pusher:connection\_failed
895
+ * Responds to pusher:connection\_established preparing for deprecation of connection\_established
896
+
897
+ ## 1.4.1
898
+
899
+ Added switch\_to\_secure() and switch\_to\_unsecure() to enable ssl testing
900
+
901
+ ## 1.4
902
+
903
+ Add ability to bind events to a specific channel:
904
+
905
+ var server = new Pusher("API_KEY", "my-channel")
906
+ server.channel("my-channel").bind("my-event", function(data) {
907
+ // do something
908
+ })
909
+
910
+ ## 1.3
911
+
912
+ Add support for subscribing to private channels. Retrieves an authentication string via Ajax from your server - for more information view the docs: <http://pusherapp.com/docs/private_channels>
913
+
914
+ ## 1.2.1
915
+
916
+ Basic support for subscribing to multiple channels:
917
+
918
+ var server = new Pusher("API_KEY", "my-channel")
919
+ server.subscribe("another-channel")
920
+ server.unsubscribe("my-channel")
921
+
922
+ ## 1.2
923
+
924
+ Build a single Javascript file including all dependencies for Flash fallback and browsers that don't have a native JSON implementation.
925
+
926
+ ## 1
927
+
928
+ First release!