Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual-build for ESM and CJS #164

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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