Skip to content

Add Namespace and update deno serve#13

Open
nickchomey wants to merge 3 commits intostarfederation:mainfrom
nickchomey:namespace-deno-serve
Open

Add Namespace and update deno serve#13
nickchomey wants to merge 3 commits intostarfederation:mainfrom
nickchomey:namespace-deno-serve

Conversation

@nickchomey
Copy link

@nickchomey nickchomey commented Feb 21, 2026

Fixes #12

Adds a namespace type. Its entirely possible this is not done correctly - i dont quite understand how it all works. It is a good start though.

Also updates the archaic version of deno serve with the latest api.

I did run

deno run -A build.ts 
./test/run-all.sh

and it all passed.

But, as was noted in #12, there's no tests for namespace...

Copilot AI review requested due to automatic review settings February 21, 2026 00:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds RC7 namespace support to patchElements in the TypeScript SDK and updates Deno examples/tests to use the modern Deno.serve API.

Changes:

  • Introduces DatastarDatalineNamespace, NamespaceTypes, and NamespaceType, and wires namespace into PatchElementsOptions.
  • Adds runtime validation for the namespace option in ServerSentEventGenerator.patchElements.
  • Updates Deno test/example servers to use Deno.serve and forwards namespace through the test event harnesses.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/node.ts Forwards namespace from test event payloads into patchElements options.
test/deno.ts Migrates to Deno.serve and forwards namespace into patchElements options.
test/bun.ts Forwards namespace from test event payloads into patchElements options.
src/types.ts Adds NamespaceType and types PatchElementsOptions.namespace.
src/consts.ts Adds DatastarDatalineNamespace and NamespaceTypes.
src/abstractServerSentEventGenerator.ts Validates namespace and documents it in patchElements options.
examples/deno/deno.ts Migrates example server to Deno.serve.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@nickchomey nickchomey changed the title Namespace deno serve Add Namespace and update deno serve Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing namespace and Dts/Consts updates for RC7 compatibility?

2 participants