Skip to content

Commit 122b1ff

Browse files
authored
We now bundle dual ESM/CJS packages (#164)
1 parent c4cb837 commit 122b1ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+6649
-4546
lines changed

.babelrc

-8
This file was deleted.

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

API.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,19 @@ Departing from version 2.x, there's been some minor API changes. A breaking chan
5454

5555
`client.login` now throws an error in case of failed login. Enclose the code using that method in a `try/catch` block to mitigate unhandled exceptions.
5656

57-
## Migrating to 8.x
57+
## Migrating to 9.x
5858

59-
Starting with v8.0.0, the library switched to using ESNext (ESM). The consumers of this package version must ensure they use `import` instead of `require` to import resources from this package.
59+
Starting with v9.0.0 this is a hybrid ES Modules / CommonJS library.
60+
61+
Additionally, all of the exports formerly in the `lib/` directory are now bundled and exported from `rpc-websockets` itself. Any inner dependencies that you used to import can now be imported from the main package.
62+
63+
```ts
64+
// Before
65+
import WebSocketFactory from "rpc-websockets/dist/lib/client/websocket.cjs";
66+
67+
// After
68+
import { WebSocket as WebSocketFactory } from "rpc-websockets";
69+
```
6070

6171
## Client
6272

build-browser-bundle.mjs

-15
This file was deleted.

dist/index.browser-bundle.js

+13-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)