diff --git a/code/CHANGELOG.md b/code/CHANGELOG.md index a3e10553a..0ddf53430 100644 --- a/code/CHANGELOG.md +++ b/code/CHANGELOG.md @@ -13,9 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- [#292](https://github.com/InditexTech/weavejs/issues/292) Improve Azure Web PubSub to allow EventHandler options + ## [0.17.0] - 2025-05-26 -### Changes +### Changed - [#287](https://github.com/InditexTech/weavejs/issues/287) Update create-app frontend @@ -320,75 +324,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#18](https://github.com/InditexTech/weavejs/issues/18) Fix awareness not working on store-azure-web-pubsub [Unreleased]: https://github.com/InditexTech/weavejs/compare/0.17.0...HEAD - [0.17.0]: https://github.com/InditexTech/weavejs/compare/0.16.2...0.17.0 - [0.16.2]: https://github.com/InditexTech/weavejs/compare/0.16.1...0.16.2 - [0.16.1]: https://github.com/InditexTech/weavejs/compare/0.16.0...0.16.1 - [0.16.0]: https://github.com/InditexTech/weavejs/compare/0.15.0...0.16.0 - [0.15.0]: https://github.com/InditexTech/weavejs/compare/0.14.3...0.15.0 - [0.14.3]: https://github.com/InditexTech/weavejs/compare/0.14.2...0.14.3 - [0.14.2]: https://github.com/InditexTech/weavejs/compare/0.14.1...0.14.2 - [0.14.1]: https://github.com/InditexTech/weavejs/compare/0.14.0...0.14.1 - [0.14.0]: https://github.com/InditexTech/weavejs/compare/0.13.1...0.14.0 - [0.13.1]: https://github.com/InditexTech/weavejs/compare/0.13.0...0.13.1 - [0.13.0]: https://github.com/InditexTech/weavejs/compare/0.12.1...0.13.0 - [0.12.1]: https://github.com/InditexTech/weavejs/compare/0.12.0...0.12.1 - [0.12.0]: https://github.com/InditexTech/weavejs/compare/0.11.0...0.12.0 - [0.11.0]: https://github.com/InditexTech/weavejs/compare/0.10.3...0.11.0 - [0.10.3]: https://github.com/InditexTech/weavejs/compare/0.10.2...0.10.3 - [0.10.2]: https://github.com/InditexTech/weavejs/compare/0.10.1...0.10.2 - [0.10.1]: https://github.com/InditexTech/weavejs/compare/0.10.0...0.10.1 - [0.10.0]: https://github.com/InditexTech/weavejs/compare/0.9.3...0.10.0 - [0.9.3]: https://github.com/InditexTech/weavejs/compare/0.9.2...0.9.3 - [0.9.2]: https://github.com/InditexTech/weavejs/compare/0.9.1...0.9.2 - [0.9.1]: https://github.com/InditexTech/weavejs/compare/0.9.0...0.9.1 - [0.9.0]: https://github.com/InditexTech/weavejs/compare/0.8.0...0.9.0 - [0.8.0]: https://github.com/InditexTech/weavejs/compare/0.7.1...0.8.0 - [0.7.1]: https://github.com/InditexTech/weavejs/compare/0.7.0...0.7.1 - [0.7.0]: https://github.com/InditexTech/weavejs/compare/0.6.0...0.7.0 - [0.6.0]: https://github.com/InditexTech/weavejs/compare/0.5.0...0.6.0 - [0.5.0]: https://github.com/InditexTech/weavejs/compare/0.4.0...0.5.0 - [0.4.0]: https://github.com/InditexTech/weavejs/compare/0.3.3...0.4.0 - [0.3.3]: https://github.com/InditexTech/weavejs/compare/0.3.2...0.3.3 - [0.3.2]: https://github.com/InditexTech/weavejs/compare/0.3.1...0.3.2 - [0.3.1]: https://github.com/InditexTech/weavejs/compare/0.3.0...0.3.1 - [0.3.0]: https://github.com/InditexTech/weavejs/compare/0.2.1...0.3.0 - [0.2.1]: https://github.com/InditexTech/weavejs/compare/0.2.0...0.2.1 - [0.2.0]: https://github.com/InditexTech/weavejs/compare/0.1.1...0.2.0 - [0.1.1]: https://github.com/InditexTech/weavejs/compare/0.1.0...0.1.1 - [0.1.0]: https://github.com/InditexTech/weavejs/releases/tag/0.1.0 diff --git a/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-server.ts b/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-server.ts index 05eefd25e..f08ea6657 100644 --- a/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-server.ts +++ b/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-server.ts @@ -12,10 +12,12 @@ import { import WeaveAzureWebPubsubSyncHandler from './azure-web-pubsub-sync-handler'; import { defaultInitialState } from './default-initial-state'; import type { RequestHandler } from 'express-serve-static-core'; +import type { WebPubSubEventHandlerOptions } from '@azure/web-pubsub-express'; type WeaveAzureWebPubsubServerParams = { initialState?: FetchInitialState; pubsubConfig: WeaveAzureWebPubsubConfig; + eventsHandlerConfig?: WebPubSubEventHandlerOptions; persistRoom?: PersistRoom; fetchRoom?: FetchRoom; }; @@ -27,6 +29,7 @@ export class WeaveAzureWebPubsubServer { constructor({ pubsubConfig, + eventsHandlerConfig, initialState = defaultInitialState, persistRoom, fetchRoom, @@ -43,11 +46,12 @@ export class WeaveAzureWebPubsubServer { ); this.syncHandler = new WeaveAzureWebPubsubSyncHandler( - pubsubConfig.hubName, - `/api/webpubsub/hubs/${pubsubConfig.hubName}`, + this, syncClient, initialState, - this + pubsubConfig.hubName, + // `/api/webpubsub/hubs/${pubsubConfig.hubName}`, + eventsHandlerConfig ); } diff --git a/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-sync-handler.ts b/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-sync-handler.ts index 39b233db4..da7ffe543 100644 --- a/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-sync-handler.ts +++ b/code/packages/store-azure-web-pubsub/src/server/azure-web-pubsub-sync-handler.ts @@ -5,7 +5,10 @@ import * as Y from 'yjs'; import WebSocket from 'ws'; import { WebPubSubServiceClient } from '@azure/web-pubsub'; -import { WebPubSubEventHandler } from '@azure/web-pubsub-express'; +import { + WebPubSubEventHandler, + type WebPubSubEventHandlerOptions, +} from '@azure/web-pubsub-express'; import { type FetchInitialState } from '@/types'; import { WeaveStoreAzureWebPubSubSyncHost } from './azure-web-pubsub-host'; import { WeaveAzureWebPubsubServer } from './azure-web-pubsub-server'; @@ -22,14 +25,15 @@ export default class WeaveAzureWebPubsubSyncHandler extends WebPubSubEventHandle private actualServer: WeaveAzureWebPubsubServer; constructor( - hub: string, - path: string, + server: WeaveAzureWebPubsubServer, client: WebPubSubServiceClient, initialState: FetchInitialState, - server: WeaveAzureWebPubsubServer + hub: string, + // path: string, + options?: WebPubSubEventHandlerOptions ) { super(hub, { - path: path, + ...options, }); this.actualServer = server; diff --git a/docs/content/docs/main/changelog/index.mdx b/docs/content/docs/main/changelog/index.mdx index c0c4d57d5..4825d99fa 100644 --- a/docs/content/docs/main/changelog/index.mdx +++ b/docs/content/docs/main/changelog/index.mdx @@ -9,6 +9,7 @@ description: Check out the latest changes to Weave.js. ## Pre-release versions +- [**0.18.0**](/docs/main/changelog/prerelease/0.18.0) - [**0.17.0**](/docs/main/changelog/prerelease/0.17.0) - [**0.16.2**](/docs/main/changelog/prerelease/0.16.2) - [**0.16.1**](/docs/main/changelog/prerelease/0.16.1) diff --git a/docs/content/docs/main/changelog/prerelease/018.0.mdx b/docs/content/docs/main/changelog/prerelease/018.0.mdx new file mode 100644 index 000000000..aa594d69c --- /dev/null +++ b/docs/content/docs/main/changelog/prerelease/018.0.mdx @@ -0,0 +1,12 @@ +--- +title: v0.18.0 +description: Improvements to Azure Web PubSub store +--- + +## Metadata + +- **Release date**: 2025-05-27 + +### Changed + +- [#292](https://github.com/InditexTech/weavejs/issues/292) Improve Azure Web PubSub to allow EventHandler options diff --git a/docs/content/docs/main/changelog/prerelease/meta.json b/docs/content/docs/main/changelog/prerelease/meta.json index dd291120e..0c1ccbd34 100644 --- a/docs/content/docs/main/changelog/prerelease/meta.json +++ b/docs/content/docs/main/changelog/prerelease/meta.json @@ -2,6 +2,7 @@ "title": "Prerelease versions", "description": "Detailed changelog for Weave.js pre-release versions", "pages": [ + "0.18.0", "0.17.0", "0.16.2", "0.16.1",