@get-bb/plugin-sdk 0.6.68 → 0.6.75

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.
@@ -3248,13 +3248,21 @@ function createFakePluginHostInternal(options, sharedState) {
3248
3248
  };
3249
3249
  const rpcHandlers = /* @__PURE__ */ new Map();
3250
3250
  const rpcInvalidations = [];
3251
+ const invalidationListeners = /* @__PURE__ */ new Set();
3251
3252
  const rpc = {
3253
+ experimental_whileWatched(method) {
3254
+ assertLive();
3255
+ if (!rpcHandlers.has(method))
3256
+ throw new Error(`Unknown RPC method: ${method}`);
3257
+ },
3252
3258
  experimental_invalidate(tags) {
3253
3259
  assertLive();
3260
+ for (const listener of invalidationListeners) listener();
3254
3261
  rpcInvalidations.push(rpcInvalidationTags.parse(tags));
3255
3262
  },
3256
3263
  experimental_invalidateAll() {
3257
3264
  assertLive();
3265
+ for (const listener of invalidationListeners) listener();
3258
3266
  rpcInvalidations.push(null);
3259
3267
  },
3260
3268
  register(contract, handlers, registrationOptions) {
@@ -3907,6 +3915,12 @@ function createFakePluginHostInternal(options, sharedState) {
3907
3915
  },
3908
3916
  pluginId,
3909
3917
  logEntries,
3918
+ experimental_onRpcInvalidation(listener) {
3919
+ invalidationListeners.add(listener);
3920
+ return () => {
3921
+ invalidationListeners.delete(listener);
3922
+ };
3923
+ },
3910
3924
  experimental_rpcInvalidations: rpcInvalidations,
3911
3925
  realtimeSignals,
3912
3926
  needsConfigurationMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.68",
3
+ "version": "0.6.75",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"