-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
327 changed files
with
8,558 additions
and
3,372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,46 +3,31 @@ name: Build & Publish NuGet to GitHub Registry | |
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
NuGetDirectory: ${{ github.workspace }}/nuget | ||
|
||
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/[email protected] | ||
with: | ||
versionSpec: 5.x | ||
|
||
- name: Determine Version | ||
uses: gittools/actions/gitversion/[email protected] | ||
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 }}" | ||
fetch-depth: 0 | ||
|
||
# Build/pack the project | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3.2.0 | ||
uses: actions/setup-dotnet@v4 | ||
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 | ||
run: dotnet pack sdk/dotnet/src/Datastar.fsproj --configuration Release --output ${{ env.NuGetDirectory }} | ||
|
||
- name: Upload NuGet package to GitHub | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nugetPackage | ||
path: sdk/dotnet/src/bin/Release/*.nupkg | ||
path: ${{ env.NuGetDirectory }}/*.nupkg | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
@@ -56,22 +41,5 @@ jobs: | |
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/[email protected] | ||
with: | ||
tag: ${{ needs.build.outputs.Version }} | ||
name: Release ${{ needs.build.outputs.Version }} | ||
artifacts: "nugetPackage/*" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
# WIP Release Notes for Datastar | ||
|
||
## v1.0.0-beta.3 | ||
## v1.0.0-beta.4 | ||
|
||
In this release we tuned the engine, added the ability to react to specific signal changes, and added some new modifiers. Idiomorph got an upgrade, and a few bugs were squashed. | ||
|
||
The most exciting part of this beta release is that it marks the final round of planned changes before we move to a stable v1 release 🚀 | ||
|
||
### Added | ||
|
||
- Added the ability to use an alias prefix when using the [bundler](https://data-star.dev/bundler). This makes it possible to use `data-customPrefix-*` attributes instead of `data-*`. | ||
- Added the ability to add a signal path to the `data-on-signals-change-*` attribute ([#587](https://github.com/starfederation/datastar/issues/587)). | ||
- Added a `__viewtransition` modifier to the `data-on-*` attribute that wraps the expression in `document.startViewTransition()` when the View Transition API is available ([#627](https://github.com/starfederation/datastar/issues/627)). | ||
- Added a `__case` modifier to the `data-signals-*`, `data-computed-*`, `data-ref-*`, `data-indicator-*`, `data-persist-*`, `data-bind-*`, `data-class-*`, and `data-on-*` attributes, allowing you to modify the casing of the key by adding `.kebab`, `.snake` or `.pascal`. | ||
- Added a `retrying` event type that is dispatched when the SSE plugin is trying to reconnect ([#583](https://github.com/starfederation/datastar/issues/583)). | ||
|
||
### Changed | ||
|
||
- Changed the `data-on-interval` attribute to accept a `__duration` modifier instead of a `__delay` modifier ([#513](https://github.com/starfederation/datastar/issues/513)). | ||
- The `data-custom-validity` attribute can now be used on `select` and `textarea` elements, in addition to `input` elements ([534](https://github.com/starfederation/datastar/issues/534)). | ||
- Changed how plugins are applied and cleaned up to use `MutationObserver` ([#528](https://github.com/starfederation/datastar/issues/528)). | ||
- Changed the parsing of Datastar expressions so that only semicolons can be used to explicitly indicate a statement delimiter ([#525](https://github.com/starfederation/datastar/issues/525)). | ||
- Idiomorph was updated to version 0.5.0 (pre-release) and is now imported as a module, making it easier to import future versions ([#608](https://github.com/starfederation/datastar/issues/608), [#633](https://github.com/starfederation/datastar/issues/633)). | ||
- Class names are no longer converted to kebab case when used in the `data-class-*` attribute ([#610](https://github.com/starfederation/datastar/issues/610)). | ||
- Event names are no longer converted to kebab case when used in the `data-on-*` attribute. | ||
|
||
### Fixed | ||
|
||
- Fixed a bug when using the `__delay` modifier on the `data-on-load` attribute ([#511](https://github.com/starfederation/datastar/issues/511)). | ||
- Fixed how Datastar expressions are evaluated to allow regular expressions and strings that contain semicolons and new lines ([#508](https://github.com/starfederation/datastar/issues/508)). | ||
- Fixed a bug with the `inner` merge mode that was causing only the inner HTML of a fragment to be merged ([#524](https://github.com/starfederation/datastar/issues/524)). | ||
- Fixed a bug in which signal values could get out of sync when populated by an input element by Chrome’s back/forward cache ([#530](https://github.com/starfederation/datastar/pull/530)). | ||
- Fixed a bug when generating IDs for elements that could result in duplicate IDs ([#533](https://github.com/starfederation/datastar/issues/533)). | ||
|
||
### Removed | ||
|
||
- Removed the `apply` function from the JavaScript API ([#528](https://github.com/starfederation/datastar/issues/528)). | ||
- Removed the `version` property from the JavaScript API ([#545](https://github.com/starfederation/datastar/issues/545)). | ||
- Fixed a bug in which signals were being cleared when merge fragments were sending down `data-signals` attributes ([#588](https://github.com/starfederation/datastar/issues/588)). | ||
- Fixed a bug in which using the `__ifmissing` modifier with the `data-signals-*` attribute was not having any effect ([#605](https://github.com/starfederation/datastar/issues/605)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ | |
|
||
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 13.3 KiB script tag to your HTML. | ||
Getting started is as easy as adding a single 14.3 KiB script tag to your HTML. | ||
|
||
```html | ||
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/[email protected].3/bundles/datastar.js"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/[email protected].4/bundles/datastar.js"></script> | ||
``` | ||
|
||
Then start adding frontend reactivity using declarative <code>data-*</code> attributes. | ||
|
@@ -26,6 +26,8 @@ Then start adding frontend reactivity using declarative <code>data-*</code> attr | |
|
||
Visit the [Datastar Website »](https://data-star.dev/) | ||
|
||
Watch the [Videos »](https://www.youtube.com/@data-star) | ||
|
||
Join the [Discord Server »](https://discord.com/channels/1296224603642925098/1296224603642925102) | ||
|
||
## Getting Started | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.0-beta.3 | ||
1.0.0-beta.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{% import "strings" %} | ||
{% import "strconv" %} | ||
{% import "fmt" %} | ||
{% func PadRight(s string, maxLen int) %}{% stripspace %} | ||
{%s s %}{%s strings.Repeat(" ", maxLen-len(s)) %} | ||
{% endstripspace %}{% endfunc %} | ||
{%- func haskellConsts(data *ConstTemplateData) -%} | ||
-- {%s data.DoNotEdit %} | ||
module ServerSentEventGenerator.Constants where | ||
|
||
import Prelude | ||
import ServerSentEventGenerator.Class (StringLike) | ||
|
||
-- taken from consts.ts | ||
-- why? | ||
-- functions must start with a lower case letter | ||
-- I could have used a type class, but it would have required | ||
-- a function call in front of each data constructor, so I | ||
-- decided to just use the prefix "c" | ||
|
||
cDatastarKey :: StringLike a => a | ||
cDatastarKey = "{%s data.DatastarKey %}" | ||
cVersion :: StringLike a => a | ||
cVersion = "{%s data.Version %}" | ||
cVersionClientByteSize :: Int | ||
cVersionClientByteSize = {%d data.VersionClientByteSize %} | ||
cVersionClientByteSizeGzip :: Int | ||
cVersionClientByteSizeGzip = {%d data.VersionClientByteSizeGzip %} | ||
{%- for _, d := range data.DefaultDurations -%} | ||
{%s PadRight(fmt.Sprintf("cDefault%s", d.Name.Pascal), 40) %} :: Int | ||
{%s PadRight(fmt.Sprintf("cDefault%s", d.Name.Pascal), 40) %} = {%d durationToMs(d.Duration) %} -- milliseconds | ||
{%- endfor -%} | ||
{%- for _, s := range data.DefaultStrings -%} | ||
{%s PadRight(fmt.Sprintf("c%s", s.Name.Pascal), 40) %} :: StringLike a => a | ||
{%s PadRight(fmt.Sprintf("c%s", s.Name.Pascal), 40) %} = "{%s s.Value %}" | ||
{%- endfor -%} | ||
{%- for _, literal := range data.DatalineLiterals -%} | ||
{%s PadRight(fmt.Sprintf("c%s", literal.Pascal), 40) %} :: StringLike a => a | ||
{%s PadRight(fmt.Sprintf("c%s", literal.Pascal), 40) %} = "{%s literal.Camel %}" | ||
{%- endfor -%} | ||
{%- for _, b := range data.DefaultBools -%} | ||
{% code | ||
boolStr := strconv.FormatBool(b.Value) | ||
capitalizedBool := strings.ToUpper(boolStr[:1]) + boolStr[1:] | ||
-%} | ||
{%s PadRight(fmt.Sprintf("cDefault%s", b.Name.Pascal), 40) %} :: Bool | ||
{%s PadRight(fmt.Sprintf("cDefault%s", b.Name.Pascal), 40) %} = {%s capitalizedBool %} | ||
{%- endfor -%} | ||
{%- for _, enum := range data.Enums -%} | ||
{%- for _, entry := range enum.Values -%} | ||
{%s PadRight(fmt.Sprintf("c%s", entry.Name.Pascal), 40) %} :: StringLike a => a | ||
{%s PadRight(fmt.Sprintf("c%s", entry.Name.Pascal), 40) %} = "{%v entry.Value %}" | ||
{%- endfor -%} | ||
{%- endfor -%} | ||
-- Added by Henry | ||
cData :: StringLike a => a | ||
cData = "data" | ||
cEvent :: StringLike a => a | ||
cEvent = "event" | ||
cEventId :: StringLike a => a | ||
cEventId = "id" | ||
cRetryDuration :: StringLike a => a | ||
cRetryDuration = "retry" | ||
cSColon :: StringLike a => a | ||
cSColon = ": " | ||
cSpace :: StringLike a => a | ||
cSpace = " " | ||
cDefaultSelector :: StringLike a => a | ||
cDefaultSelector = "" | ||
cDefaultEventId :: StringLike a => a | ||
cDefaultEventId = "" | ||
cDefaultOnlyIfMissing :: Bool | ||
cDefaultOnlyIfMissing = False | ||
cDefaultAttributes :: StringLike a => a | ||
cDefaultAttributes = "" | ||
{%- endfunc -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{%- func rubyConsts(data *ConstTemplateData) -%} | ||
# frozen_string_literal: true | ||
|
||
# {%s data.DoNotEdit %} | ||
module Datastar | ||
module Consts | ||
DATASTAR_KEY = '{%s data.DatastarKey %}' | ||
VERSION = '{%s data.Version %}' | ||
{%- for _, d := range data.DefaultDurations %} | ||
# {%s= d.Description %} | ||
DEFAULT_{%s d.Name.ScreamingSnake %} = {%d durationToMs(d.Duration) %} | ||
{%- endfor -%} | ||
{%- for _, b := range data.DefaultBools %} | ||
# {%s= b.Description %} | ||
DEFAULT_{%s b.Name.ScreamingSnake %} = {%v b.Value %} | ||
{%- endfor -%} | ||
{%- for _, s := range data.DefaultStrings %} | ||
# {%s= s.Description %}} | ||
DEFAULT_{%s s.Name.ScreamingSnake %} = '{%s s.Value %}' | ||
{%- endfor -%} | ||
|
||
{%- for _, enum := range data.Enums -%} | ||
{%- if enum.Name.Pascal == "FragmentMergeMode" -%} | ||
module FragmentMergeMode | ||
{%- for _, entry := range enum.Values %} | ||
# {%s entry.Description %} | ||
{%s entry.Name.ScreamingSnake %} = '{%s entry.Value %}' | ||
{%- endfor -%} | ||
end | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- for _, enum := range data.Enums -%} | ||
{%- if enum.Default != nil %} | ||
# {%s= enum.Description %} | ||
DEFAULT_{%s enum.Name.ScreamingSnake %} = {%s enum.Name.Pascal %}::{%s enum.Default.Name.ScreamingSnake %} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
|
||
# Dataline literals. | ||
{%- for _, literal := range data.DatalineLiterals -%} | ||
{%s literal.ScreamingSnake %}_DATALINE_LITERAL = '{%s literal.Camel %}' | ||
{%- endfor -%} | ||
end | ||
end | ||
{%- endfunc -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.