mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
This change allows us to:
- reduce the size of the bundle
- provide an ESM bundle (for usage in <script type="module">)
BREAKING CHANGE: due to how default export works with ES modules, we
have removed the default export of the library, which means the
following code:
```js
require("engine.io-client")(...);
```
will not work anymore. The named export must be used instead:
```js
const { Socket } = require("engine.io-client);
// or import { Socket } from "engine.io-client";
const socket = new Socket(...);
```
Note: the UMD build still exposes a function though:
```html
<script src="/path/to/engine.io.js"></script>
<script>
const socket = eio(...);
</script>
```
Note: webpack is still used with zuul because of the custom builder
(zuul-builder-webpack)
9 lines
291 B
TypeScript
9 lines
291 B
TypeScript
import { Socket } from "./socket.js";
|
|
|
|
export { Socket };
|
|
export { SocketOptions } from "./socket.js";
|
|
export const protocol = Socket.protocol;
|
|
export { Transport } from "./transport.js";
|
|
export { transports } from "./transports/index.js";
|
|
export { installTimerFunctions } from "./util.js";
|