diff --git a/README.md b/README.md index 0191c3b64..7b0902701 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Here’s what frontend reactivity looks like using Datastar: ```html -
+
``` diff --git a/code/go/site/routes_bundler.templ b/code/go/site/routes_bundler.templ index c13c679be..b40f7e327 100644 --- a/code/go/site/routes_bundler.templ +++ b/code/go/site/routes_bundler.templ @@ -39,7 +39,6 @@ templ PageBundler(r *http.Request, manifest PluginManifest, signals *BundlerSign {{ signal := fmt.Sprintf("includedPlugins.%s", plugin.Key) pluginDir := filepath.Dir(plugin.Path[11:]) - // cls := fmt.Sprintf("{'bg-base-200':!$%s, 'bg-success text-success-content': $%s}", signal, signal) }} if currentPath != pluginDir {
{ pluginDir }
diff --git a/code/go/site/routes_examples_bulk_update.templ b/code/go/site/routes_examples_bulk_update.templ index 8625f9d21..931c05d74 100644 --- a/code/go/site/routes_examples_bulk_update.templ +++ b/code/go/site/routes_examples_bulk_update.templ @@ -45,7 +45,7 @@ templ bulkUpdateContacts(signals *BulkUpdateSelectionSignals, contacts []*Contac class="checkbox" type="checkbox" data-bind="selections.all" - data-on-change="setAll('contact_', $selections.all)" + data-on-change="setAll('contact_', selections.value.all)" /> Name @@ -61,14 +61,14 @@ templ bulkUpdateContacts(signals *BulkUpdateSelectionSignals, contacts []*Contac
diff --git a/code/go/site/routes_examples_infinite_scroll.templ b/code/go/site/routes_examples_infinite_scroll.templ index 05aba72e2..688e6ccb3 100644 --- a/code/go/site/routes_examples_infinite_scroll.templ +++ b/code/go/site/routes_examples_infinite_scroll.templ @@ -16,7 +16,7 @@ templ infiniteScrollMore(signals *infiniteScrollSignals) { id="loading_message" class="alert alert-info" data-intersects={ fmt.Sprintf( - "$offset=%d;$limit=%d;%s", + "offset.value=%d;limit.value=%d;%s", signals.Offset+signals.Limit,signals.Limit, datastar.GetSSE("/examples/infinite_scroll/data"), ) } diff --git a/code/go/site/routes_examples_lazy_tabs.templ b/code/go/site/routes_examples_lazy_tabs.templ index 393c229ee..52ff23432 100644 --- a/code/go/site/routes_examples_lazy_tabs.templ +++ b/code/go/site/routes_examples_lazy_tabs.templ @@ -27,7 +27,7 @@ templ setupExamplesLazyTabsComponent(tabCount int, contents templ.Component, sig role="tab" class={ "tab", templ.KV("tab-active", i == signals.TabID) } data-on-click={ fmt.Sprintf( - "$tabId=%d;%s", i, + "tabId.value=%d;%s", i, datastar.GetSSE("/examples/lazy_tabs/data"), ) } data-testid={ fmt.Sprintf("tab_%d", i) } diff --git a/code/go/site/routes_examples_mousemove.templ b/code/go/site/routes_examples_mousemove.templ index f0e577836..c2f9035e2 100644 --- a/code/go/site/routes_examples_mousemove.templ +++ b/code/go/site/routes_examples_mousemove.templ @@ -22,7 +22,7 @@ templ cursorSVG(cursors map[string]MouseXY) { width="512" height="512" style="background-color: goldenrod" - data-on-mousemove="$x=evt.offsetX; $y=evt.offsetY" + data-on-mousemove="x.value=evt.offsetX; y.value=evt.offsetY" > for id, cursor := range cursors { {{ @@ -42,7 +42,7 @@ templ cursorSVG(cursors map[string]MouseXY) { } - + } diff --git a/code/go/site/routes_examples_quick_primer_go.templ b/code/go/site/routes_examples_quick_primer_go.templ index da3b57e7f..81ff81964 100644 --- a/code/go/site/routes_examples_quick_primer_go.templ +++ b/code/go/site/routes_examples_quick_primer_go.templ @@ -15,9 +15,9 @@ templ QuickPrimerGoView(signals *QuickPrimerGoSignals) {

Go Datastar Example

-
- -
+
+ +
Hello from Datastar!
#output
diff --git a/code/go/site/routes_examples_signals_ifmissing.go b/code/go/site/routes_examples_signals_ifmissing.go index 33dcea610..1757d3531 100644 --- a/code/go/site/routes_examples_signals_ifmissing.go +++ b/code/go/site/routes_examples_signals_ifmissing.go @@ -27,7 +27,7 @@ func setupExamplesSignalsIfMissing(examplesRouter chi.Router) error { switch i % 2 { case 0: - fragment := fmt.Sprintf(`
`, signals) + fragment := fmt.Sprintf(`
`, signals) sse.MergeFragments(fragment, datastar.WithMergeUpsertAttributes()) case 1: sse.MarshalAndMergeSignalsIfMissing(signals) diff --git a/code/go/site/routes_examples_templ_counter.templ b/code/go/site/routes_examples_templ_counter.templ index f3e8e827d..942a88524 100644 --- a/code/go/site/routes_examples_templ_counter.templ +++ b/code/go/site/routes_examples_templ_counter.templ @@ -28,11 +28,11 @@ templ templCounterExampleCounts() {
Global
-
+
User
-
+
} diff --git a/code/go/site/routes_examples_toggle_visibility.templ b/code/go/site/routes_examples_toggle_visibility.templ index 28cb6669b..a9624f16b 100644 --- a/code/go/site/routes_examples_toggle_visibility.templ +++ b/code/go/site/routes_examples_toggle_visibility.templ @@ -12,11 +12,11 @@ templ ToggleVisibilityView(signals *ShowSignals) { > -
+
Hello!
diff --git a/code/go/site/routes_home.templ b/code/go/site/routes_home.templ index 3047e7d7f..c0ba97ea0 100644 --- a/code/go/site/routes_home.templ +++ b/code/go/site/routes_home.templ @@ -268,9 +268,9 @@ templ TodoInput(i int) { placeholder="What needs to be done?" data-bind="input" data-on-keypress={ fmt.Sprintf(` - if (event.key === 'Enter' && $input.trim().length) { + if (event.key === 'Enter' && input.value.trim().length) { sse('/api/todos/%d/edit', {method:'put'}); - $input = ''; + input.value = ''; } `, i) } if i >= 0 { @@ -318,7 +318,7 @@ templ TodoRow(mode TodoViewMode, todo *Todo, i int, isEditing bool) { data-on-click={ datastar.DeleteSSE("/api/todos/%d", i) } data-testid={ fmt.Sprintf("delete_todo%d", i) } data-indicator={ fetchingSignalName } - data-disabled={ "$" + fetchingSignalName } + data-disabled={ "".value + fetchingSignalName } > @icon("material-symbols:close") diff --git a/code/go/site/shared.templ b/code/go/site/shared.templ index a7c9d95b1..a9565f5c8 100644 --- a/code/go/site/shared.templ +++ b/code/go/site/shared.templ @@ -261,10 +261,10 @@ templ codeSnippetFragment(block CodeSnippetBlock) {
for _, snippet := range block.Snippets { -
+
{ snippet.Path.Snake } @templ.Raw(snippet.ContentHighlighted)
@@ -288,5 +288,5 @@ templ templSignalsJSON() { } templ sseIndicator(signalName string) { -
+
} diff --git a/code/go/site/smoketests/disable_button_test.go b/code/go/site/smoketests/disable_button_test.go index 258348de3..381c93d69 100644 --- a/code/go/site/smoketests/disable_button_test.go +++ b/code/go/site/smoketests/disable_button_test.go @@ -15,7 +15,7 @@ func TestExampleDisableButton(t *testing.T) { t.Run("disabled button click", func(t *testing.T) { btn := page.MustElement("#target") initial := btn.MustAttribute("data-bind-disabled") - assert.Equal(t, "$shouldDisable", *initial) + assert.Equal(t, "shouldDisable.value", *initial) btn.MustClick() result := btn.MustAttribute("disabled") diff --git a/code/go/site/static/md/examples/active_search.md b/code/go/site/static/md/examples/active_search.md index 69488f6a2..d1d4fa369 100644 --- a/code/go/site/static/md/examples/active_search.md +++ b/code/go/site/static/md/examples/active_search.md @@ -23,4 +23,4 @@ The interesting part is the input field: /> ``` -The input issues a `GET` to `/active_search/data` with the input value bound to `$search`. The `debounce_1000ms` modifier ensures that the search is not issued on every keystroke, but only after the user has stopped typing for 1 second. This modifiers will be covered in more detail in the [reference section](/reference). +The input issues a `GET` to `/active_search/data` with the input value bound to `search`. The `debounce_1000ms` modifier ensures that the search is not issued on every keystroke, but only after the user has stopped typing for 1 second. This modifiers will be covered in more detail in the [reference section](/reference). diff --git a/code/go/site/static/md/examples/animations.md b/code/go/site/static/md/examples/animations.md index d0422f5af..a15833403 100644 --- a/code/go/site/static/md/examples/animations.md +++ b/code/go/site/static/md/examples/animations.md @@ -67,7 +67,7 @@ Building on the last example, we can fade in the new content the same way, start One of the nice features for reactivity is to show a spinner when a request is in flight. On any element that is using backend actions you can add a `data-indicator` attribute to show a spinner when the request is in flight. This can be done like so: ```html -
Spinner
+
Spinner

     
@@ -43,10 +43,10 @@ We take the [already converted](https://github.com/trung-kieen/bad-apple-ascii) >
-
%
+
%
-

+    

   
``` diff --git a/code/go/site/static/md/examples/classes.md b/code/go/site/static/md/examples/classes.md index 428e5c82d..fa6af700f 100644 --- a/code/go/site/static/md/examples/classes.md +++ b/code/go/site/static/md/examples/classes.md @@ -4,11 +4,11 @@
-
Count
-
+
Count
+
Remake blink tag
@@ -18,11 +18,11 @@ ```html
-
Count
-
+
Count
+
Remake blink tag
diff --git a/code/go/site/static/md/examples/click_to_load.md b/code/go/site/static/md/examples/click_to_load.md index 41db0e995..5e6efa189 100644 --- a/code/go/site/static/md/examples/click_to_load.md +++ b/code/go/site/static/md/examples/click_to_load.md @@ -17,7 +17,7 @@ This example shows how to implement click-to-load the next page in a table of da ```html @@ -31,7 +31,7 @@ event: datastar-merge-fragments id: 129804115990544446 data: mergeMode morph dat settleDuration 500 data: fragment diff --git a/code/go/site/static/md/examples/custom_events.md b/code/go/site/static/md/examples/custom_events.md index 8bc01d2c0..cac47f823 100644 --- a/code/go/site/static/md/examples/custom_events.md +++ b/code/go/site/static/md/examples/custom_events.md @@ -3,9 +3,9 @@ ## Demo
-
-
Event count: EventCount
-
Last Event Details: EventTime
+
+
Event count: EventCount
+
Last Event Details: EventTime
@@ -18,16 +18,16 @@ This is an example of two-way binding with a web component that reverses a strin ```html
- +
``` -The `name` attribute value is bound to the `$name` signals value, and an event listener modifies the `$reversed` signals value sent in the `reverse` event. +The `name` attribute value is bound to the `name.value` signals value, and an event listener modifies the `reversed.value` signals value sent in the `reverse` event. The web component observes changes to the `name` attribute and responds by reversing the string and dispatching a `reverse` event containing the resulting value. diff --git a/code/go/site/static/md/guide/batteries_included.md b/code/go/site/static/md/guide/batteries_included.md index b821442d3..4dbaa3775 100644 --- a/code/go/site/static/md/guide/batteries_included.md +++ b/code/go/site/static/md/guide/batteries_included.md @@ -6,7 +6,7 @@ Datastar was originally a branch of HTMX that was meant to make it more modular ## Evaluating data-\* attributes -Before we had used something like `data-text="$foo"` attribute. What this is actually doing under the hood is turning the string into a function that is evaluated safely into `(ctx)=> ctx.signals.foo.value` where `ctx` is a Datastar object that gives a sandboxed context to the expression. In this case its connected directly to the contents of a signal, but you could do any Javascript that is valid. This also means you could evaluate to a constant string but that would look something like `data-text="'hello world'"`, notice the quotes, otherwise it would be looking for variable `hello world` which isn't valid and would fail to evaluate. This is the one major gotcha of declarative code, you have to be careful about the context. We aren't using `eval` but generating [sandboxed functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) that are evaluated in a safe way similar to Alpine.js. +Before we had used something like `data-text="foo.value"` attribute. What this is actually doing under the hood is turning the string into a function that is evaluated safely into `(ctx)=> ctx.signals.foo.value` where `ctx` is a Datastar object that gives a sandboxed context to the expression. In this case its connected directly to the contents of a signal, but you could do any Javascript that is valid. This also means you could evaluate to a constant string but that would look something like `data-text="'hello world'"`, notice the quotes, otherwise it would be looking for variable `hello world` which isn't valid and would fail to evaluate. This is the one major gotcha of declarative code, you have to be careful about the context. We aren't using `eval` but generating [sandboxed functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) that are evaluated in a safe way similar to Alpine.js. ## More attributes @@ -17,7 +17,7 @@ So far we've seen `data-signals`, `data-bind` and `data-text`. There are many mo This is a simple way to show and hide elements. It's a simple way to do `v-if` in Vue or `x-show` in Alpine. ```html -
Hello World
+
Hello World
``` When the `foo` signal is truthy the div will be shown, otherwise it will be hidden. @@ -34,7 +34,7 @@ When the button is clicked it will log `hello world` to the console. ## Actions -Actions are helper functions that are made available during a `data-*` attribute evaluation. They are a way to do more complex operations without having to write a lot of javascript. Here are a few of the most common actions. They are prefixed with `$` to avoid any conflicts with other attributes. +Actions are helper functions that are made available during a `data-*` attribute evaluation. They are a way to do more complex operations without having to write a lot of javascript. Here are a few of the most common actions. ### `setAll` diff --git a/code/go/site/static/md/guide/getting_started.md b/code/go/site/static/md/guide/getting_started.md index 0ba7b178b..f1f83cd80 100644 --- a/code/go/site/static/md/guide/getting_started.md +++ b/code/go/site/static/md/guide/getting_started.md @@ -62,7 +62,7 @@ This creates a new signal called `input`, and binds it to the element's value. I To see this in action, we can use the [`data-text`](/reference/plugins_attributes#text) attribute. ```html -
+
I will get replaced with the contents of the input signal
``` @@ -75,17 +75,17 @@ To see this in action, we can use the [`data-text`](/reference/plugins_attribute
Output:
-
+
-This sets the text content of an element to the value of the signal `$input`. The `$` is required to denote a signal in the expression. +This sets the text content of an element to the value of the signal `input.value`. The `.value` is required to denote a the use of a signal's *contents* in the expression. The value of the `data-text` attribute is an expression that is evaluated, meaning that we can use JavaScript in it. ```html -
+
Will be replaced with the uppercase contents of the input signal
``` @@ -98,7 +98,7 @@ The value of the `data-text` attribute is an expression that is evaluated, meani
Output:
-
+
@@ -108,15 +108,15 @@ The value of the `data-text` attribute is an expression that is evaluated, meani The `data-computed-*` attribute creates a new signal that is computed based on an expression. The computed signal is read-only, and its value is automatically updated when any signals in the expression are updated. ```html -
+
-
+
Will be replaced with the contents of the repeated signal
``` -
+
Input:
@@ -124,7 +124,7 @@ The `data-computed-*` attribute creates a new signal that is computed based on a
Output:
-
+
@@ -134,7 +134,7 @@ The `data-computed-*` attribute creates a new signal that is computed based on a The `data-show` attribute can be used to show or hide an element based on whether a JavaScript expression evaluates to `true` or `false`. ```html - + ``` This results in the button being visible only when the input is _not_ empty. @@ -147,10 +147,10 @@ This results in the button being visible only when the input is _not_ empty.
Output:
-
+
-
@@ -160,13 +160,13 @@ This results in the button being visible only when the input is _not_ empty. The [`data-class`](/reference/plugins_attributes#class) attribute allows us to add or remove classes from an element using a set of key-value pairs that map to the class name and expression. ```html - + ``` -Since the expression evaluates to `true` or `false`, we can rewrite this as `!$input`. +Since the expression evaluates to `true` or `false`, we can rewrite this as `!input.value`. ```html - + ```
@@ -177,10 +177,10 @@ Since the expression evaluates to `true` or `false`, we can rewrite this as `!$i
Output:
-
+
- @@ -190,7 +190,7 @@ Since the expression evaluates to `true` or `false`, we can rewrite this as `!$i The `data-bind-*` attribute can be used to bind a JavaScript expression to **any** valid HTML attribute. The becomes even more powerful when combined with [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components). ```html - + ``` This results in the button being given the `disabled` attribute whenever the input is empty. @@ -203,10 +203,10 @@ This results in the button being given the `disabled` attribute whenever the inp
Output:
-
+
- @@ -236,10 +236,10 @@ Signals are nestable, which can be useful for namespacing. The [`data-on-*`](/reference/plugins_attributes#on) attribute can be used to execute a JavaScript expression whenever an event is triggered on an element. ```html - + ``` -This results in the `$input` signal being set to an empty string when the button element is clicked. If the `$input` signal is used elsewhere, its value will automatically update. This, like `data-bind` can be used with **any** valid event name (e.g. `data-on-keydown`, `data-on-mouseover`, etc.). +This results in the `input.value` signal being set to an empty string when the button element is clicked. If the `input.value` signal is used elsewhere, its value will automatically update. This, like `data-bind` can be used with **any** valid event name (e.g. `data-on-keydown`, `data-on-mouseover`, etc.).
@@ -249,10 +249,10 @@ This results in the `$input` signal being set to an empty string when the button
Output:
-
+
- @@ -263,36 +263,36 @@ See if you can follow the code below _before_ trying the demo. ```html
What do you put in a toaster?
- -
- You answered “”. - That is correct ✅ - + +
+ You answered “”. + That is correct ✅ + The correct answer is “ - + ” 🤷
``` -
+
What do you put in a toaster?
-
- You answered “”. - That is correct ✅ - - The correct answer is “” 🤷 +
+ You answered “”. + That is correct ✅ + + The correct answer is “” 🤷
-
@@ -318,21 +318,21 @@ With our backend in place, we can now use the `data-on-click` attribute to trigg ```html
-
- You answered “”. - That is correct ✅ - - The correct answer is “” 🤷 +
+ You answered “”. + That is correct ✅ + + The correct answer is “” 🤷
@@ -340,21 +340,21 @@ With our backend in place, we can now use the `data-on-click` attribute to trigg Now when the `Fetch a question` button is clicked, the server will respond with an event to modify the `question` element in the DOM and an event to modify the `response` and `answer` signals. We're driving state from the backend! -
+
-
- You answered “”. - That is correct ✅ - - The correct answer is “” 🤷 +
+ You answered “”. + That is correct ✅ + + The correct answer is “” 🤷
-
@@ -367,7 +367,7 @@ Note that elements using the `data-indicator` attribute **_must_** have a unique ```html
-
+
-
+
@@ -493,11 +493,11 @@ This toggles the values of all signals containing `form_` (to either `true` or ` Using [`data-*`](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes) attributes, you can introduce reactive state to your frontend and access it anywhere in the DOM and in your backend. You can set up events that trigger requests to backend endpoints that respond with HTML fragment and signal updates. - Bind element values to signals: `data-bind="foo"` -- Set the text content of an element to an expression.: `data-text="$foo"` -- Create a computed signal: `data-computed-foo="$bar + 1"` -- Show or hide an element using an expression: `data-show="$foo" -- Modify the classes on an element: `data-class="{'font-bold': $foo}"` -- Bind an expression to an HTML attribute: `data-bind-disabled="$foo == ''"` +- Set the text content of an element to an expression.: `data-text="foo.value"` +- Create a computed signal: `data-computed-foo="bar.value + 1"` +- Show or hide an element using an expression: `data-show="foo.value" +- Modify the classes on an element: `data-class="{'font-bold': foo.value}"` +- Bind an expression to an HTML attribute: `data-bind-disabled="foo.value == ''"` - Merge signals into the signals: `data-signals="{foo: ''}"` - Execute an expression on an event: `data-on-click="sse(/endpoint)"` - Use signals to track in flight backend requests: `data-indicator="fetching"` diff --git a/code/go/site/static/md/guide/go_deeper.md b/code/go/site/static/md/guide/go_deeper.md index 9d5703c6c..0bcfe43f1 100644 --- a/code/go/site/static/md/guide/go_deeper.md +++ b/code/go/site/static/md/guide/go_deeper.md @@ -111,18 +111,20 @@ Now we want to update the label relationship. ```html
- +
``` +# TODO: BEN! $ + Here we've added another attribute `data-text` but the content has a `$` prefix. Remember that `data-*` attributes _are just strings_, which means we can give any semantics we want as long as it's consistent. It this case we are designating the use of a signal by adding a `$` prefix. Now went the `value` signal updates, so will the `innerHTML` of the label. Pretty neat. However, it doesn't yet match the original intent, which was to make it uppercase, so let's make a quick adjustment. ```html
- +
``` diff --git a/code/go/site/static/md/reference/expressions.md b/code/go/site/static/md/reference/expressions.md index 74b4e528e..572ece178 100644 --- a/code/go/site/static/md/reference/expressions.md +++ b/code/go/site/static/md/reference/expressions.md @@ -1,5 +1,7 @@ # Expressions +# TODO: BEN! $ + Expressions are the building blocks of Datastar. In fact, Datastar started as just a way to take `data-*` attributes and turn them into expressions. For exact `data-*` attribute found 1. All `macro` plugins are run. This allows for a custom DSL. The included plugins use `$` for signals, `@` for actions. The plugins check for regular expressions and replace them with the appropriate value. Some plugins will setup extra state on load like adding CSS classes or setting up event listeners. diff --git a/code/go/site/static/md/reference/plugins_attributes.md b/code/go/site/static/md/reference/plugins_attributes.md index fb8c8ee39..c74f63038 100644 --- a/code/go/site/static/md/reference/plugins_attributes.md +++ b/code/go/site/static/md/reference/plugins_attributes.md @@ -1,5 +1,7 @@ # Attribute Plugins +# TODO: BEN! $ + [Source](https://github.com/starfederation/datastar/blob/main/packages/library/src/lib/plugins/official/attributes.ts) Primarily used to help hook up the signals and the DOM. diff --git a/code/go/site/static/md/reference/plugins_backend.md b/code/go/site/static/md/reference/plugins_backend.md index 8541f8503..37dfc27b0 100644 --- a/code/go/site/static/md/reference/plugins_backend.md +++ b/code/go/site/static/md/reference/plugins_backend.md @@ -113,11 +113,11 @@ The `datastar-execute-script` event is used to execute JavaScript in the browser ### `data-indicator` ```html -Spinner +Spinner ``` @@ -137,6 +137,6 @@ Replaces the URL in the browser without reloading the page. The value can be a r ```html
+ data-replace-url="`/page${page.value}`">
``` diff --git a/code/go/site/static/md/reference/plugins_core.md b/code/go/site/static/md/reference/plugins_core.md index 3274f9d94..2655f7e13 100644 --- a/code/go/site/static/md/reference/plugins_core.md +++ b/code/go/site/static/md/reference/plugins_core.md @@ -27,7 +27,7 @@ Takes the contents of the attribute and runs a BigInt aware JSON parse on it. It ### Computed ```html -
+
``` Allows you to define a computed signals value that automatically updates its value based on an expression. This can be used to drive other reactive behaviors, such as updating classes or text content in the DOM. @@ -42,6 +42,8 @@ Makes an element available as a signal in the signals. ## Macro Plugins +# TODO: BEN! WAT + ### SignalMacro Takes a `$var` and converts into a `ctx.signals().var.value`. Since all expressions are evaluated within an effect it setups of a reactive system. diff --git a/code/go/site/static/md/reference/plugins_helpers.md b/code/go/site/static/md/reference/plugins_helpers.md index d7af458b1..3c3cce6a9 100644 --- a/code/go/site/static/md/reference/plugins_helpers.md +++ b/code/go/site/static/md/reference/plugins_helpers.md @@ -1,5 +1,7 @@ # Action Plugins +# TODO: BEN! $ + [Source](https://github.com/starfederation/datastar/blob/main/packages/library/src/lib/plugins/official/helpers.ts) ## `setAll(regexp: string, value: any)` diff --git a/code/go/site/static/md/reference/plugins_visibility.md b/code/go/site/static/md/reference/plugins_visibility.md index e384f9a7b..bf6787613 100644 --- a/code/go/site/static/md/reference/plugins_visibility.md +++ b/code/go/site/static/md/reference/plugins_visibility.md @@ -9,7 +9,7 @@ Focused on showing and hiding elements based on signals. Most of the time you wa ### Show ```html -
+
``` Shows the element when the expression is true. For anything custom, use `data-class` instead. diff --git a/code/go/tsbuild/consts_datastar_readme.qtpl b/code/go/tsbuild/consts_datastar_readme.qtpl index 0d20f423a..c03f79082 100644 --- a/code/go/tsbuild/consts_datastar_readme.qtpl +++ b/code/go/tsbuild/consts_datastar_readme.qtpl @@ -18,7 +18,7 @@ Here’s what frontend reactivity looks like using Datastar: ```html -
+
``` diff --git a/library/README.md b/library/README.md index 0191c3b64..7b0902701 100644 --- a/library/README.md +++ b/library/README.md @@ -16,7 +16,7 @@ Here’s what frontend reactivity looks like using Datastar: ```html -
+
```