Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Datastar TypeScript SDK

[![Version](https://img.shields.io/badge/version-1.0.0–RC.4-orange)](https://github.com/starfederation/datastar-typescript/releases) [![npm](https://img.shields.io/npm/v/@starfederation/datastar-sdk?logo=npm&labelColor=CB3837&color=black)](https://www.npmjs.com/package/@starfederation/datastar-sdk)
[![Version](https://img.shields.io/badge/version-1.0.0-blue)](https://github.com/starfederation/datastar-typescript/releases) [![npm](https://img.shields.io/npm/v/@starfederation/datastar-sdk?logo=npm&labelColor=CB3837&color=black)](https://www.npmjs.com/package/@starfederation/datastar-sdk)

[![Node.js](https://img.shields.io/badge/run_time-node_js-2a682d?logo=nodedotjs&labelColor=black)](https://nodejs.org/) [![Deno](https://img.shields.io/badge/run_time-deno-6affaf?logo=deno&labelColor=black)](https://deno.land/) [![Bun](https://img.shields.io/badge/run_time-bun-f672b6?logo=bun&labelColor=black)](https://bun.sh/)

Expand Down
2 changes: 1 addition & 1 deletion examples/bun/bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const server = Bun.serve({
routes: {
"/": () => {
return new Response(
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.1/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
{
headers: { "Content-Type": "text/html" },
},
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Deno.serve(async (req: Request) => {

if (url.pathname === "/") {
return new Response(
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.1/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
{
headers: { "Content-Type": "text/html" },
},
Expand Down
2 changes: 1 addition & 1 deletion examples/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const server = createServer(async (req, res) => {
const headers = new Headers({ "Content-Type": "text/html" });
res.setHeaders(headers);
res.end(
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.1/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
);
} else if (req.url?.includes("/merge")) {
const reader = await ServerSentEventGenerator.readSignals(req);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@starfederation/datastar-sdk",
"version": "1.0.0-RC.4",
"version": "1.0.0",
"description": "TypeScript SDK for Datastar",
"scripts": {
"build": "deno run -A build.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const DATASTAR = "datastar" as const;
export const DATASTAR_REQUEST = "Datastar-Request";
export const VERSION = "1.0.0-RC.4";
export const VERSION = "1.0.0";

// The default duration for retrying SSE on connection reset. This is part of the underlying retry mechanism of SSE.
export const DefaultSseRetryDurationMs = 1000;
Expand Down
2 changes: 1 addition & 1 deletion src/node/serverSentEventGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class ServerSentEventGenerator extends AbstractSSEGenerator {
| { success: true; signals: Record<string, Jsonifiable> }
| { success: false; error: string }
> {
if (["GET", "DELETE"].includes(request.method)) {
if (request.method && ["GET", "DELETE"].includes(request.method)) {
const url = new URL(
`http://${process.env.HOST ?? "localhost"}${request.url}`,
);
Expand Down
2 changes: 1 addition & 1 deletion test/bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const server = Bun.serve({

if (url.pathname === "/") {
return new Response(
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.1/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
{
headers: { "Content-Type": "text/html" },
},
Expand Down
2 changes: 1 addition & 1 deletion test/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deno.serve(async (req: Request) => {

if (url.pathname === "/") {
return new Response(
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.1/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
{
headers: { "Content-Type": "text/html" },
},
Expand Down
2 changes: 1 addition & 1 deletion test/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const server = createServer(async (req, res) => {
if (req.url === "/") {
res.setHeader("Content-Type", "text/html");
res.end(
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.7/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
`<html><head><script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.1/bundles/datastar.js"></script></head><body><div id="toMerge" data-signals:foo="'World'" data-init="@get('/merge')">Hello</div></body></html>`,
);
} else if (req.url?.includes("/merge")) {
const reader = await ServerSentEventGenerator.readSignals(req);
Expand Down
Loading