Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions .changeset/silver-clocks-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@solid-primitives/sse": minor
---

Initial release of `@solid-primitives/sse`.

### Primitives

- `makeSSE(url, options?)` — base non-reactive primitive. Creates an `EventSource`, attaches handlers, and returns `[source, cleanup]`. No Solid lifecycle dependency.
- `createSSE(url, options?)` — reactive primitive. Accepts a static or signal URL, closes on owner disposal, and exposes `data`, `error`, `readyState`, `close`, and `reconnect`.
- `makeSSEWorker(target, options?)` — runs the `EventSource` connection inside a Web Worker or SharedWorker, keeping network I/O off the main thread. The reactive API is identical to `createSSE`.

### Built-in transformers

- `json` — parse message data as a single JSON value
- `ndjson` — parse newline-delimited JSON into an array
- `lines` — split message data into a `string[]` by newline
- `number` — parse message data as a number via `Number()`
- `safe(transform, fallback?)` — fault-tolerant wrapper; returns `fallback` instead of throwing on bad input
- `pipe(a, b)` — compose two transforms into one
20 changes: 20 additions & 0 deletions .changeset/update-author-email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@solid-primitives/analytics": patch
"@solid-primitives/audio": patch
"@solid-primitives/clipboard": patch
"@solid-primitives/event-listener": patch
"@solid-primitives/geolocation": patch
"@solid-primitives/graphql": patch
"@solid-primitives/intersection-observer": patch
"@solid-primitives/media": patch
"@solid-primitives/page-visibility": patch
"@solid-primitives/raf": patch
"@solid-primitives/scheduled": patch
"@solid-primitives/scroll": patch
"@solid-primitives/share": patch
"@solid-primitives/timer": patch
"@solid-primitives/websocket": patch
"@solid-primitives/workers": patch
---

Update author email for David D.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "git+https://github.com/solidjs-community/solid-primitives.git"
},
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"license": "MIT",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/analytics",
"version": "0.2.0",
"description": "Primitive that makes managing analytics a lot easier.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"license": "MIT",
"homepage": "https://github.com/solidjs-community/solid-primitives/tree/main/packages/analytics#readme",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/audio",
"version": "1.4.2",
"description": "Primitives to manage audio and single sounds.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"license": "MIT",
"homepage": "https://primitives.solidjs.community/package/audio",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/clipboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/clipboard",
"version": "1.6.2",
"description": "Primitives for reading and writing to clipboard.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Damian Tarnawski <gthetarnav@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/event-listener/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/event-listener",
"version": "2.4.3",
"description": "SolidJS Primitives to manage creating event listeners.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Damian Tarnawski <gthetarnav@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/geolocation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/geolocation",
"version": "1.5.2",
"description": "Primitives to query geolocation and observe changes.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"license": "MIT",
"homepage": "https://primitives.solidjs.community/package/geolocation",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/graphql",
"version": "2.2.3",
"description": "Primitive that generates a client and reactive GraphQL queries",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Damian Tarnawski <gthetarnav@gmail.com>",
"Alex Ryapolov"
Expand Down
2 changes: 1 addition & 1 deletion packages/intersection-observer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/intersection-observer",
"version": "2.2.2",
"description": "Primitives to support using the intersection observer API.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Damian Tarnawski <gthetarnav@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/media",
"version": "2.3.3",
"description": "Primitives for media query and device features",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
{
"name": "Aditya Agarwal",
Expand Down
2 changes: 1 addition & 1 deletion packages/page-visibility/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/page-visibility",
"version": "2.1.3",
"description": "Primitive to track page visibility",
"author": "David Di Biase",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Damian Tarnawski <gthetarnav@gmail.com>",
"Tom Pichaud <dev.tompichaud@icloud.com>"
Expand Down
2 changes: 1 addition & 1 deletion packages/raf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/raf",
"version": "2.3.2",
"description": "Primitive that facilitates RAF functionality",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Tito <tito.bouzout@gmail.com>",
"Damian Tarnawski <gthetarnav@gmail.com>"
Expand Down
2 changes: 1 addition & 1 deletion packages/scheduled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.5.2",
"description": "Primitives for creating scheduled — throttled or debounced — callbacks.",
"contributors": [
"David Di Biase <dave.dibiase@gmail.com>",
"David Di Biase <dave@solidjs.com>",
"Damian Tarnawski <gthetarnav@gmail.com>",
"Jonathan Frere <jonathan.frere@esveo.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/scroll",
"version": "2.1.3",
"description": "Reactive primitives to react to element/window scrolling.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Damian Tarnawski <gthetarnav@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/share/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@solid-primitives/share",
"version": "2.2.3",
"description": "Primitives to help with sharing content on social media and beyond.",
"author": "David Di Biase <dave.dibiase@gmail.com>",
"author": "David Di Biase <dave@solidjs.com>",
"contributors": [
"Omer Ma<mapinxue@qq.com>",
"Tom Pichaud <dev.tompichaud@icloud.com>"
Expand Down
8 changes: 8 additions & 0 deletions packages/sse/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# @solid-primitives/sse

## 0.0.100

### Initial release

- `makeSSE` — base non-reactive primitive wrapping the browser `EventSource` API
- `createSSE` — reactive primitive with signals for `data`, `error`, and `readyState`, reactive URL support, SSR safety, and configurable app-level reconnection
21 changes: 21 additions & 0 deletions packages/sse/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Solid Primitives Working Group

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading