bigskysoftware / bigskysoftware/htmx-extensions

websocket replace root element without id

Open
#185 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
284
Forks
88
PR merge metrics
No merged PRs in 30d

Description

In ws extension everything is built on top of oobSwap making it impossible for incoming messages to swap innerHTML of the connecting element.

I want to run 2 (almost) identical websockets and it would cause ids to collide, is it possible to somehow not rely on the ids but swap the innerHTML of the element that is specified to be connected?

Example:
```html


Content to replace



Different content to replace


```

Any help is appreciated!

Contributor guide

Open the contributing guide

Research direction

Start by locating the WebSocket extension code that uses oobSwap and trace how incoming messages select their target. Reproduce the two ws-connect elements from the issue, then determine how each connection can update its own element without relying on colliding ids. Done means both connections independently replace their specified element content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.