Sockette Versions Save

The cutest little WebSocket wrapper! 🧦

v2.0.4

5 years ago

Patches

  • Fix: Remove fat-arrow function for complete ES5 compliance (#41): 7ff9780

v2.0.3

5 years ago

Patches

  • Add default protocols for Firefox (#20): a465457 Thanks @Inva0!

  • Allow reconnect() to continue when no connection can establish on init (#30): 14424e4

  • Ensure code=1005 default when close()ing without arguments (#36): 5102793, d935a48

Chores

  • Shaving yaks & code-golfing for 24 bytes (15 net) savings: e2ffefd, 8d0bcd6, c8c8d91

v2.0.2

5 years ago

Features

Patches

  • Use .mjs extension for ES Module entry: bc08862

Chores

  • Update README badges & size: 5adf646, 67c9686
  • Update build tools: 96fec8b

v2.0.1

5 years ago

Patches

  • Add json() to README (#26): 9df3e08 Thanks @mehmetkose!

  • Included type definitions (#27): f3be7f2 Thanks @PatrickSachs!

  • Fix typo in README (#33): ce834f0

v2.0.0

6 years ago

Breaking

  • You must now instantiate an instance rather than functional helper: 0a9c339

    const Sockette = require('sockette');
    
    // Don't:
    let ws = Sockette('...');
    
    // Do:
    let ws = new Sockette('...');
    
  • Sockette no longer returns the underlying WebSocket: 0a9c339

    Instead, it returns itself, keeping the current WebSocket instance protected and out of reach.

    Returning the WebSocket prevented the ability to send new messages after successful reconnects.

Minor

  • NEW: Added opts.onmaximum callback (#11): 712defb, e59b0e7

    This is called when the maxAttempts have been exhausted.

Patches

  • Fixed transmits from Sockette after reconnecting/recovering from failure: 0a9c339

    By hiding the underlying WebSocket, Sockette can safely swap/update instances without invalidating your pointer to initial WebSocket return.

  • A successful reconnection will reset the tracked attempts count: 6d8095a

    Previously, reconnecting after 6 attempts only left you 4 attempts for your next connection failure — assuming a limit of 10.

  • Update README docs: b9d74b0, e656e08, 556fe3e, e59b0e7

v1.2.0

6 years ago

Minor Changes

  • Added new json() convenience method (#4): f3f0bbd

    Auto-casts payload to string (via JSON.stringify). Thanks @bl4ckm0r3! 🎉

Patches

  • Update docs for json() addition: 117f06d

v1.1.0

6 years ago

Minor Changes

  • Don't auto-enforce a close(1000): f8771f0

    As @lpinca pointed out, this is non-compliant behavior to the WS spec, and I was porting/pulling too much from personal use cases.

Patches

  • Accept 1005 code as normal closure event (#3): f8771f0

    Thanks @lpinca!

  • Update docs: ea94336, 3a03dc5