@vaadin/hilla-frontend 24.6.0-alpha2 → 24.6.0-alpha4
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.
- package/FluxConnection.d.ts +1 -0
- package/FluxConnection.d.ts.map +1 -1
- package/FluxConnection.js +27 -21
- package/FluxConnection.js.map +2 -2
- package/index.js +1 -1
- package/package.json +1 -1
package/FluxConnection.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export type FluxSubscriptionStateChangeEvent = CustomEvent<{
|
|
|
55
55
|
export declare class FluxConnection extends EventTarget {
|
|
56
56
|
#private;
|
|
57
57
|
state: State;
|
|
58
|
+
wasClosed: boolean;
|
|
58
59
|
constructor(connectPrefix: string, atmosphereOptions?: Partial<Atmosphere.Request>);
|
|
59
60
|
/**
|
|
60
61
|
* Subscribes to the flux returned by the given endpoint name + method name using the given parameters.
|
package/FluxConnection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FluxConnection.d.ts","sourceRoot":"","sources":["src/FluxConnection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AASjD,oBAAY,KAAK;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED,KAAK,WAAW,GAAG,WAAW,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AACpD,UAAU,QAAQ;IAChB,eAAe,EAAE,WAAW,CAAC;CAC9B;AAED,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,QAAQ,IACtC,CAAC,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAChD;IACE,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACpC,GACD,IAAI,CAAC;AAET;;GAEG;AACH,oBAAY,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;AAED;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,WAAW,CAAC;IAAE,KAAK,EAAE,qBAAqB,CAAA;CAAE,CAAC,CAAC;AAS7F;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;;IAC7C,KAAK,EAAE,KAAK,CAAkB;IAC9B,SAAS,UAAS;gBAWN,aAAa,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IA2BlF;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC;CAwM/F;AAED,MAAM,WAAW,cAAc;IAC7B,gBAAgB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACrF,mBAAmB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACzF"}
|
package/FluxConnection.js
CHANGED
|
@@ -22,6 +22,7 @@ var FluxSubscriptionState = /* @__PURE__ */ ((FluxSubscriptionState2) => {
|
|
|
22
22
|
})(FluxSubscriptionState || {});
|
|
23
23
|
class FluxConnection extends EventTarget {
|
|
24
24
|
state = "inactive" /* INACTIVE */;
|
|
25
|
+
wasClosed = false;
|
|
25
26
|
#endpointInfos = /* @__PURE__ */ new Map();
|
|
26
27
|
#nextId = 0;
|
|
27
28
|
#onCompleteCallbacks = /* @__PURE__ */ new Map();
|
|
@@ -35,6 +36,27 @@ class FluxConnection extends EventTarget {
|
|
|
35
36
|
super();
|
|
36
37
|
this.#connectWebsocket(connectPrefix.replace(/connect$/u, ""), atmosphereOptions ?? {});
|
|
37
38
|
}
|
|
39
|
+
#resubscribeIfWasClosed() {
|
|
40
|
+
if (this.wasClosed) {
|
|
41
|
+
this.wasClosed = false;
|
|
42
|
+
const toBeRemoved = [];
|
|
43
|
+
this.#endpointInfos.forEach((endpointInfo, id) => {
|
|
44
|
+
if (endpointInfo.reconnect?.() === "resubscribe" /* RESUBSCRIBE */) {
|
|
45
|
+
this.#setSubscriptionConnState(id, "connecting" /* CONNECTING */);
|
|
46
|
+
this.#send({
|
|
47
|
+
"@type": "subscribe",
|
|
48
|
+
endpointName: endpointInfo.endpointName,
|
|
49
|
+
id,
|
|
50
|
+
methodName: endpointInfo.methodName,
|
|
51
|
+
params: endpointInfo.params
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
toBeRemoved.push(id);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
toBeRemoved.forEach((id) => this.#removeSubscription(id));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
38
60
|
/**
|
|
39
61
|
* Subscribes to the flux returned by the given endpoint name + method name using the given parameters.
|
|
40
62
|
*
|
|
@@ -114,6 +136,7 @@ class FluxConnection extends EventTarget {
|
|
|
114
136
|
trackMessageLength: true,
|
|
115
137
|
url,
|
|
116
138
|
onClose: () => {
|
|
139
|
+
this.wasClosed = true;
|
|
117
140
|
if (this.state !== "inactive" /* INACTIVE */) {
|
|
118
141
|
this.state = "inactive" /* INACTIVE */;
|
|
119
142
|
this.dispatchEvent(new CustomEvent("state-changed", { detail: { active: false } }));
|
|
@@ -134,6 +157,7 @@ class FluxConnection extends EventTarget {
|
|
|
134
157
|
},
|
|
135
158
|
onOpen: () => {
|
|
136
159
|
if (this.state !== "active" /* ACTIVE */) {
|
|
160
|
+
this.#resubscribeIfWasClosed();
|
|
137
161
|
this.state = "active" /* ACTIVE */;
|
|
138
162
|
this.dispatchEvent(new CustomEvent("state-changed", { detail: { active: true } }));
|
|
139
163
|
this.#sendPendingMessages();
|
|
@@ -141,21 +165,7 @@ class FluxConnection extends EventTarget {
|
|
|
141
165
|
},
|
|
142
166
|
onReopen: () => {
|
|
143
167
|
if (this.state !== "active" /* ACTIVE */) {
|
|
144
|
-
|
|
145
|
-
this.#endpointInfos.forEach((endpointInfo, id) => {
|
|
146
|
-
if (endpointInfo.reconnect?.() === "resubscribe" /* RESUBSCRIBE */) {
|
|
147
|
-
this.#send({
|
|
148
|
-
"@type": "subscribe",
|
|
149
|
-
endpointName: endpointInfo.endpointName,
|
|
150
|
-
id,
|
|
151
|
-
methodName: endpointInfo.methodName,
|
|
152
|
-
params: endpointInfo.params
|
|
153
|
-
});
|
|
154
|
-
} else {
|
|
155
|
-
toBeRemoved.push(id);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
toBeRemoved.forEach((id) => this.#removeSubscription(id));
|
|
168
|
+
this.#resubscribeIfWasClosed();
|
|
159
169
|
this.state = "active" /* ACTIVE */;
|
|
160
170
|
this.dispatchEvent(new CustomEvent("state-changed", { detail: { active: true } }));
|
|
161
171
|
this.#sendPendingMessages();
|
|
@@ -164,12 +174,8 @@ class FluxConnection extends EventTarget {
|
|
|
164
174
|
onReconnect: () => {
|
|
165
175
|
if (this.state !== "reconnecting" /* RECONNECTING */) {
|
|
166
176
|
this.state = "reconnecting" /* RECONNECTING */;
|
|
167
|
-
this.#endpointInfos.forEach((
|
|
168
|
-
|
|
169
|
-
this.#setSubscriptionConnState(id, "connecting" /* CONNECTING */);
|
|
170
|
-
} else {
|
|
171
|
-
this.#setSubscriptionConnState(id, "closed" /* CLOSED */);
|
|
172
|
-
}
|
|
177
|
+
this.#endpointInfos.forEach((_, id) => {
|
|
178
|
+
this.#setSubscriptionConnState(id, "connecting" /* CONNECTING */);
|
|
173
179
|
});
|
|
174
180
|
}
|
|
175
181
|
},
|
package/FluxConnection.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/FluxConnection.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ReactiveControllerHost } from '@lit/reactive-element';\nimport atmosphere from 'atmosphere.js';\nimport type { Subscription } from './Connect.js';\nimport { getCsrfTokenHeadersForEndpointRequest } from './CsrfUtils.js';\nimport {\n isClientMessage,\n type ServerCloseMessage,\n type ServerConnectMessage,\n type ServerMessage,\n} from './FluxMessages.js';\n\nexport enum State {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n RECONNECTING = 'reconnecting',\n}\n\ntype ActiveEvent = CustomEvent<{ active: boolean }>;\ninterface EventMap {\n 'state-changed': ActiveEvent;\n}\n\ntype ListenerType<T extends keyof EventMap> =\n | ((this: FluxConnection, ev: EventMap[T]) => any)\n | {\n handleEvent(ev: EventMap[T]): void;\n }\n | null;\n\n/**\n * Possible options for dealing with lost subscriptions after a websocket is reopened.\n */\nexport enum ActionOnLostSubscription {\n /**\n * The subscription should be resubscribed using the same server method and parameters.\n */\n RESUBSCRIBE = 'resubscribe',\n /**\n * The subscription should be removed.\n */\n REMOVE = 'remove',\n}\n\n/**\n * Possible states of a flux subscription.\n */\nexport enum FluxSubscriptionState {\n /**\n * The subscription is not connected and is trying to connect.\n */\n CONNECTING = 'connecting',\n /**\n * The subscription is connected and receiving updates.\n */\n CONNECTED = 'connected',\n /**\n * The subscription is closed and is not trying to reconnect.\n */\n CLOSED = 'closed',\n}\n\n/**\n * Event wrapper for flux subscription connection state change callback\n */\nexport type FluxSubscriptionStateChangeEvent = CustomEvent<{ state: FluxSubscriptionState }>;\n\ntype EndpointInfo = {\n endpointName: string;\n methodName: string;\n params: unknown[] | undefined;\n reconnect?(): ActionOnLostSubscription | void;\n};\n\n/**\n * A representation of the underlying persistent network connection used for subscribing to Flux type endpoint methods.\n */\nexport class FluxConnection extends EventTarget {\n state: State = State.INACTIVE;\n readonly #endpointInfos = new Map<string, EndpointInfo>();\n #nextId = 0;\n readonly #onCompleteCallbacks = new Map<string, () => void>();\n readonly #onErrorCallbacks = new Map<string, () => void>();\n readonly #onNextCallbacks = new Map<string, (value: any) => void>();\n readonly #onStateChangeCallbacks = new Map<string, (event: FluxSubscriptionStateChangeEvent) => void>();\n readonly #statusOfSubscriptions = new Map<string, FluxSubscriptionState>();\n #pendingMessages: ServerMessage[] = [];\n #socket?: Atmosphere.Request;\n\n constructor(connectPrefix: string, atmosphereOptions?: Partial<Atmosphere.Request>) {\n super();\n this.#connectWebsocket(connectPrefix.replace(/connect$/u, ''), atmosphereOptions ?? {});\n }\n\n /**\n * Subscribes to the flux returned by the given endpoint name + method name using the given parameters.\n *\n * @param endpointName - the endpoint to connect to\n * @param methodName - the method in the endpoint to connect to\n * @param parameters - the parameters to use\n * @returns a subscription\n */\n subscribe(endpointName: string, methodName: string, parameters?: unknown[]): Subscription<any> {\n const id: string = this.#nextId.toString();\n this.#nextId += 1;\n const params = parameters ?? [];\n\n const msg: ServerConnectMessage = { '@type': 'subscribe', endpointName, id, methodName, params };\n this.#send(msg);\n this.#endpointInfos.set(id, { endpointName, methodName, params });\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTING);\n const hillaSubscription: Subscription<any> = {\n cancel: () => {\n if (!this.#endpointInfos.has(id)) {\n // Subscription already closed or canceled\n return;\n }\n\n const closeMessage: ServerCloseMessage = { '@type': 'unsubscribe', id };\n this.#send(closeMessage);\n this.#removeSubscription(id);\n },\n context(context: ReactiveControllerHost): Subscription<any> {\n context.addController({\n hostDisconnected() {\n hillaSubscription.cancel();\n },\n });\n return hillaSubscription;\n },\n onComplete: (callback: () => void): Subscription<any> => {\n this.#onCompleteCallbacks.set(id, callback);\n return hillaSubscription;\n },\n onError: (callback: () => void): Subscription<any> => {\n this.#onErrorCallbacks.set(id, callback);\n return hillaSubscription;\n },\n onNext: (callback: (value: any) => void): Subscription<any> => {\n this.#onNextCallbacks.set(id, callback);\n return hillaSubscription;\n },\n onSubscriptionLost: (callback: () => ActionOnLostSubscription | void): Subscription<any> => {\n if (this.#endpointInfos.has(id)) {\n this.#endpointInfos.get(id)!.reconnect = callback;\n } else {\n console.warn(`\"onReconnect\" value not set for subscription \"${id}\" because it was already canceled`);\n }\n return hillaSubscription;\n },\n onConnectionStateChange: (callback: (event: FluxSubscriptionStateChangeEvent) => void): Subscription<any> => {\n this.#onStateChangeCallbacks.set(id, callback);\n callback(\n new CustomEvent('subscription-state-change', { detail: { state: this.#statusOfSubscriptions.get(id)! } }),\n );\n return hillaSubscription;\n },\n };\n return hillaSubscription;\n }\n\n #connectWebsocket(prefix: string, atmosphereOptions: Partial<Atmosphere.Request>) {\n const extraHeaders = getCsrfTokenHeadersForEndpointRequest(document);\n const pushUrl = 'HILLA/push';\n const url = prefix.length === 0 ? pushUrl : (prefix.endsWith('/') ? prefix : `${prefix}/`) + pushUrl;\n this.#socket = atmosphere.subscribe?.({\n contentType: 'application/json; charset=UTF-8',\n enableProtocol: true,\n transport: 'websocket',\n fallbackTransport: 'websocket',\n headers: extraHeaders,\n maxReconnectOnClose: 10000000,\n reconnectInterval: 5000,\n timeout: -1,\n trackMessageLength: true,\n url,\n onClose: () => {\n if (this.state !== State.INACTIVE) {\n this.state = State.INACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: false } }));\n }\n },\n onError: (response) => {\n // eslint-disable-next-line no-console\n console.error('error in push communication', response);\n },\n onMessage: (response) => {\n if (response.responseBody) {\n this.#handleMessage(JSON.parse(response.responseBody));\n }\n },\n onMessagePublished: (response) => {\n if (response?.responseBody) {\n this.#handleMessage(JSON.parse(response.responseBody));\n }\n },\n onOpen: () => {\n if (this.state !== State.ACTIVE) {\n this.state = State.ACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: true } }));\n this.#sendPendingMessages();\n }\n },\n onReopen: () => {\n if (this.state !== State.ACTIVE) {\n const toBeRemoved: string[] = [];\n this.#endpointInfos.forEach((endpointInfo, id) => {\n if (endpointInfo.reconnect?.() === ActionOnLostSubscription.RESUBSCRIBE) {\n this.#send({\n '@type': 'subscribe',\n endpointName: endpointInfo.endpointName,\n id,\n methodName: endpointInfo.methodName,\n params: endpointInfo.params,\n });\n } else {\n toBeRemoved.push(id);\n }\n });\n toBeRemoved.forEach((id) => this.#removeSubscription(id));\n\n this.state = State.ACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: true } }));\n this.#sendPendingMessages();\n }\n },\n onReconnect: () => {\n if (this.state !== State.RECONNECTING) {\n this.state = State.RECONNECTING;\n this.#endpointInfos.forEach((endpointInfo, id) => {\n if (endpointInfo.reconnect?.() === ActionOnLostSubscription.RESUBSCRIBE) {\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTING);\n } else {\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CLOSED);\n }\n });\n }\n },\n onFailureToReconnect: () => {\n if (this.state !== State.INACTIVE) {\n this.state = State.INACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: false } }));\n this.#endpointInfos.forEach((_, id) => this.#setSubscriptionConnState(id, FluxSubscriptionState.CLOSED));\n }\n },\n ...atmosphereOptions,\n } satisfies Atmosphere.Request);\n }\n\n #setSubscriptionConnState(id: string, state: FluxSubscriptionState) {\n const currentState = this.#statusOfSubscriptions.get(id);\n if (!currentState) {\n this.#statusOfSubscriptions.set(id, state);\n this.#onStateChangeCallbacks.get(id)?.(\n new CustomEvent('subscription-state-change', { detail: { state: this.#statusOfSubscriptions.get(id)! } }),\n );\n } else if (currentState !== state) {\n this.#statusOfSubscriptions.set(id, state);\n this.#onStateChangeCallbacks.get(id)?.(\n new CustomEvent('subscription-state-change', { detail: { state: this.#statusOfSubscriptions.get(id)! } }),\n );\n }\n }\n\n #handleMessage(message: unknown) {\n if (isClientMessage(message)) {\n const { id } = message;\n const endpointInfo = this.#endpointInfos.get(id);\n\n if (message['@type'] === 'update') {\n const callback = this.#onNextCallbacks.get(id);\n if (callback) {\n callback(message.item);\n }\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTED);\n } else if (message['@type'] === 'complete') {\n this.#onCompleteCallbacks.get(id)?.();\n this.#removeSubscription(id);\n } else {\n const callback = this.#onErrorCallbacks.get(id);\n if (callback) {\n callback();\n }\n this.#removeSubscription(id);\n if (!callback) {\n throw new Error(\n endpointInfo\n ? `Error in ${endpointInfo.endpointName}.${endpointInfo.methodName}(${JSON.stringify(endpointInfo.params)}): ${message.message}`\n : `Error in unknown subscription: ${message.message}`,\n );\n }\n }\n } else {\n throw new Error(`Unknown message from server: ${String(message)}`);\n }\n }\n\n #removeSubscription(id: string) {\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CLOSED);\n this.#statusOfSubscriptions.delete(id);\n this.#onStateChangeCallbacks.delete(id);\n this.#onNextCallbacks.delete(id);\n this.#onCompleteCallbacks.delete(id);\n this.#onErrorCallbacks.delete(id);\n this.#endpointInfos.delete(id);\n }\n\n #send(message: ServerMessage) {\n if (this.state === State.INACTIVE) {\n this.#pendingMessages.push(message);\n } else {\n this.#socket?.push?.(JSON.stringify(message));\n }\n }\n\n #sendPendingMessages() {\n this.#pendingMessages.forEach((msg) => this.#send(msg));\n this.#pendingMessages = [];\n }\n}\n\nexport interface FluxConnection {\n addEventListener<T extends keyof EventMap>(type: T, listener: ListenerType<T>): void;\n removeEventListener<T extends keyof EventMap>(type: T, listener: ListenerType<T>): void;\n}\n"],
|
|
5
|
-
"mappings": "AACA,OAAO,gBAAgB;AAEvB,SAAS,6CAA6C;AACtD;AAAA,EACE;AAAA,OAIK;AAEA,IAAK,QAAL,kBAAKA,WAAL;AACL,EAAAA,OAAA,YAAS;AACT,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,kBAAe;AAHL,SAAAA;AAAA,GAAA;AAqBL,IAAK,2BAAL,kBAAKC,8BAAL;AAIL,EAAAA,0BAAA,iBAAc;AAId,EAAAA,0BAAA,YAAS;AARC,SAAAA;AAAA,GAAA;AAcL,IAAK,wBAAL,kBAAKC,2BAAL;AAIL,EAAAA,uBAAA,gBAAa;AAIb,EAAAA,uBAAA,eAAY;AAIZ,EAAAA,uBAAA,YAAS;AAZC,SAAAA;AAAA,GAAA;AA8BL,MAAM,uBAAuB,YAAY;AAAA,EAC9C,QAAe;AAAA,
|
|
4
|
+
"sourcesContent": ["import type { ReactiveControllerHost } from '@lit/reactive-element';\nimport atmosphere from 'atmosphere.js';\nimport type { Subscription } from './Connect.js';\nimport { getCsrfTokenHeadersForEndpointRequest } from './CsrfUtils.js';\nimport {\n isClientMessage,\n type ServerCloseMessage,\n type ServerConnectMessage,\n type ServerMessage,\n} from './FluxMessages.js';\n\nexport enum State {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n RECONNECTING = 'reconnecting',\n}\n\ntype ActiveEvent = CustomEvent<{ active: boolean }>;\ninterface EventMap {\n 'state-changed': ActiveEvent;\n}\n\ntype ListenerType<T extends keyof EventMap> =\n | ((this: FluxConnection, ev: EventMap[T]) => any)\n | {\n handleEvent(ev: EventMap[T]): void;\n }\n | null;\n\n/**\n * Possible options for dealing with lost subscriptions after a websocket is reopened.\n */\nexport enum ActionOnLostSubscription {\n /**\n * The subscription should be resubscribed using the same server method and parameters.\n */\n RESUBSCRIBE = 'resubscribe',\n /**\n * The subscription should be removed.\n */\n REMOVE = 'remove',\n}\n\n/**\n * Possible states of a flux subscription.\n */\nexport enum FluxSubscriptionState {\n /**\n * The subscription is not connected and is trying to connect.\n */\n CONNECTING = 'connecting',\n /**\n * The subscription is connected and receiving updates.\n */\n CONNECTED = 'connected',\n /**\n * The subscription is closed and is not trying to reconnect.\n */\n CLOSED = 'closed',\n}\n\n/**\n * Event wrapper for flux subscription connection state change callback\n */\nexport type FluxSubscriptionStateChangeEvent = CustomEvent<{ state: FluxSubscriptionState }>;\n\ntype EndpointInfo = {\n endpointName: string;\n methodName: string;\n params: unknown[] | undefined;\n reconnect?(): ActionOnLostSubscription | void;\n};\n\n/**\n * A representation of the underlying persistent network connection used for subscribing to Flux type endpoint methods.\n */\nexport class FluxConnection extends EventTarget {\n state: State = State.INACTIVE;\n wasClosed = false;\n readonly #endpointInfos = new Map<string, EndpointInfo>();\n #nextId = 0;\n readonly #onCompleteCallbacks = new Map<string, () => void>();\n readonly #onErrorCallbacks = new Map<string, () => void>();\n readonly #onNextCallbacks = new Map<string, (value: any) => void>();\n readonly #onStateChangeCallbacks = new Map<string, (event: FluxSubscriptionStateChangeEvent) => void>();\n readonly #statusOfSubscriptions = new Map<string, FluxSubscriptionState>();\n #pendingMessages: ServerMessage[] = [];\n #socket?: Atmosphere.Request;\n\n constructor(connectPrefix: string, atmosphereOptions?: Partial<Atmosphere.Request>) {\n super();\n this.#connectWebsocket(connectPrefix.replace(/connect$/u, ''), atmosphereOptions ?? {});\n }\n\n #resubscribeIfWasClosed() {\n if (this.wasClosed) {\n this.wasClosed = false;\n const toBeRemoved: string[] = [];\n this.#endpointInfos.forEach((endpointInfo, id) => {\n if (endpointInfo.reconnect?.() === ActionOnLostSubscription.RESUBSCRIBE) {\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTING);\n this.#send({\n '@type': 'subscribe',\n endpointName: endpointInfo.endpointName,\n id,\n methodName: endpointInfo.methodName,\n params: endpointInfo.params,\n });\n } else {\n toBeRemoved.push(id);\n }\n });\n toBeRemoved.forEach((id) => this.#removeSubscription(id));\n }\n }\n\n /**\n * Subscribes to the flux returned by the given endpoint name + method name using the given parameters.\n *\n * @param endpointName - the endpoint to connect to\n * @param methodName - the method in the endpoint to connect to\n * @param parameters - the parameters to use\n * @returns a subscription\n */\n subscribe(endpointName: string, methodName: string, parameters?: unknown[]): Subscription<any> {\n const id: string = this.#nextId.toString();\n this.#nextId += 1;\n const params = parameters ?? [];\n\n const msg: ServerConnectMessage = { '@type': 'subscribe', endpointName, id, methodName, params };\n this.#send(msg);\n this.#endpointInfos.set(id, { endpointName, methodName, params });\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTING);\n const hillaSubscription: Subscription<any> = {\n cancel: () => {\n if (!this.#endpointInfos.has(id)) {\n // Subscription already closed or canceled\n return;\n }\n\n const closeMessage: ServerCloseMessage = { '@type': 'unsubscribe', id };\n this.#send(closeMessage);\n this.#removeSubscription(id);\n },\n context(context: ReactiveControllerHost): Subscription<any> {\n context.addController({\n hostDisconnected() {\n hillaSubscription.cancel();\n },\n });\n return hillaSubscription;\n },\n onComplete: (callback: () => void): Subscription<any> => {\n this.#onCompleteCallbacks.set(id, callback);\n return hillaSubscription;\n },\n onError: (callback: () => void): Subscription<any> => {\n this.#onErrorCallbacks.set(id, callback);\n return hillaSubscription;\n },\n onNext: (callback: (value: any) => void): Subscription<any> => {\n this.#onNextCallbacks.set(id, callback);\n return hillaSubscription;\n },\n onSubscriptionLost: (callback: () => ActionOnLostSubscription | void): Subscription<any> => {\n if (this.#endpointInfos.has(id)) {\n this.#endpointInfos.get(id)!.reconnect = callback;\n } else {\n console.warn(`\"onReconnect\" value not set for subscription \"${id}\" because it was already canceled`);\n }\n return hillaSubscription;\n },\n onConnectionStateChange: (callback: (event: FluxSubscriptionStateChangeEvent) => void): Subscription<any> => {\n this.#onStateChangeCallbacks.set(id, callback);\n callback(\n new CustomEvent('subscription-state-change', { detail: { state: this.#statusOfSubscriptions.get(id)! } }),\n );\n return hillaSubscription;\n },\n };\n return hillaSubscription;\n }\n\n #connectWebsocket(prefix: string, atmosphereOptions: Partial<Atmosphere.Request>) {\n const extraHeaders = getCsrfTokenHeadersForEndpointRequest(document);\n const pushUrl = 'HILLA/push';\n const url = prefix.length === 0 ? pushUrl : (prefix.endsWith('/') ? prefix : `${prefix}/`) + pushUrl;\n this.#socket = atmosphere.subscribe?.({\n contentType: 'application/json; charset=UTF-8',\n enableProtocol: true,\n transport: 'websocket',\n fallbackTransport: 'websocket',\n headers: extraHeaders,\n maxReconnectOnClose: 10000000,\n reconnectInterval: 5000,\n timeout: -1,\n trackMessageLength: true,\n url,\n onClose: () => {\n this.wasClosed = true;\n if (this.state !== State.INACTIVE) {\n this.state = State.INACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: false } }));\n }\n },\n onError: (response) => {\n // eslint-disable-next-line no-console\n console.error('error in push communication', response);\n },\n onMessage: (response) => {\n if (response.responseBody) {\n this.#handleMessage(JSON.parse(response.responseBody));\n }\n },\n onMessagePublished: (response) => {\n if (response?.responseBody) {\n this.#handleMessage(JSON.parse(response.responseBody));\n }\n },\n onOpen: () => {\n if (this.state !== State.ACTIVE) {\n this.#resubscribeIfWasClosed();\n this.state = State.ACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: true } }));\n this.#sendPendingMessages();\n }\n },\n onReopen: () => {\n if (this.state !== State.ACTIVE) {\n this.#resubscribeIfWasClosed();\n this.state = State.ACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: true } }));\n this.#sendPendingMessages();\n }\n },\n onReconnect: () => {\n if (this.state !== State.RECONNECTING) {\n this.state = State.RECONNECTING;\n this.#endpointInfos.forEach((_, id) => {\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTING);\n });\n }\n },\n onFailureToReconnect: () => {\n if (this.state !== State.INACTIVE) {\n this.state = State.INACTIVE;\n this.dispatchEvent(new CustomEvent('state-changed', { detail: { active: false } }));\n this.#endpointInfos.forEach((_, id) => this.#setSubscriptionConnState(id, FluxSubscriptionState.CLOSED));\n }\n },\n ...atmosphereOptions,\n } satisfies Atmosphere.Request);\n }\n\n #setSubscriptionConnState(id: string, state: FluxSubscriptionState) {\n const currentState = this.#statusOfSubscriptions.get(id);\n if (!currentState) {\n this.#statusOfSubscriptions.set(id, state);\n this.#onStateChangeCallbacks.get(id)?.(\n new CustomEvent('subscription-state-change', { detail: { state: this.#statusOfSubscriptions.get(id)! } }),\n );\n } else if (currentState !== state) {\n this.#statusOfSubscriptions.set(id, state);\n this.#onStateChangeCallbacks.get(id)?.(\n new CustomEvent('subscription-state-change', { detail: { state: this.#statusOfSubscriptions.get(id)! } }),\n );\n }\n }\n\n #handleMessage(message: unknown) {\n if (isClientMessage(message)) {\n const { id } = message;\n const endpointInfo = this.#endpointInfos.get(id);\n\n if (message['@type'] === 'update') {\n const callback = this.#onNextCallbacks.get(id);\n if (callback) {\n callback(message.item);\n }\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CONNECTED);\n } else if (message['@type'] === 'complete') {\n this.#onCompleteCallbacks.get(id)?.();\n this.#removeSubscription(id);\n } else {\n const callback = this.#onErrorCallbacks.get(id);\n if (callback) {\n callback();\n }\n this.#removeSubscription(id);\n if (!callback) {\n throw new Error(\n endpointInfo\n ? `Error in ${endpointInfo.endpointName}.${endpointInfo.methodName}(${JSON.stringify(endpointInfo.params)}): ${message.message}`\n : `Error in unknown subscription: ${message.message}`,\n );\n }\n }\n } else {\n throw new Error(`Unknown message from server: ${String(message)}`);\n }\n }\n\n #removeSubscription(id: string) {\n this.#setSubscriptionConnState(id, FluxSubscriptionState.CLOSED);\n this.#statusOfSubscriptions.delete(id);\n this.#onStateChangeCallbacks.delete(id);\n this.#onNextCallbacks.delete(id);\n this.#onCompleteCallbacks.delete(id);\n this.#onErrorCallbacks.delete(id);\n this.#endpointInfos.delete(id);\n }\n\n #send(message: ServerMessage) {\n if (this.state === State.INACTIVE) {\n this.#pendingMessages.push(message);\n } else {\n this.#socket?.push?.(JSON.stringify(message));\n }\n }\n\n #sendPendingMessages() {\n this.#pendingMessages.forEach((msg) => this.#send(msg));\n this.#pendingMessages = [];\n }\n}\n\nexport interface FluxConnection {\n addEventListener<T extends keyof EventMap>(type: T, listener: ListenerType<T>): void;\n removeEventListener<T extends keyof EventMap>(type: T, listener: ListenerType<T>): void;\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAO,gBAAgB;AAEvB,SAAS,6CAA6C;AACtD;AAAA,EACE;AAAA,OAIK;AAEA,IAAK,QAAL,kBAAKA,WAAL;AACL,EAAAA,OAAA,YAAS;AACT,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,kBAAe;AAHL,SAAAA;AAAA,GAAA;AAqBL,IAAK,2BAAL,kBAAKC,8BAAL;AAIL,EAAAA,0BAAA,iBAAc;AAId,EAAAA,0BAAA,YAAS;AARC,SAAAA;AAAA,GAA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WAAK,iBAAiB,KAAK,OAAO;AAAA,IACpC,OAAO;AACL,WAAK,SAAS,OAAO,KAAK,UAAU,OAAO,CAAC;AAAA,IAC9C;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,SAAK,iBAAiB,QAAQ,CAAC,QAAQ,KAAK,MAAM,GAAG,CAAC;AACtD,SAAK,mBAAmB,CAAC;AAAA,EAC3B;AACF;",
|
|
6
6
|
"names": ["State", "ActionOnLostSubscription", "FluxSubscriptionState"]
|
|
7
7
|
}
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@ function __REGISTER__(feature, vaadinObj = window.Vaadin ??= {}) {
|
|
|
2
2
|
vaadinObj.registrations ??= [];
|
|
3
3
|
vaadinObj.registrations.push({
|
|
4
4
|
is: feature ? `${"@vaadin/hilla-frontend"}/${feature}` : "@vaadin/hilla-frontend",
|
|
5
|
-
version: "24.6.0-
|
|
5
|
+
version: "24.6.0-alpha4"
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
8
|
export * from "./Authentication.js";
|