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

WebSocket Support #1384

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

WebSocket Support #1384

wants to merge 2 commits into from

Conversation

frenzzy
Copy link
Contributor

@frenzzy frenzzy commented Mar 12, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

What is the new behavior?

Other information

Copy link

changeset-bot bot commented Mar 12, 2024

⚠️ No Changeset found

Latest commit: 8d5d498

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ryansolid
Copy link
Member

This is interesting. I have to admit I haven't thought much about this at all. Like what the ideal abstraction is?, how to expose it etc?.. I see this is a dedicated router which seems reasonable, but I'm going to need some more feedback to know what expectations are here. I don't know if @nksaraf has any thoughts. Might look at bringing this in as an experimental feature at first given us trying to lock down for 1.0.

@frenzzy
Copy link
Contributor Author

frenzzy commented Mar 13, 2024

Yes, it definitely is an experimental feature! I just wanted to allow people to start playing with it as soon as possible, since WebSockets are an important piece of modern web apps.

CrossWS seems very promising and runtime agnostic, similar to Nitro.

Related links:

@hardywu
Copy link
Contributor

hardywu commented May 31, 2024

ws endpoint could be include without modify solid-start package, with the help of new release of vinxi. solidjs/solid-docs#760

import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
	server: {
		experimental: {
			websocket: true,
		},
	},
}).addRouter({
	name: "party",
	type: "http",
	handler: "./src/ws.ts",
	target: "server",
	base: "/ws",
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants