Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support server-sent events (SSE) #2299

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
daec32b
feat: support server-sent events
kettanaito Sep 30, 2024
8c37fe0
fix: support passthrough via `server`
kettanaito Sep 30, 2024
7075686
fix: prevent double data serialization
kettanaito Sep 30, 2024
775c2d6
chore: rename sse test
kettanaito Sep 30, 2024
c53e13e
fix: make forwarding manual
kettanaito Oct 1, 2024
2edf2a6
chore: use node v20 for ci
kettanaito Oct 1, 2024
81cc17e
test: add "withCredentials" test
kettanaito Oct 1, 2024
1226612
fix: throw if EventSource is undefined
kettanaito Oct 1, 2024
4c49a14
feat: support `EventMap` type argument
kettanaito Oct 1, 2024
4471412
feat: support server-to-client forwarding
kettanaito Oct 2, 2024
3fdf314
test(axios-upload): wrap request promise in expect
kettanaito Oct 4, 2024
b11ba9b
fix: skip stringifying non-objects
kettanaito Oct 4, 2024
852870a
test: add runtime request handler test
kettanaito Oct 4, 2024
4d6ccfe
chore: use v22 for ci only
kettanaito Oct 4, 2024
8afa887
test: improve axios errors in test
kettanaito Oct 4, 2024
bbc4553
fix: fail connection on fetch failure
kettanaito Oct 10, 2024
2afd608
fix: prevent dispatching message if data is empty
kettanaito Oct 10, 2024
3402738
Merge branch 'main' into feat/sse
kettanaito Oct 13, 2024
8130892
Merge branch 'main' into feat/sse
kettanaito Nov 16, 2024
66098c3
Merge branch 'main' into feat/sse
kettanaito Feb 11, 2025
913f4c7
chore: update @playwright/test
kettanaito Feb 11, 2025
665560e
chore: fix type tests
kettanaito Feb 11, 2025
1960ee2
chore: remove NODE_OPTIONS from browser test args
kettanaito Feb 11, 2025
02e3335
Merge branch 'main' into feat/sse
kettanaito Feb 20, 2025
e0ba1eb
fix: set `accept` for bypassing the request
kettanaito Feb 20, 2025
e968886
test: fix promise return types
kettanaito Feb 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: 'pnpm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typescript-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Set up pnpm
uses: pnpm/action-setup@v4
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v22
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@
"devDependencies": {
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@epic-web/test-server": "^0.1.0",
"@fastify/websocket": "^8.3.1",
"@open-draft/test-server": "^0.4.2",
"@ossjs/release": "^0.8.1",
"@playwright/test": "^1.48.0",
"@playwright/test": "^1.50.1",
"@types/express": "^4.17.21",
"@types/fs-extra": "^11.0.4",
"@types/glob": "^8.1.0",
Expand Down
84 changes: 71 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/browser/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export { setupWorker } from './setupWorker/setupWorker'
export type { SetupWorker, StartOptions } from './setupWorker/glossary'
export { SetupWorkerApi } from './setupWorker/setupWorker'

/* Server-Sent Events */
export {
sse,
type ServerSentEventRequestHandler,
type ServerSentEventResolver,
} from './sse'
Loading
Loading