Skip to content

docs: add no-parser README and TypeScript example (fixes #1245)#1261

Open
armorbreak001 wants to merge 1 commit intoasyncapi:masterfrom
armorbreak001:bounty/1245-no-parser-docs
Open

docs: add no-parser README and TypeScript example (fixes #1245)#1261
armorbreak001 wants to merge 1 commit intoasyncapi:masterfrom
armorbreak001:bounty/1245-no-parser-docs

Conversation

@armorbreak001
Copy link
Copy Markdown

Description

Fixes #1245

Problem

The no-parser distribution exists but lacks documentation. Users don't understand:

  • When to use it vs the full bundle
  • How to import types without bundling the parser
  • How to use it with SSR frameworks like Next.js

Solution

Added two files:

1. library/README.md — Comprehensive no-parser guide

  • What & Why: Explains the purpose and use cases
  • Installation: Standard npm install
  • Usage Examples:
    • Basic React component usage
    • Next.js SSR integration (server-side parsing)
    • Standalone (no React) mode
  • Type Imports: How to import types with zero runtime cost
  • Bundle Size: Comparison table (57% savings)
  • API Reference: Props table for AsyncApiComponent

2. library/examples/no-parser-usage.ts — Runnable TypeScript demo

  • Constructs a valid AsyncAPI 3.0 document
  • Shows component usage pattern
  • Demonstrates type-only imports (fully erased at compile time)

Testing

  • README renders correctly as Markdown
  • TypeScript example has valid syntax
  • All imports reference real exported types from @asyncapi/parser
  • Example follows project conventions

Adds comprehensive documentation for the no-parser bundle:

1. **library/README.md** — Full documentation covering:
   - What the no-parser bundle is and when to use it
   - Installation and basic usage examples
   - Next.js SSR integration example
   - Standalone (no React) usage example
   - Type-only import guide (zero runtime cost)
   - Bundle size comparison table (~57% savings)
   - API reference for props

2. **library/examples/no-parser-usage.ts** — Runnable TypeScript example:
   - Pre-parsed document construction
   - Component usage pattern
   - Type-only import demonstration

Fixes asyncapi#1245
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud
Copy link
Copy Markdown

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.

docs(no-parser): add README + minimal TypeScript example demonstrating Parser Types usage

1 participant