websocket-text-relay 1.1.6 → 1.1.7
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/README.md +3 -5
- package/changelog.md +10 -0
- package/package.json +1 -1
- package/src/ui/js/setup.js +4 -2
package/README.md
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
This application connects to your text editor using the Language Server Protocol (LSP) and then starts a websocket
|
|
4
4
|
server that front end clients can connect to and subscribe to file change events. This allows users to see their
|
|
5
5
|
front end changes evaluated immediately as they type, without having to first save the file to disk or reload the browser.
|
|
6
|
-
It's a similar concept to sites like CodePen and JsFiddle, except you can develop locally using your own text editor with all
|
|
7
|
-
of your personalized plugins instead of having to use an in browser code editor.
|
|
8
6
|
|
|
9
7
|
## Usage
|
|
10
8
|
|
|
@@ -23,14 +21,14 @@ the status UI and verify everything is running by first starting up your text ed
|
|
|
23
21
|
|
|
24
22
|
To use this on a professional level project that gives you the option to use modules, typescript, and react, I recommend using vite along with
|
|
25
23
|
the plugin [vite-plugin-websocket-text-relay](https://github.com/niels4/vite-plugin-websocket-text-relay). This plugin gives you all the power of vite when developing while also hooking
|
|
26
|
-
the live text updates into Vite's hot module reload system.
|
|
24
|
+
the live text updates into Vite's hot module reload system. See [live-demo-vite](https://github.com/niels4/live-demo-vite) for a complete project setup with Typescript, React, Vite, ViTest, and a simple router.
|
|
27
25
|
|
|
28
26
|
If you want to use this as a learning tool to play around with UI concepts using simple projects involving 1 html, css, and javascript file,
|
|
29
|
-
then check out
|
|
27
|
+
then check out [live-demo-vanillajs](https://github.com/niels4/live-demo-vanillajs). This is a great setup for following along with any short and focused web development tutorials.
|
|
30
28
|
|
|
31
29
|
And finally, the status UI for this project was also created using live updates from websocket-text-relay.
|
|
32
30
|
In addition to giving you live feedback on the status and activity of the application, it is also meant to serve as a
|
|
33
|
-
reference UI project that
|
|
31
|
+
reference UI project that doesn't use any external dependencies.
|
|
34
32
|
|
|
35
33
|
## Developing
|
|
36
34
|
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 1.1.7 - 2025/12/19
|
|
2
|
+
|
|
3
|
+
### UI Update
|
|
4
|
+
Allow default websocket port to be overridden with url search param: `?port=38378`
|
|
5
|
+
|
|
6
|
+
## 1.1.6 - 2025/12/19
|
|
7
|
+
|
|
8
|
+
### UI Update
|
|
9
|
+
Rewrite the UI to be simpler and fix browser compatibility issues.
|
|
10
|
+
|
|
1
11
|
## 1.1.5 - 2025/09/05
|
|
2
12
|
|
|
3
13
|
Minor UI spacing fix
|
package/package.json
CHANGED
package/src/ui/js/setup.js
CHANGED
|
@@ -4,8 +4,10 @@ import { setIsOnline, setSessions } from "./data/wtrStatus.js"
|
|
|
4
4
|
import { eventSubscriber } from "./setup/eventSubscriber.js" // make sure the eventSubscriber function is available on the __WTR__ object
|
|
5
5
|
import { emitActivity } from "./data/wtrActivity.js"
|
|
6
6
|
|
|
7
|
+
const searchParams = new URLSearchParams(window.location.search)
|
|
8
|
+
|
|
7
9
|
const FILE_PREFIX = "websocket-text-relay/src/ui/"
|
|
8
|
-
const
|
|
10
|
+
const wsPort = searchParams.get("port") ?? 38378
|
|
9
11
|
const { hostname, protocol } = window.location
|
|
10
12
|
const wsProtocol = protocol === "http:" ? "ws" : "wss"
|
|
11
13
|
const CSS_FILE = "css/main.css"
|
|
@@ -25,7 +27,7 @@ const jsFiles = [
|
|
|
25
27
|
"js/components/activityLabels.js",
|
|
26
28
|
]
|
|
27
29
|
|
|
28
|
-
const ws = new WebsocketClient({ port:
|
|
30
|
+
const ws = new WebsocketClient({ port: wsPort, host: hostname, protocol: wsProtocol })
|
|
29
31
|
|
|
30
32
|
const cssElement = document.getElementById("main_style")
|
|
31
33
|
|