@baeta/subscriptions-pubsub 2.0.0-next.15 → 2.0.0-next.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +26 -41
  2. package/README.md +2 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,62 +1,47 @@
1
1
  # @baeta/subscriptions-pubsub
2
2
 
3
- ## 2.0.0-next.15
3
+ ## 2.0.0-next.17
4
4
 
5
- ### Patch Changes
6
-
7
- - Drop Node v23 and v25 by [@andreisergiu98](https://github.com/andreisergiu98) in [#474](https://github.com/andreisergiu98/baeta/pull/474)
8
-
9
- ## 2.0.0-next.14
10
-
11
- ### Patch Changes
12
-
13
- - Fix wrong error being thrown in the case for single errors by [@andreisergiu98](https://github.com/andreisergiu98) in [#397](https://github.com/andreisergiu98/baeta/pull/397)
14
-
15
- ## 2.0.0-next.13
16
-
17
- ## 2.0.0-next.12
5
+ ## 2.0.0-next.16
18
6
 
19
- ## 2.0.0-next.11
7
+ ### Major Changes
20
8
 
21
- ## 2.0.0-next.10
9
+ - Drop support for Node.js v23 and v25. Baeta now targets the active LTS releases — Node.js `^22.20.0`, `^24.0.0`, or `>=26.0.0`. by [@andreisergiu98](https://github.com/andreisergiu98) in [#290](https://github.com/andreisergiu98/baeta/pull/290)
22
10
 
23
- ## 2.0.0-next.9
11
+ - `TypedPubSub` is now a concrete class you instantiate with `new`, the `createTypedPubSub()` factory has been removed, and the package targets `graphql-subscriptions` v3 only. Support for `graphql-subscriptions` v2 (and its runtime engine detection) is gone. by [@andreisergiu98](https://github.com/andreisergiu98) in [#290](https://github.com/andreisergiu98/baeta/pull/290)
24
12
 
25
- ## 2.0.0-next.8
13
+ #### Creating the PubSub
26
14
 
27
- ## 2.0.0-next.7
15
+ In v1, `TypedPubSub` was a _type_ and you built the instance with the `createTypedPubSub()` factory, which detected the engine version (`asyncIterator` for v2, `asyncIterableIterator` for v3) at runtime. In v2, `TypedPubSub` is the class itself.
28
16
 
29
- ## 2.0.0-next.6
17
+ **v1:**
30
18
 
31
- ### Patch Changes
19
+ ```typescript
20
+ import { createTypedPubSub } from "@baeta/subscriptions-pubsub";
21
+ import { PubSub } from "graphql-subscriptions";
32
22
 
33
- - Fix export for subscriptions-pubsub
23
+ export const pubsub = createTypedPubSub<PubSub, PubSubMap>(new PubSub());
24
+ ```
34
25
 
35
- ## 2.0.0-next.2
26
+ **v2:**
36
27
 
37
- ### Patch Changes
28
+ ```typescript
29
+ import { TypedPubSub } from "@baeta/subscriptions-pubsub";
30
+ import { PubSub } from "graphql-subscriptions";
38
31
 
39
- - Fix broken types
32
+ export const pubsub = new TypedPubSub<PubSub, PubSubMap>(new PubSub());
33
+ ```
40
34
 
41
- ## 2.0.0-next.1
35
+ The optional `{ prefix }` options object is unchanged and still passed as the second argument.
42
36
 
43
- ### Patch Changes
37
+ #### Removed and changed exports
44
38
 
45
- - Fix release version
46
-
47
- ## 2.0.0-next.0
48
-
49
- ### Major Changes
39
+ - `createTypedPubSub()` — removed; use `new TypedPubSub(...)`.
40
+ - `PubSubEngineV2` / `PubSubEngineV3` — removed. The package now targets a single `graphql-subscriptions` v3 engine.
41
+ - `TypedPubSub` — was a type alias in v1; is now the exported class.
42
+ - `TypedPubSubOptions` — unchanged.
50
43
 
51
- - [#214](https://github.com/andreisergiu98/baeta/pull/214) [`31d1a50`](https://github.com/andreisergiu98/baeta/commit/31d1a509f96535b43ae85d19c770eb1a5f09dc94) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - Baeta v2 – major refactor
52
- - **Side-effect-free type generation & resolver definitions.**
53
- The types generator and resolver definitions were reworked to be side-effect free, improving type safety.
54
- - **Stricter type safety.**
55
- You must now **explicitly define resolvers for every field** during development—breakages that used to surface at runtime are now caught at compile time.
56
- - **Removed `@baeta/compiler`.**
57
- Since modern runtimes can execute TypeScript natively, the separate compiler package is no longer needed. Use your runtime’s native TS support or your existing build setup.
58
- - **Subscriptions update.**
59
- `@baeta/subscriptions-pubsub` now targets **`graphql-subscriptions` v3**.
44
+ Because v2 support is dropped, the `asyncIterator` method (the v2-only iterator) is no longer available — use `asyncIterableIterator(channel)` for the async iterable. `publish`, `subscribe`, and `unsubscribe` are unchanged.
60
45
 
61
46
  ## 1.0.9
62
47
 
package/README.md CHANGED
@@ -5,9 +5,10 @@
5
5
  <div align="center">
6
6
  <h1>Baeta</h1>
7
7
  <a href="https://www.npmjs.com/package/@baeta/cli"><img src="https://img.shields.io/npm/v/@baeta/cli.svg?style=flat" /></a>
8
- <a href="https://github.com/andreisergiu98/baeta/actions/workflows/checks.yml"><img src="https://img.shields.io/github/actions/workflow/status/andreisergiu98/baeta/checks.yml" /></a>
8
+ <a href="https://github.com/andreisergiu98/baeta/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/andreisergiu98/baeta/build.yml" /></a>
9
9
  <a href="https://github.com/andreisergiu98/baeta/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" /></a>
10
10
  <a href="https://github.com/andreisergiu98/baeta/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" /></a>
11
+ <img alt="nycrc config on GitHub" src="https://img.shields.io/nycrc/andreisergiu98/baeta?config=.nycrc.json&preferredThreshold=branches&color=green">
11
12
  <br />
12
13
  <br />
13
14
  <a href="https://baeta.io/docs/getting-started/installation">Getting Started</a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baeta/subscriptions-pubsub",
3
- "version": "2.0.0-next.15",
3
+ "version": "2.0.0-next.17",
4
4
  "description": "Typed PubSub helpers for Baeta subscriptions.",
5
5
  "keywords": [
6
6
  "baeta",