Skip to content

Commit 4836b1d

Browse files
authored
Update examples to syntax for v1.0.0-RC.6 (#7)
Issue: https://github.com/starfederation/datastar/releases/tag/v1.0.0-RC.6
1 parent 69a394a commit 4836b1d

7 files changed

Lines changed: 21 additions & 21 deletions

File tree

examples/hello-world/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ source 'https://rubygems.org'
55
gem 'puma'
66
gem 'rack'
77
# gem 'datastar'
8-
gem 'datastar', path: '../../../sdk/ruby'
8+
gem 'datastar', path: '../../../'

examples/hello-world/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
PATH
2-
remote: ../../../sdk/ruby
2+
remote: ../../..
33
specs:
4-
datastar (1.0.0.beta.3)
4+
datastar (1.0.0)
55
json
66
logger
77
rack (>= 3.1.14)
88

99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
json (2.12.2)
12+
json (2.16.0)
1313
logger (1.7.0)
1414
nio4r (2.7.4)
1515
puma (6.6.0)

examples/hello-world/hello-world.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<head>
66
<title>Datastar SDK Demo</title>
77
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>
8-
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@main/bundles/datastar.js"></script>
8+
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"></script>
99
</head>
1010
<body class="bg-white dark:bg-gray-900 text-lg max-w-xl mx-auto my-16">
11-
<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">
11+
<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">
1212
<div class="flex justify-between items-center">
1313
<h1 class="text-gray-900 dark:text-white text-3xl font-semibold">
1414
Datastar SDK Demo
@@ -22,14 +22,14 @@ <h1 class="text-gray-900 dark:text-white text-3xl font-semibold">
2222
<label for="delay">
2323
Delay in milliseconds
2424
</label>
25-
<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" />
25+
<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" />
2626
</div>
27-
<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">
27+
<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">
2828
Start
2929
</button>
3030
</div>
3131
<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">
3232
<div id="message">Hello, world!</div>
3333
</div>
3434
</body>
35-
</html>
35+
</html>

examples/progress/progress.ru

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ INDEX = <<~HTML
230230
}
231231
</style>
232232
<script type="module">#{PROGRESS}</script>
233-
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@release-candidate/bundles/datastar.js"></script>
233+
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"></script>
234234
</head>
235235
<body>
236236
<div class="demo-container">
237237
<div class="col">
238238
<p>
239239
<button
240-
data-indicator-_fetching
241-
data-on-click="!$_fetching && @get('/', {openWhenHidden: true})"
242-
data-attr-aria-disabled="`${$_fetching}`"
240+
data-indicator:_fetching
241+
data-on:click="!$_fetching && @get('/', {openWhenHidden: true})"
242+
data-attr:aria-disabled="`${$_fetching}`"
243243
>Start</button>
244244
</p>
245245
<div id="work">
@@ -280,7 +280,7 @@ run do |env|
280280
sse.patch_elements(%(<div id="activity" class="col"></div>))
281281

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

285285
# step 2: simulate work and update the progress signal
286286
0.upto(100) do |i|

examples/threads/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ source 'https://rubygems.org'
55
gem 'puma'
66
gem 'rack'
77
# gem 'datastar'
8-
gem 'datastar', path: '../../../sdk/ruby'
8+
gem 'datastar', path: '../../../'

examples/threads/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
PATH
2-
remote: ../../../sdk/ruby
2+
remote: ../../..
33
specs:
4-
datastar (1.0.0.beta.3)
4+
datastar (1.0.0)
55
json
66
logger
77
rack (>= 3.1.14)
88

99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
json (2.12.2)
12+
json (2.16.0)
1313
logger (1.7.0)
1414
nio4r (2.7.4)
1515
puma (6.6.0)

examples/threads/threads.ru

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ INDEX = <<~HTML
2626
span { font-weight: bold; }
2727
}
2828
</style>
29-
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@release-candidate/bundles/datastar.js"></script>
29+
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js"></script>
3030
</head>
3131
<body>
3232
<button#{' '}
33-
data-on-click="@get('/')"#{' '}
34-
data-indicator-heartbeat#{' '}
33+
data-on:click="@get('/')"#{' '}
34+
data-indicator:heartbeat#{' '}
3535
>Start</button>
3636
<p class="counter">Slow thread: <span id="slow">waiting</span></p>
3737
<p class="counter">Fast thread: <span id="fast">waiting</span></p>

0 commit comments

Comments
 (0)