Skip to content

Commit

Permalink
v0.21.0-beta1
Browse files Browse the repository at this point in the history
* Fix newline in SDK protocol for paths. (#281)

* Fix newline in SDK protocol for paths.
Fixes #272

* Update PHP SDK

* Fix newline in SDK protocol for paths in Go SDK #272

* Tweak wording

---------

Co-authored-by: Ben Croker <[email protected]>

* Rename data-store to data-merge-signals. (#280)

* Make title dynamic in site (#277)

* Make title dynamic in site
Fixes #263

* Update meta tags

---------

Co-authored-by: Ben Croker <[email protected]>

* Add release note

* Rename data-store to data-merge-signals.
Fixes #269

* Fix backend reference docs and example

* feat: Add fly-deploy.yaml, manually triggered via GH only for now

* Rename data-store to data-merge-signals.
Fixes #269

* Update SDK #269

---------

Co-authored-by: Ben Croker <[email protected]>
Co-authored-by: Andrew Welch <[email protected]>
Co-authored-by: Ben Croker <[email protected]>

* side effects

* Delaneyj/issue270 (#282)

* Start work on data-model removal #270

* move files  #270

* move all test and examples to data-bind from data-model

* merge consts

* Add release note

---------

Co-authored-by: Ben Croker <[email protected]>

* Move to `@` for actions (#283)

* move to @ for actions

* Rename store to signals for #284  (#289)

* Rename store to signals #284 passes tests

---------

Co-authored-by: Delaney Gillilan <[email protected]>

* Update CHANGELOG.md

* Release notes

* Preprocessor to macro (#290)

* Preprocessor to macro Fixes #285

---------

Co-authored-by: Andrew Welch <[email protected]>

* Remove RefMacro

* Tweka wording

* Fix docs

* Support explicit syntax (#297)

* refactor: Use Docker-dev for the base image, and build all the things

* refactor: Log in to the registry

* refactor: Run on workflow changes

* chore: revert changes

* Improve homepage title

* delete everything first

* add top level sdk folder
move go SDK
add back bundles and stuff to make tsbuild work

* update go SDK url

* fix: Fix issue with `make task`

* fix: Fix multiple linux arch’s, add `support` as a `deploy` dep

* refactor: Install `flyctl`

* refactor: Output to the current directory

* refactor: ignore .out

* refactor: Run via Docker container

* refactor: Use `flyctl` instead of the alias

* refactor: Docker-in-Docker

As per “The Socket Solution” here: https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/

* refactor: Fix comment

* refactor: Make fly alias

* refactor: Use fly alias

* add vendored back in

* fix: Revert relative paths

* refactor: Revert ignoring `.out`

* refactor: Run flyctl in the CI container

* refactor: Remove flyctl

* refactor: Remove socket bind mount

* refactor: Add `flyctl` back in so `make task deploy` can be done locally

* add types and nested signals

* Add canonical meta tag

* add more stuff back in

* add ( i think ) the rest of the plugins

* lazy generation ReactiveExpresison, get click to edit working

* data-merge-signals to data-signals
start @action to action

* Add WIP release notes

* update more examples removing @ syntax and moving to sse action

* remove deprecated examples

* The great $ purge of 2024

* Add error codes

* working on v21 syntax  #296
fix bind/intersect lazy reactiveExpression gen

* Fix todo demo

* Reorder plugins

* Start markdown errors

* Finish markdown errors

* Update release notes

* Add release note

* Update release note

* remove dup and require checks

* fix signals JSON usage
fix throttle/debounce lead/trail port

* make js obj helper
auto formatting
signal value needed explicit period prefix for value
data-signals lazy generates due to possible expressons
removeSignal applies after eval

* update test, 127/127

* Create VSCode extension (#295)

* Add attributes

* Finish attributes

* Fix repo URL

* Finish

* change attributes

* fix attributes

* VSCode extension improvements

* fix data-attributes example

* Fix a BEN!

* support individual data-class-foo calls

* error page

* Rework error pages

* Simplify

* Rework errors

* Fixes

* Delete `console.log` from library

* #296 persist back in

* Add missing error

* remove mouse move until I implement correctly

* i hate javascript

* . syntax for modifiers now :

* Extract plugin rules

* Add clarification comment

* support xor key or value for bind/ref/indicator

* Add KeyValRules

* Remove unused properties

* Update VSCode extension

* Update docs

* Improve getting started guide

* logic restored

* autogen error sidebar links

* fixed Restructure folders #287

* fix scroll test
* Prep docs for release

* Fixed check for exclusive requirements

* Build

* img diff

* add errors to nested signals
fix getting started

---------

Co-authored-by: Andrew Welch <[email protected]>
Co-authored-by: Ben Croker <[email protected]>
Co-authored-by: Ben Croker <[email protected]>

* fix signals type elision

---------

Co-authored-by: Ben Croker <[email protected]>
Co-authored-by: Andrew Welch <[email protected]>
Co-authored-by: Ben Croker <[email protected]>
  • Loading branch information
4 people authored Dec 5, 2024
1 parent ee215e5 commit 093aeac
Show file tree
Hide file tree
Showing 572 changed files with 8,044 additions and 6,404 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ datastar_site
data
.task
.idea
.DS_Store
node_modules
datastar-website
*_bin
.DS_Store
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/code/go/cmd/tsbuild/main.go",
"program": "${workspaceFolder}/code/go/cmd/build/main.go",
"cwd": "${workspaceFolder}"
}
]
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"go.coverOnSingleTestFile": true,
"go.coverOnSingleTest": true,
"editor.foldingStrategy": "indentation",
"makefile.configureOnOpen": false
"makefile.configureOnOpen": false,
"editor.formatOnSave": true
}
63 changes: 24 additions & 39 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
# Release Notes for Datastar
# WIP Release Notes for Datastar

## 0.20.1 - 2024-11-25
## 0.21.0 - Unreleased

VersionClientByteSize = 35970->35789
VersionClientByteSizeGzip = 12647->12568
We’ve overhauled Datastar in v0.21.0, doubling down on making nestable signals declarative. To that end, we’ve removed special characters, made the API more explicit and consistent, and fixed some restrictions to nested signals that we discovered. Signal values are now accessed in expressions using the syntax `signalName.value`, actions no longer have a prefix, and attribute keys support nested signals using dot-delimited paths.

### Added
- SDKs
- .NET
- Initial SDK release! #231
- PHP
- Allow KV pairs
- Author
- DevOps
- added `make test` & `make clean` to development Dockerfile

- Added the ability to merge one-off signals using the syntax `data-signals-foo="value"`.
- Added the ability to use dot-delimited paths to denote nested signals in applicable attribute keys (`data-signals-foo.bar="value"`).
- Added the ability to use multiple attributes using the syntax `data-attributes="{attrName1: value1, attrName2: value2}"`.
- Added the ability to use a single classes using the syntax `data-class-hidden="foo.value"`.
- Added the ability to use a key instead of a value to denote a signal name in the `data-bind`, `data-indicator` and `data-ref` attributes (`data-bind-foo`, `data-indicator-foo`, `data-ref-foo`).
- Added error codes and links to descriptions in the console for every error thrown.

### Changed
- Client
- Function expression optimizations #234
- Truthy Attributes were not getting set correctly #234
- Fix invalid headers sent via SSE #241
- Added hooks so NPM will package the correct files
- SDKs
- updated README for clarity around contributing
- Go
- Fix inverted logic for ViewTransitions #238
- PHP
- tagged SDK 1.0.0-alpha.1
- fixed retry duration
- general cleanup
- Website
- Bundler getting create valid zip for Windows #228
- General site improvements
- Actions section in getting started
- Fixed broken links for SDKs and CDN #225
- Try to fix Safari bug around caching SSE connections #239
- Devops
- fix `make dev` to work cross-platform
- moved development Dockerfile from Alpine to Ubuntu


### Removed
- DevOps
- Removed broken Github Actions

- Signals no longer have the `$` prefix and must be acessed using a `.value` suffix (`signalName.value`).
- Action plugins no longer have the `$` prefix.
- Renamed the `data-store` attribute to `data-signals`.
- Renamed the `data-bind` attribute to `data-attributes`.
- Renamed the `data-model` attribute to `data-bind`.
- Changed the `data-*` attribute modifier delimiter from `.` to `:` (`data-on-keydown:debounce_100ms:throttle_lead="value"`).
- The the `get()`, `post()`, `put()`, and `delete()` plugins have been replaced by a single `sse()` plugin that accepts the method as an option (`sse(url, {method="get"})`).
- The `setAll()` and `toggleAll` plugins now accept a dot-delimited path format, instead of a regular expression.

### Fixed

- Fixed headers not merging correctly.
- Fixed new lines in the SDK protocol for paths.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Anything outside of this scope may not be accepted. If you have a need for a fea

Before submitting bug reports and feature requests, please search the [open issues](https://github.com/starfederation/datastar/issues) and the _#help_ channel in the [Discord server](https://discord.gg/bnRNgZjgPh) to see if it has already been addressed. When submitting a [new issue](https://github.com/starfederation/datastar/issues/new), please use a descriptive title and include a clear description and as much relevant information as possible.

## Documentation
## Documentation

Datastar’s documentation is under active development. All the markdown files live in [this folder](https://github.com/starfederation/datastar/tree/develop/code/go/site/static/md). Improvements to them can be submitted via pull requests.
Datastar’s documentation is under active development. All the markdown files live in [this folder](https://github.com/starfederation/datastar/tree/develop/site/static/md). Improvements to them can be submitted via pull requests.

## Pull Requests

Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@
![Discord](https://img.shields.io/discord/1296224603642925098)
![GitHub Repo stars](https://img.shields.io/github/stars/starfederation/datastar?style=flat)

<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/code/go/site/static/images/rocket.gif"></p>
<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/site/static/images/rocket.gif"></p>

# Datastar

### A real-time hypermedia framework.
### The hypermedia framework.

Datastar helps you build real-time web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.
Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.

Getting started is as easy as adding a single script tag to your HTML.

```html
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar/bundles/datastar.js"></script>
```

Then start adding frontend reactivity using declarative `data-*` attributes.
Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.

Here’s what frontend reactivity looks like using Datastar:

```html
<input data-model="input" type="text">
<div data-text="$input.toUpperCase()"></div>
<button data-on-click="$post('/endpoint')">Save</button>
<input data-bind-input type="text">
<div data-text="input.value.toUpperCase()"></div>
<button data-on-click="sse('/endpoint', {method: 'post'})">Save</button>
```

Visit the [Datastar Website »](https://data-star.dev/)
Expand Down
46 changes: 23 additions & 23 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ tasks:
cmds:
- go install github.com/go-task/task/v3/cmd/task@latest
- go install github.com/a-h/templ/cmd/templ@latest
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-x64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-x64
platforms: [linux/amd64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64
platforms: [linux/arm64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-arm64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-arm64
platforms: [darwin/arm64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-x64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-x64
platforms: [darwin/amd64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-windows-x64.exe
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-windows-x64.exe
platforms: [windows]
- chmod +x code/go/site/tailwindcli
- chmod +x site/tailwindcli
- go install github.com/valyala/quicktemplate/qtc@latest

version:
Expand All @@ -39,7 +39,7 @@ tasks:
cmds:
- qtc

tsbuild:
build:
deps:
- qtc
sources:
Expand All @@ -50,20 +50,20 @@ tasks:
generates:
- "bundles/**/*"
cmds:
- go run code/go/cmd/tsbuild/main.go
- cp -r bundles/* code/go/site/static/js/
- mkdir -p code/ts/library/dist/
- cp -r bundles/* code/ts/library/dist/
- mkdir -p code/go/site/static/librarySource
- rm -rf code/go/site/static/librarySource/*
- cp -r code/ts/library/src/* code/go/site/static/librarySource/
- go run build/cmd/build/main.go
- cp -r bundles/* site/static/js/
- mkdir -p library/dist/
- cp -r bundles/* library/dist/
- mkdir -p site/static/librarySource
- rm -rf site/static/librarySource/*
- cp -r library/src/* site/static/librarySource/

libpub:
dir: code/ts/library
requires:
vars: [VERSION]
deps:
- tsbuild
- build
cmds:
- git push origin
- git tag v{{.VERSION}}
Expand All @@ -77,7 +77,7 @@ tasks:
- task: deploy

css:
dir: code/go/site
dir: site
sources:
- "**/*.templ"
- "**/*.md"
Expand Down Expand Up @@ -105,15 +105,15 @@ tasks:

support:
sources:
- code/go/**/*.templ
- code/go/**/*.go
- code/go/**/*.md
- code/go/site/static/**/*
- "**/*.templ"
- "**/*.go"
- "**/*.md"
- site/static/**/*
generates:
- ./datastar-website
deps:
- kill
- tsbuild
- build
- templ
- css

Expand All @@ -124,7 +124,7 @@ tasks:
- support
cmds:
- go mod tidy
- go build -o ./datastar-website code/go/cmd/site/main.go
- go build -o ./datastar-website "site/cmd/site/main.go"

deploy:
method: none
Expand All @@ -134,7 +134,7 @@ tasks:
- fly deploy --local-only

test:
dir: code/go/site/smoketests
dir: site/smoketests
deps:
- support
cmds:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20.1
0.21.0-beta1
File renamed without changes.
4 changes: 2 additions & 2 deletions code/go/cmd/tsbuild/main.go → build/cmd/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"time"

"github.com/starfederation/datastar/code/go/tsbuild"
build "github.com/starfederation/datastar/build"
)

func main() {
Expand All @@ -14,7 +14,7 @@ func main() {
log.Printf("Datastar built in %s", time.Since(start))
}()

if err := tsbuild.Build(); err != nil {
if err := build.Build(); err != nil {
log.Fatal(err)
}

Expand Down
8 changes: 4 additions & 4 deletions code/go/tsbuild/consts.go → build/consts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tsbuild
package build

import (
"time"
Expand Down Expand Up @@ -84,7 +84,7 @@ var Consts = &ConstTemplateData{
},
{
Name: toolbelt.ToCasedString("mergeSignalsOnlyIfMissing"),
Description: "Should a given set of signals merge if they are missing from the store?",
Description: "Should a given set of signals merge if they are missing?",
Value: false,
},
{
Expand Down Expand Up @@ -187,7 +187,7 @@ var Consts = &ConstTemplateData{
},
{
Name: toolbelt.ToCasedString("MergeSignals"),
Description: "An event for merging signals into the store.",
Description: "An event for merging signals.",
Value: "datastar-merge-signals",
},
{
Expand All @@ -197,7 +197,7 @@ var Consts = &ConstTemplateData{
},
{
Name: toolbelt.ToCasedString("RemoveSignals"),
Description: "An event for removing signals from the store.",
Description: "An event for removing signals.",
Value: "datastar-remove-signals",
},
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,29 @@
![Discord](https://img.shields.io/discord/1296224603642925098)
![GitHub Repo stars](https://img.shields.io/github/stars/starfederation/datastar?style=flat)

<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/code/go/site/static/images/rocket.gif"></p>
<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/site/static/images/rocket.gif"></p>

# Datastar

### A real-time hypermedia framework.
### The hypermedia framework.

Datastar helps you build real-time web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.
Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.

Getting started is as easy as adding a single script tag to your HTML.

```html
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar/bundles/datastar.js"></script>
```

Then start adding frontend reactivity using declarative `data-*` attributes.
Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.

Here’s what frontend reactivity looks like using Datastar:

```html
<input data-model="input" type="text">
<div data-text="$input.toUpperCase()"></div>
<button data-on-click="$post('/endpoint')">Save</button>
<input data-bind-input type="text">
<div data-text="input.value.toUpperCase()"></div>
<button data-on-click="sse('/endpoint', {method: 'post'})">Save</button>
```

Visit the [Datastar Website »](https://data-star.dev/)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 13 additions & 13 deletions code/go/tsbuild/run.go → build/run.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tsbuild
package build

import (
"compress/gzip"
Expand Down Expand Up @@ -42,7 +42,7 @@ func extractVersion() (string, error) {
version := strings.TrimSpace(string(versionBytes))

// Write out the version to the version file.
versionPath := "code/ts/library/src/engine/version.ts"
versionPath := "library/src/engine/version.ts"
versionContents := fmt.Sprintf("export const VERSION = '%s';\n", version)
if err := os.WriteFile(versionPath, []byte(versionContents), 0644); err != nil {
return "", fmt.Errorf("error writing version file: %w", err)
Expand All @@ -60,8 +60,8 @@ func createBundles() error {

result := api.Build(api.BuildOptions{
EntryPoints: []string{
"code/ts/library/src/bundles/datastar-core.ts",
"code/ts/library/src/bundles/datastar.ts",
"library/src/bundles/datastar-core.ts",
"library/src/bundles/datastar.ts",
},
Outdir: outDir,
Bundle: true,
Expand Down Expand Up @@ -127,15 +127,15 @@ func writeOutConsts(version string) error {
})

templates := map[string]func(data *ConstTemplateData) string{
"README.md": datastarREADME,
"code/ts/library/README.md": datastarREADME,
"code/ts/library/src/engine/consts.ts": datastarClientConsts,
"code/ts/library/package.json": datastarClientPackageJSON,
"code/go/sdk/consts.go": goConsts,
"code/dotnet/sdk/src/Consts.fs": dotnetConsts,
"code/php/sdk/src/Consts.php": phpConsts,
"code/php/sdk/src/enums/EventType.php": phpEventType,
"code/php/sdk/src/enums/FragmentMergeMode.php": phpFragmentMergeMode,
"README.md": datastarREADME,
"library/README.md": datastarREADME,
"library/src/engine/consts.ts": datastarClientConsts,
"library/package.json": datastarClientPackageJSON,
"sdk/go/consts.go": goConsts,
"sdk/dotnet/src/Consts.fs": dotnetConsts,
"sdk/php/src/Consts.php": phpConsts,
"sdk/php/src/enums/EventType.php": phpEventType,
"sdk/php/src/enums/FragmentMergeMode.php": phpFragmentMergeMode,
}

for path, tmplFn := range templates {
Expand Down
Loading

0 comments on commit 093aeac

Please sign in to comment.