Skip to content

Commit d5a16d8

Browse files
kettanaitoAndarist
andauthored
feat: support server-sent events (SSE) (#2299)
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
1 parent d4c287c commit d5a16d8

20 files changed

Lines changed: 1891 additions & 23 deletions

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20
1+
v20

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default tseslint.config(
1616
sourceType: 'module',
1717
},
1818
},
19-
ignores: ['/lib', '/node', '/native', '/config', 'test'],
19+
ignores: ['/lib', '/node', '/native', '/config', '/test'],
2020
rules: {
2121
'no-console': [
2222
'error',
@@ -60,6 +60,7 @@ export default tseslint.config(
6060
],
6161
rules: {
6262
'no-console': 'off',
63+
'@typescript-eslint/prefer-ts-expect-error': 'off',
6364
'@typescript-eslint/no-unused-vars': 'off',
6465
},
6566
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,14 @@
259259
"devDependencies": {
260260
"@commitlint/cli": "^18.4.4",
261261
"@commitlint/config-conventional": "^18.4.4",
262+
"@epic-web/test-server": "^0.1.6",
262263
"@eslint/eslintrc": "^3.3.1",
263264
"@eslint/js": "^9.34.0",
264265
"@fastify/websocket": "^8.3.1",
265266
"@graphql-typed-document-node/core": "^3.2.0",
266267
"@open-draft/test-server": "^0.4.2",
268+
"@playwright/test": "^1.50.1",
267269
"@ossjs/release": "^0.10.0",
268-
"@playwright/test": "^1.48.0",
269270
"@swc/core": "^1.13.5",
270271
"@types/eslint__js": "^8.42.3",
271272
"@types/express": "^4.17.21",

pnpm-lock.yaml

Lines changed: 85 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/browser/tsconfig.browser.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
// Expose browser-specific libraries only for the
55
// source code under the "src/browser" directory.
6-
"lib": ["DOM", "WebWorker"]
6+
"lib": ["DOM", "WebWorker", "DOM.Iterable"]
77
},
88
"include": ["../../global.d.ts", "./global.browser.d.ts", "./**/*.ts"]
99
}

src/core/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ export {
1717
type WebSocketHandlerConnection,
1818
} from './handlers/WebSocketHandler'
1919

20+
/* Server-Sent Events */
21+
export {
22+
sse,
23+
type ServerSentEventRequestHandler,
24+
type ServerSentEventResolver,
25+
type ServerSentEventResolverExtras,
26+
type ServerSentEventMessage,
27+
} from './sse'
28+
2029
/* Utils */
2130
export { matchRequestUrl } from './utils/matching/matchRequestUrl'
2231
export * from './utils/handleRequest'

0 commit comments

Comments
 (0)