diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml index 011f0571f..18f396b07 100644 --- a/.github/workflows/fly-deploy.yml +++ b/.github/workflows/fly-deploy.yml @@ -23,6 +23,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to fly.io uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only + - run: | + docker container run --rm -t -v "${{ github.workspace }}":/app -v go-modules:/go/pkg/mod ghcr.io/starfederation/datastar-dev -c 'git lfs fetch --all && git lfs pull && git lfs checkout' + docker container run --rm -t -v "${{ github.workspace }}":/app -v go-modules:/go/pkg/mod ghcr.io/starfederation/datastar-dev -c 'task tools' + docker container run --rm -t -v "${{ github.workspace }}":/app -v go-modules:/go/pkg/mod ghcr.io/starfederation/datastar-dev -c 'task support' + flyctl deploy --local-only env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/.gitignore b/.gitignore index 17443a191..a7f6926a2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ datastar_site data .task .idea +.DS_Store node_modules datastar-website *_bin +.DS_Store \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index f3d836887..d28343d28 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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}" } ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 1890aff8e..731e49d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,29 @@ ## 0.21.0 - Unreleased +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 + +- 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 -- Changed the action plugin prefix from `$` to `@`. -- Renamed the `data-store` attribute to `data-merge-signals`. +- 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 headers not merging correctly. - Fixed new lines in the SDK protocol for paths. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f199f009..774cc2155 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/Dockerfile-dev b/Dockerfile-dev index 37892dd63..8379bf102 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -39,6 +39,11 @@ RUN apt update && sudo apt upgrade \ && \ go install github.com/valyala/quicktemplate/qtc@latest \ && \ + # Install flyctl cli \ + curl -L https://fly.io/install.sh | sh \ + && \ + ln -s /root/.fly/bin/flyctl /usr/local/bin/fly \ + && \ # Make this a safe .git directory git config --global --add safe.directory /app diff --git a/Makefile b/Makefile index bc8d81ccb..bb3a2b2db 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,11 @@ dev: --image-check # Build the Docker image image-build: docker build -f Dockerfile-dev . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache -ifeq ($(ARCH),arm64) - ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} -c 'wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64' -endif ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} -c 'git lfs fetch --all && git lfs pull && git lfs checkout' ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} -c 'task tools' # Run the passed in task command task: --image-check - ${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} ${IMAGE_NAME} -c 'task $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)' + ${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} -c 'task $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)' # Run the test suite test: --image-check ${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} -c 'task test' diff --git a/README.md b/README.md index f4c44d875..2ca5d2027 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,29 @@   -