-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: native support for Websockets #12973
base: main
Are you sure you want to change the base?
Conversation
…ionality for different handlers at different URLs, added example use cases to options-2 test app, added upgrade function for supporting additional adapters, and much more.
|
preview: https://svelte-dev-git-preview-kit-12973-svelte.vercel.app/ this is an automated message |
@LukeHagar LMK, if you need any help with this (you can reach me also on discord |
@@ -20,7 +20,7 @@ | |||
"dropcss": "^1.0.16", | |||
"svelte": "^5.2.9", | |||
"svelte-check": "^4.1.1", | |||
"typescript": "^5.5.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the test apps were using TS 5.5.4 because it was needed when we upgraded them to use Svelte 5. Running pnpm check
doesn't reveal the type errors now because I think the pnpm-lock file is using TS 5.7.3 for everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I saw 5.5.3 some places and 5.5.4 some places. Perhaps we should standardize on 5.5.4 then
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
@@ -20,15 +21,15 @@ let init_promise; | |||
|
|||
export class Server { | |||
/** @type {import('types').SSROptions} */ | |||
#options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for removing the private access modifier?
There's some logic that's missing and might be important before the kit/packages/kit/src/runtime/server/respond.js Lines 176 to 177 in 461aa95
kit/packages/kit/src/runtime/server/respond.js Lines 242 to 245 in 461aa95
kit/packages/kit/src/runtime/server/respond.js Lines 299 to 322 in 461aa95
kit/packages/kit/src/runtime/server/respond.js Lines 330 to 345 in 461aa95
|
This PR is a replacement to #12961 with a completely different Websocket implementation using
crossws
that should be fully compatible with all major runtimes.Functionality has been validated locally using basic tests in the
options-2
test app.Here is the new usage experience.
+server.js
The newest implementation allows different sets of handlers to be implemented on a per-route basis. I have tested some basic uses of websockets locally to much success.
This PR is intended to:
Resolve #12358
Resolve #1491
Steps left
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits