Skip to content

modernization#903

Open
afeldman wants to merge 6 commits intorethinkdb:nextfrom
afeldman:next
Open

modernization#903
afeldman wants to merge 6 commits intorethinkdb:nextfrom
afeldman:next

Conversation

@afeldman
Copy link
Copy Markdown

@afeldman afeldman commented Dec 8, 2025

This change is Reviewable

- ESLint 9 with Flat Config (eslint.config.js)
- TypeScript ESLint rules configured
- Examples updated with TypeScript support
- Express server example fully modernized
- Added comprehensive examples documentation
- Linting scripts in all packages
- Express Server: TypeScript, Express 4, health checks, graceful shutdown
- Koa Server: TypeScript, Koa 2, modern middleware, async/await
- Hapi Server: TypeScript, Hapi 21, plugin architecture

- React Chat: React 18, TypeScript, Vite, Hooks, modern components
  * useHorizon custom hook for Horizon integration
  * Real-time messaging with changefeeds
  * DiceBear avatars, responsive design

- Vue Chat: Vue 3, TypeScript, Composition API, Vite
  * useHorizon composable for reusable logic
  * Script setup syntax for cleaner components
  * Real-time updates with watch()

All examples include:
- Full TypeScript support with strict mode
- Modern build tools (Vite for frontend, tsc for backend)
- Comprehensive README with setup, architecture, troubleshooting
- ESLint 9 compatibility
- Updated dependencies to latest versions

Updated examples/README.md with detailed status table and modernization standards
🦕 New Deno Server (deno-server/)
- Native TypeScript with Web Standards (Fetch, WebSockets)
- RethinkDB integration via rethinkdb-ts driver
- Real-time changefeeds and subscriptions
- JWT authentication (anonymous, token, password)
- Connection pooling for performance
- CORS support
- Static file serving
- Full type safety with strict mode

Core Features:
- HTTP/WebSocket server with Deno.serve
- Database wrapper with query() and subscribe()
- AuthManager with JWT token creation/verification
- WebSocket handler for real-time protocol
- HTTP API endpoints (/health, /auth, /query)

�� Deno Examples (deno-examples/)
- Oak Server: Middleware framework integration
- Hono Server: Ultra-fast web framework example
- Both include health checks, API endpoints, RethinkDB queries

Documentation:
- Comprehensive README with API reference
- Migration guide from Node.js Horizon
- WebSocket protocol specification
- HTTP API documentation
- Deployment guides (Deno Deploy, Docker)
- Security best practices

Testing:
- Unit tests for server, database, auth
- Deno.test integration
- Example test patterns

Benefits over Node.js version:
✓ No compilation needed
✓ Secure by default (explicit permissions)
✓ No node_modules
✓ Built-in tooling (fmt, lint, test)
✓ Modern async/await patterns
✓ Compatible with Node.js via npm
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.

1 participant