Skip to content

Comments

Add QUIC Transport Adapter Support (Issue #32)#35

Merged
umwelt merged 1 commit intodevelopmentfrom
32-implement-quic-transport-and-protocol-discovery-for-api-clients
Dec 5, 2025
Merged

Add QUIC Transport Adapter Support (Issue #32)#35
umwelt merged 1 commit intodevelopmentfrom
32-implement-quic-transport-and-protocol-discovery-for-api-clients

Conversation

@umwelt
Copy link
Collaborator

@umwelt umwelt commented Dec 5, 2025

Added FetchAdapter interface to enable custom QUIC transport for React Native apps.

Changes:

  • Added FetchAdapter type for custom network transport implementations
  • Modified ZhtpApiCore constructor to accept optional FetchAdapter
  • Updated ZhtpApi to pass fetchAdapter to parent class
  • Exported FetchAdapter from all entry points (vanilla-js, react-native, electron)
  • Library defaults to standard fetch() for backward compatibility

Documentation:
Created comprehensive QUIC-TRANSPORT.md with:

  • Usage examples for HTTP and QUIC transports
  • Native QUIC implementation guides (Swift for iOS, Kotlin for Android)
  • QUIC connection settings and protocol discovery
  • Testing and benchmarking examples
  • Migration guide from HTTP to QUIC
  • Troubleshooting and security notes

Architecture:
React Native apps can now:

  1. Implement native QUIC client in Swift/Kotlin
  2. Bridge to JavaScript as fetch-like API
  3. Inject custom adapter into this library
  4. Use all API methods over QUIC transparently

This keeps the TypeScript library transport-agnostic while enabling QUIC support through native implementations.

Closes #32

Added FetchAdapter interface to support custom network transports:
- ZhtpApiCore accepts optional FetchAdapter in constructor
- React Native apps can inject native QUIC fetch implementation
- Defaults to standard fetch() for backward compatibility
- Exported FetchAdapter type from all entry points

This allows React Native/Electron apps to use native QUIC libraries while
keeping this TypeScript library transport-agnostic.

Added QUIC-TRANSPORT.md with:
- Usage examples for HTTP and QUIC transports
- Native QUIC implementation guides (Swift/Kotlin)
- QUIC connection settings and discovery
- Testing and benchmarking examples
- Migration guide from HTTP to QUIC

Note: JavaScript lacks mature cross-platform QUIC libraries. Mobile apps
must implement QUIC in native code (iOS/Android) and bridge to JavaScript.

Closes #32
@umwelt umwelt linked an issue Dec 5, 2025 that may be closed by this pull request
7 tasks
@umwelt umwelt merged commit c34ef38 into development Dec 5, 2025
@umwelt umwelt deleted the 32-implement-quic-transport-and-protocol-discovery-for-api-clients branch December 5, 2025 17:03
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.

Implement QUIC Transport and Protocol Discovery for API Clients

1 participant