Commit Graph

14 Commits

Author SHA1 Message Date
Ismael Celis 5d46096dc2
Ruby SDK (#600)
* WiP initial setup, ServerSentEventGenerator class

* WiP working merge_fragments in Rails

* #merge_fragments and #merge_signals

* Handle SSE vs Data* options

* Test that #merge_fragments works with a #call(view_context:) interface

* Test Dispatcher#stream

* #remove_fragments

* #remove_signals

* #execute_script

* execute_script with attributes Hash

* Connection: keep-alive

* Use 2 line-breaks as message end, plus last line's 1 line break (3 total)

* Connection callbacks. #on_connect, #on_disconnect, #on_error

* Dispatcher#signals

* Omit retry if using default value (1000)

* Omit defaults

* Multiline scripts

* Test Rack endpoint

* Document test Rack endpoint

* Add missing defaults

* Spawn multiple streams in threads, client_disconnect and server_disconnect handlers

* Move ThreadSpawner to configuration

* Configure a RailsThreadSpawner when Rails detected

* Move Railtie one dir up

* Global error callback

Datastar.config.on_error { |err| Sentry.notify(err) }

* Catch exception from stream threads in main thread

* Linearlize exception handling

* Refactor dispatcher to handle single stream in main thread, multi streams in separate threads

* spawner => executor. Rails Async executor using fibers.

* Support Async for fiber-based concurrency

* Finalize response for Rack and Rails

* test Rack app

* Threaded demo

* Test Dispatcher#sse?

Also do not check for SSE Accept on stream.
Leave it up to the user.

* Do not check Accept header in test app. Test scripts don't send it properly.

* Document code

* Example progress bar Rack app

* README

* Link to D* SSE docs

* See examples

* Document callbacks

* List Ruby SDK in SDKs.md

* Ruby struct in consts.go

* Document running tasks with arguments via Docker

* Code-gen Ruby constants from shared data via template

* Make test rely on constants

* Datastar.from_rack_env(env) => Datastar::Dispatcher

* Ruby example snippets

* #redirect(location)

* Ruby snippet using #redirect(new_path)

* Add X-Accel-Buffering: no header

To disable response buffering by NGinx and other proxies.

* Clarify linearisation of updates in Readme

* Tidy-up progress example

* Move examples to /examples/ruby

* Document Rails and Phlex

* Version 1.0.0.beta.1

* Version 1.0.0.beta.1

* Do not set Connection header if not HTTP/1.1

* Don't touch BUILDING.md docs in this PR

* Remove Changelog for now

* Sort Ruby alphabetically (just "ruby", not the entire line)

* Add hello world example, remove progress bar one.

* Add hello-world example to code-gen

* Typos
2025-02-05 12:02:18 -06:00
Ben Croker b00c6d160e
Add SDK Contribution Guidelines [deploy-site] 2025-02-04 12:19:08 -06:00
Ben Croker ff52c94fb5
Improve SDKs [deploy-site] 2025-02-04 08:02:14 -06:00
Ben Croker ed980b3d4c
Update SDKs to ignore `retry` if set to default (#573)
* Update SDKs to ignore `retry` if set to default

* Remove from test output

* Build
2025-02-02 11:31:39 -06:00
Ben Croker 2234f3926f
Add more examples to SDKs page 2025-01-30 22:12:13 -06:00
JeremS 1e55dcf6d5
Clojure SDK (#540)
* Feature: added clojure sdk

Chore: rebasing on latest
(last commit from clojure-sdk d6259824908c)

* Fix: alphabetical order

* Docs: Actual broadcast example

* Test: adding shell test support

Fix: order of options in data-lines for execute scripts events

Fix: fixed signal handling / missing options

Refactor: using the generated constants for boolean options

* Test: passing shell tests

Chore: task build
2025-01-29 16:28:08 -06:00
Roman Frołow 929c32af4e
Update sdks.md - node.ts -> node.js (#537) 2025-01-27 17:23:25 -06:00
Johnathan Stevers 3850a0cb84
Fix Rust and Zig SDK Typos (#532)
* fix rust related typos

* swap zig and rust links to main
2025-01-27 07:37:02 -06:00
Ben Croker 1177a2d3ab
Improve SDK docs 2025-01-26 21:08:37 -06:00
Johnathan Stevers 44d758a1ca
Zig SDK (#531)
* zig sdk

* add Zig to `sdks.md`
2025-01-26 20:12:49 -06:00
Ben Croker cf7807b39b
Improve SDK docs 2025-01-25 17:56:24 -06:00
Ben Croker b91d183b8c
Add SDKs to homepage [deploy-site] 2025-01-23 21:47:58 -06:00
Yaroslav Lapin 937c7ccec4
fix htttp -> http in sdk reference (#512) 2025-01-22 20:03:18 -06:00
Ben Croker 8b43f29224
Add SDK page to docs (#486)
* Start SDK page

* Reorganise links

* Tweaks

* Fix link

* Add packages and examples

* Add link to reference

* Link authors

* Improve TS

* Fix path to consts

* Add PyPI package

* Fix spacing

* Add links to SDKs page

* Cleanup
2025-01-18 19:22:18 -06:00