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.1.2
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: 4.0.0
Choose a head ref
  • 4 commits
  • 22 files changed
  • 2 contributors

Commits on Mar 10, 2021

  1. feat: add support for typed events

    Syntax:
    
    ```ts
    interface ServerToClientEvents {
      "my-event": (a: number, b: string, c: number[]) => void;
    }
    
    interface ClientToServerEvents {
      hello: (message: string) => void;
    }
    
    const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io();
    
    socket.emit("hello", "world");
    
    socket.on("my-event", (a, b, c) => {
      // ...
    });
    ```
    
    The events are not typed by default (inferred as any), so this change
    is backward compatible.
    
    Related: socketio/socket.io#3742
    darrachequesne committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    5902365 View commit details
    Browse the repository at this point in the history
  2. feat: add autoUnref option

    With autoUnref set to true (default: false), the Socket.IO client will
    allow the program to exit if there is no other active timer/socket in
    the event system.
    
    ```js
    const socket = io({
      autoUnref: true
    });
    ```
    
    Note: this option only applies to Node.js clients.
    
    Related: #1446
    KC Erb authored and darrachequesne committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    6abfa1f View commit details
    Browse the repository at this point in the history
  3. fix(bundle): restore support for JS modules

    This change is needed so the bundle can be used with:
    
    ```
    <script type="module" src="xxxx/socket.io.js"></script>
    ```
    
    Related:
    
    - socketio/socket.io#3828
    - 13b32b3
    - 8c08c5d
    darrachequesne committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    43613d1 View commit details
    Browse the repository at this point in the history
  4. chore(release): 4.0.0

    The major bump is due to some breaking changes on the server side.
    
    Diff: 3.1.2...4.0.0
    darrachequesne committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    d28cde7 View commit details
    Browse the repository at this point in the history
Loading