Skip to content

feature/stream api - #2

Merged
lcweden merged 7 commits into
mainfrom
feature/stream-api
May 18, 2026
Merged

feature/stream api#2
lcweden merged 7 commits into
mainfrom
feature/stream-api

Conversation

@lcweden

@lcweden lcweden commented May 18, 2026

Copy link
Copy Markdown
Owner

This pull request introduces major API improvements and refactoring, focusing on a clearer separation of concerns between core modules and public API, as well as new streaming APIs for JSON token processing. It also includes minor workflow and configuration updates. The most important changes are grouped below.

API Refactoring and Public Surface Expansion:

  • Introduced new API entry points src/api/decoder.ts and src/api/encoder.ts for JSONTextDecoder and JSONTextEncoder, with expanded, well-documented interfaces and additional methods for stateful, incremental processing. The old implementations in src/libs/decoder.ts and src/libs/encoder.ts were removed. [1] [2] [3] [4]
  • Expanded the main src/index.ts export surface to include new types and classes: streaming decoder/encoder/line/selector, Kind, Token, Value, and error types, enabling more granular and flexible usage for library consumers.

Streaming API Additions:

  • Added JSONTextDecoderStream and JSONTextEncoderStream classes in src/libs/stream-decoder.ts and src/libs/stream-encoder.ts, providing TransformStreams for incremental token-based JSON decoding and encoding, with options for custom queuing strategies. [1] [2]

Core Constants and Error Handling Improvements:

  • Extended the ASCII constants and introduced SELECTOR and SEGMENT enums in src/common/constants.ts for future extensibility and selector/segment support. [1] [2] [3] [4]
  • Improved the SyntacticError class in src/common/errors.ts to use a plain string pointer and clarified error message formatting/documentation.

Project Configuration and Workflow Updates:

  • Updated GitHub Actions workflow to use actions/checkout@v6 and set GITHUB_TOKEN in the test environment. [1] [2]
  • Reorganized and prettified deno.json and package.json scripts, including new tasks for benchmarking and improved formatting for linting and exclusion rules. [1] [2] [3]

@lcweden lcweden self-assigned this May 18, 2026
@lcweden lcweden added documentation Improvements or additions to documentation enhancement New feature or request labels May 18, 2026
@lcweden lcweden changed the title Feature/stream api feature/stream api May 18, 2026
@lcweden
lcweden merged commit c802689 into main May 18, 2026
1 check passed
@lcweden
lcweden deleted the feature/stream-api branch May 18, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant