Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Jan 2, 2025
2 parents c0db1e4 + f72e78b commit 2f57404
Show file tree
Hide file tree
Showing 270 changed files with 2,952 additions and 2,857 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/sdk-dotnet-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build & Publish NuGet to GitHub Registry

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
outputs:
Version: ${{ steps.gitversion.outputs.SemVer }}
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 #fetch-depth is needed for GitVersion

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
with:
versionSpec: 5.x

- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.10.2
id: gitversion # step id used as reference for output values

- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
# Build/pack the project
- name: Setup .NET
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 9.0.x

- name: Build and Pack NuGet package with versioning
run: dotnet pack sdk/dotnet/src/Datastar.fsproj -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release

- name: Upload NuGet package to GitHub
uses: actions/upload-artifact@v4
with:
name: nugetPackage
path: sdk/dotnet/src/bin/Release/*.nupkg

release:
runs-on: ubuntu-latest
needs: build

steps:

- name: Download nuget package artifact
uses: actions/download-artifact@v4
with:
name: nugetPackage
path: nugetPackage

- name: Prep packages
run: dotnet nuget add source --username starfederation --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/starfederation/index.json"

- name: Push package to GitHub packages
if: needs.build.outputs.CommitsSinceVersionSource > 0 # Only release if there has been a commit/version change
run: dotnet nuget push nugetPackage/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate

- name: Publish to NuGet.org
if: needs.build.outputs.CommitsSinceVersionSource > 0 # Only release if there has been a commit/version change
run: dotnet nuget push nugetPackage/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Create Release
if: needs.build.outputs.CommitsSinceVersionSource > 0 # Only release if there has been a commit/version change
uses: ncipollo/release-action@v1.13.0
with:
tag: ${{ needs.build.outputs.Version }}
name: Release ${{ needs.build.outputs.Version }}
artifacts: "nugetPackage/*"
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ node_modules
datastar-website
*_bin
.DS_Store
*.qtpl.go
*.qtpl.go
*/java/target/
21 changes: 13 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# WIP Release Notes for Datastar

## v0.21.4
## v1.0.0-beta.1

Happy new 2025! We’ve tied up loose ends, made all final breaking changes to the API, and after a grueling couple of months we’re delighted to release Datastar v1.0.0-beta.1 🚀

After stabilising how nested signals work and living with the signal suffix `.value` for a while, we realised that it wasn’t as ergonomic as we wanted. So, honing our regex fu, we managed to switch (back) to a `$` prefix for signals and a `@` prefix for actions.

The symbols add Datastar specific namespacing – `$` for a $ignal, `@` for an @ction – so it’s immediately obvious what you’re working with, and you end up with much fewer characters to read and write!!

### Added

- Added a `contentType` option to the `sse()` action that, when set to `form`, submits the closest form element, or one specified using the `selector` option ([#400](https://github.com/starfederation/datastar/issues/400)).
- Added a `retryInterval` option to the `sse()` action, defaulting to 1 second ([#393](https://github.com/starfederation/datastar/issues/393)).
- Added the version number in a comment at the top of bundled files ([#401](https://github.com/starfederation/datastar/issues/401)).
- Added the `data-custom-validity` attribute ([#410](https://github.com/starfederation/datastar/issues/410)).

### Changed

- The `data-on-submit` event listener now prevents the default submission behavior of forms.
- Signals now have a `$` prefix (again) instead of a `.value` suffix (the regex search and replace from `(\w+(\.\w+)*)\.value` to `\$$1` may be helpful when updating your code).
- Actions now have a `@` prefix (again) instead of no suffix.
- Changed the `data-attributes` attribute to `data-attr` ([#422](https://github.com/starfederation/datastar/issues/422)).
- Changed TypeScript import paths back to relative paths, so that no config is required in the build step.

### Fixed

- Fixed a bug in which local signals were being unintentionally sent with requests ([#387](https://github.com/starfederation/datastar/issues/387)).
- Fixed a bug in which the bundler was not exporting Datastar ([#403](https://github.com/starfederation/datastar/issues/403)).
- Fixed a bug in which the persist plugin was not maintain values if the values were signals ([#403](https://github.com/starfederation/datastar/issues/413)).
- Fixed the `__outside` modifier so that elements contained within it are ignored ([#425](https://github.com/starfederation/datastar/issues/425)).
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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 12KiB script tag to your HTML.
Getting started is as easy as adding a single 12.6 KiB script tag to your HTML.

```html
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar/bundles/datastar.js"></script>
Expand All @@ -20,8 +20,8 @@ Then start adding frontend reactivity using declarative <code>data-*</code> attr

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

Visit the [Datastar Website »](https://data-star.dev/)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.21.4
1.0.0-beta.1
3 changes: 3 additions & 0 deletions build/consts_datastar_client.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

{%- func datastarClientConsts(data *ConstTemplateData) -%}
// {%s data.DoNotEdit %}
const lol = /🖕JS_DS🚀/.source
export const DSP = lol.slice(0, 5)
export const DSS = lol.slice(4)

export const DATASTAR = "{%s data.DatastarKey %}";
export const DATASTAR_EVENT = "{%s data.DatastarKey %}-event";
Expand Down
8 changes: 5 additions & 3 deletions build/consts_datastar_readme.qtpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% import "github.com/dustin/go-humanize" %}

{%- func datastarREADME(data *ConstTemplateData) -%}

![Version](https://img.shields.io/github/package-json/v/starfederation/datastar?filename=library/package.json)
Expand All @@ -12,7 +14,7 @@

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 12KiB script tag to your HTML.
Getting started is as easy as adding a single {%s humanize.CommafWithDigits( float64(data.VersionClientByteSizeGzip) / 1024.0, 1) %} KiB script tag to your HTML.

```html
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar/bundles/datastar.js"></script>
Expand All @@ -22,8 +24,8 @@ Then start adding frontend reactivity using declarative <code>data-*</code> attr

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

Visit the [Datastar Website »](https://data-star.dev/)
Expand Down
12 changes: 7 additions & 5 deletions build/consts_java.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public enum EventType {
EventType(String value) {
this.value = value;
}

public String getValue() {

@Override
public String toString() {
return value;
}
{%- endif -%}
Expand Down Expand Up @@ -92,11 +93,12 @@ public enum FragmentMergeMode {
FragmentMergeMode(String value) {
this.value = value;
}

public String getValue() {

@Override
public String toString() {
return value;
}
{%- endif -%}
{%- endfor -%}
}
{%- endfunc -%}
{%- endfunc -%}
6 changes: 3 additions & 3 deletions build/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ func writeOutConsts(version string) error {
"sdk/php/src/Consts.php": phpConsts,
"sdk/php/src/enums/EventType.php": phpEventType,
"sdk/php/src/enums/FragmentMergeMode.php": phpFragmentMergeMode,
"sdk/java/src/main/java/StarFederation/Datastar/Consts.java": javaConsts,
"sdk/java/src/main/java/StarFederation/Datastar/enums/EventType.java": javaEventType,
"sdk/java/src/main/java/StarFederation/Datastar/enums/FragmentMergeMode.java": javaFragmentMergeMode,
"sdk/java/src/main/java/starfederation/datastar/Consts.java": javaConsts,
"sdk/java/src/main/java/starfederation/datastar/enums/EventType.java": javaEventType,
"sdk/java/src/main/java/starfederation/datastar/enums/FragmentMergeMode.java": javaFragmentMergeMode,
}

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

0 comments on commit 2f57404

Please sign in to comment.