Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: socketio/socket.io-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.0.0-rc2
Choose a base ref
...
head repository: socketio/socket.io-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.0.0-rc3
Choose a head ref
  • 6 commits
  • 12 files changed
  • 1 contributor

Commits on Oct 17, 2020

  1. feat: add volatile events

    A volatile packet will be dropped if:
    
    - the socket is not connected
    - the low-level transport is not ready (for example, a HTTP POST request is already pending)
    
    Syntax:
    
    ```js
    socket.volatile.emit("volatile event", "might or might not be sent");
    ```
    darrachequesne committed Oct 17, 2020
    Configuration menu
    Copy the full SHA
    7ddad2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f3cbe98 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2020

  1. feat: add bundle with msgpack parser

    Pros:
    
    - events with binary content are sent as 1 WebSocket frame (instead of 2 with the default parser)
    - payloads with lots of numbers should be smaller
    
    Cons:
    
    - no IE9 support (https://caniuse.com/mdn-javascript_builtins_arraybuffer)
    - a slightly bigger bundle size (61.1 vs 59.9 KB)
    
    Source: https://github.com/darrachequesne/socket.io-msgpack-parser
    darrachequesne committed Oct 25, 2020
    Configuration menu
    Copy the full SHA
    71d6048 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2020

  1. feat: add support for catch-all listeners

    Inspired from EventEmitter2 [1]
    
    The API is similar to the one on the server-side:
    
    ```js
    socket.onAny((event, ...args) => {});
    
    socket.prependAny((event, ...args) => {});
    
    socket.offAny(); // remove all listeners
    
    socket.offAny(listener);
    
    const listeners = socket.listenersAny();
    ```
    
    [1]: https://github.com/EventEmitter2/EventEmitter2
    darrachequesne committed Oct 26, 2020
    Configuration menu
    Copy the full SHA
    55f464f View commit details
    Browse the repository at this point in the history
  2. refactor: rename ERROR to CONNECT_ERROR

    The meaning is not modified: this packet type is still used by the
    server when the connection to a namespace is refused.
    
    Breaking change: the Socket instance will now emit a "connect_error"
    event instead of "error" (which is not a reserved event anymore)
    
    ```js
    // before
    socket.on("error", () => {});
    
    // after
    socket.on("connect_error", () => {});
    ```
    darrachequesne committed Oct 26, 2020
    Configuration menu
    Copy the full SHA
    13e1db7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a9127ce View commit details
    Browse the repository at this point in the history
Loading