Skip to content

Commit

Permalink
We now bundle dual ESM/CJS packages (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher authored Jun 11, 2024
1 parent c4cb837 commit 122b1ff
Show file tree
Hide file tree
Showing 46 changed files with 6,649 additions and 4,546 deletions.
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
14 changes: 12 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,19 @@ Departing from version 2.x, there's been some minor API changes. A breaking chan

`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.

## Migrating to 8.x
## Migrating to 9.x

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.
Starting with v9.0.0 this is a hybrid ES Modules / CommonJS library.

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.

```ts
// Before
import WebSocketFactory from "rpc-websockets/dist/lib/client/websocket.cjs";

// After
import { WebSocket as WebSocketFactory } from "rpc-websockets";
```

## Client

Expand Down
15 changes: 0 additions & 15 deletions build-browser-bundle.mjs

This file was deleted.

18 changes: 13 additions & 5 deletions dist/index.browser-bundle.js

Large diffs are not rendered by default.

Loading

0 comments on commit 122b1ff

Please sign in to comment.