Skip to content
Merged
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
2 changes: 1 addition & 1 deletion examples/hello-world/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ source 'https://rubygems.org'
gem 'puma'
gem 'rack'
# gem 'datastar'
gem 'datastar', path: '../../../sdk/ruby'
gem 'datastar', path: '../../../'
6 changes: 3 additions & 3 deletions examples/hello-world/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PATH
remote: ../../../sdk/ruby
remote: ../../..
specs:
datastar (1.0.0.beta.3)
datastar (1.0.0)
json
logger
rack (>= 3.1.14)

GEM
remote: https://rubygems.org/
specs:
json (2.12.2)
json (2.16.0)
logger (1.7.0)
nio4r (2.7.4)
puma (6.6.0)
Expand Down
10 changes: 5 additions & 5 deletions examples/hello-world/hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<head>
<title>Datastar SDK Demo</title>
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@main/bundles/datastar.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"></script>
</head>
<body class="bg-white dark:bg-gray-900 text-lg max-w-xl mx-auto my-16">
<div data-signals-delay="400" class="bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 rounded-lg px-6 py-8 ring shadow-xl ring-gray-900/5 space-y-2">
<div data-signals:delay="400" class="bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 rounded-lg px-6 py-8 ring shadow-xl ring-gray-900/5 space-y-2">
<div class="flex justify-between items-center">
<h1 class="text-gray-900 dark:text-white text-3xl font-semibold">
Datastar SDK Demo
Expand All @@ -22,14 +22,14 @@ <h1 class="text-gray-900 dark:text-white text-3xl font-semibold">
<label for="delay">
Delay in milliseconds
</label>
<input data-bind-delay id="delay" type="number" step="100" min="0" class="w-36 rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-sky-500 focus:outline focus:outline-sky-500 dark:disabled:border-gray-700 dark:disabled:bg-gray-800/20" />
<input data-bind:delay id="delay" type="number" step="100" min="0" class="w-36 rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-sky-500 focus:outline focus:outline-sky-500 dark:disabled:border-gray-700 dark:disabled:bg-gray-800/20" />
</div>
<button data-on-click="@get(&#39;/hello-world&#39;)" class="rounded-md bg-sky-500 px-5 py-2.5 leading-5 font-semibold text-white hover:bg-sky-700 hover:text-gray-100 cursor-pointer">
<button data-on:click="@get(&#39;/hello-world&#39;)" class="rounded-md bg-sky-500 px-5 py-2.5 leading-5 font-semibold text-white hover:bg-sky-700 hover:text-gray-100 cursor-pointer">
Start
</button>
</div>
<div class="my-16 text-8xl font-bold text-transparent" style="background: linear-gradient(to right in oklch, red, orange, yellow, green, blue, blue, violet); background-clip: text">
<div id="message">Hello, world!</div>
</div>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions examples/progress/progress.ru
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ INDEX = <<~HTML
}
</style>
<script type="module">#{PROGRESS}</script>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@release-candidate/bundles/datastar.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"></script>
</head>
<body>
<div class="demo-container">
<div class="col">
<p>
<button
data-indicator-_fetching
data-on-click="!$_fetching && @get('/', {openWhenHidden: true})"
data-attr-aria-disabled="`${$_fetching}`"
data-indicator:_fetching
data-on:click="!$_fetching && @get('/', {openWhenHidden: true})"
data-attr:aria-disabled="`${$_fetching}`"
>Start</button>
</p>
<div id="work">
Expand Down Expand Up @@ -280,7 +280,7 @@ run do |env|
sse.patch_elements(%(<div id="activity" class="col"></div>))

# step 1: add the initial progress component to the DOM
sse.patch_elements(%(<circular-progress id="work" data-bind-progress data-attr-progress="$progress"><h1 id="title">Processing...</h1></circular-progress>))
sse.patch_elements(%(<circular-progress id="work" data-bind:progress data-attr:progress="$progress"><h1 id="title">Processing...</h1></circular-progress>))

# step 2: simulate work and update the progress signal
0.upto(100) do |i|
Expand Down
2 changes: 1 addition & 1 deletion examples/threads/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ source 'https://rubygems.org'
gem 'puma'
gem 'rack'
# gem 'datastar'
gem 'datastar', path: '../../../sdk/ruby'
gem 'datastar', path: '../../../'
6 changes: 3 additions & 3 deletions examples/threads/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PATH
remote: ../../../sdk/ruby
remote: ../../..
specs:
datastar (1.0.0.beta.3)
datastar (1.0.0)
json
logger
rack (>= 3.1.14)

GEM
remote: https://rubygems.org/
specs:
json (2.12.2)
json (2.16.0)
logger (1.7.0)
nio4r (2.7.4)
puma (6.6.0)
Expand Down
6 changes: 3 additions & 3 deletions examples/threads/threads.ru
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ INDEX = <<~HTML
span { font-weight: bold; }
}
</style>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@release-candidate/bundles/datastar.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"></script>
</head>
<body>
<button#{' '}
data-on-click="@get('/')"#{' '}
data-indicator-heartbeat#{' '}
data-on:click="@get('/')"#{' '}
data-indicator:heartbeat#{' '}
>Start</button>
<p class="counter">Slow thread: <span id="slow">waiting</span></p>
<p class="counter">Fast thread: <span id="fast">waiting</span></p>
Expand Down