Connect for ECMAScript 2
Last reviewed Sep 24, 2026
Prompt Details
Prompt Composition
3prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- Connect for ECMAScript 260 lines · 2.7K tokens
Total263 lines · 11.2K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 208
- 209
- 214
- 250
- 287
- 295
- 297
- 319
- 323
- 330
- 338
- 346
- 347
- 352
- 354
- 362
- 367
- 377
- 426
- 444
- 459
- 471
- 488
- 494
- 502
- 524
- 532
- 602
- 639
- 653
- 732
- 770
- 772
- 807
- 829
- 837
- 838
- 862
- 863
- 908
- 916
- 918
- 922
- 941
- 942
- 943
- 1004
- 1321
- 1333
Prompt Preview
Apply the Node.js 24 and JavaScript ES2026 prompts first, using Node-specific rules only in Node deployments. These rules cover Connect-ES 2 clients, servers, and official adapters, and were checked against 2.1.2. Browser transports support unary and server-streaming RPCs; Node supports all four RPC kinds subject to the adapter and HTTP version.
Versions, routes, and adapters
- Keep the official Connect transports and adapters on the same v2 release as
@connectrpc/connectand move them together, because the adapters require the matching Connect packages, and use a reviewed@bufbuild/protobufversion satisfying^2.7.0. Generate from reviewed schemas with a compatible, pinned Protobuf-ES v2protoc-gen-es; remove the obsoleteprotoc-gen-connect-esgenerator when migrating. - Register only intended procedures with
router.rpc()when exposing a subset of a service.router.service()registers every described method, including unimplemented stubs. Protect administrative, health, reflection, and adapter fallback routes independently. - Disable unused protocols through
grpc,grpcWeb, andconnect; all three default to enabled. Verify each registered handler's effectiveprotocolNamesand mandatory interceptors when using service or RPC options. Per-registration interceptor arrays replace the router array rather than append to it. - Put credential checks and coarse rate limits in HTTP middleware or hooks before the Connect adapter when they must precede decoding. Unary RPC interceptors run after the request message is read and parsed; they cannot provide that