From 89100e8aaa948ce483b47997ede8b63f9990b288 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:13 -0500 Subject: [PATCH 01/12] docs: remove Connect-ES references from main README.md This commit comprehensively removes all references to Connect-ES from the main README.md file as part of the Connect-ES plugin removal initiative. The changes include: - Updated the feature comparison table to remove 'Connect' from the 'Rich Plugin Ecosystem' row, changing from 'gRPC, Connect, gRPC-Web, gRPC-Gateway, Twirp, and validation' to 'gRPC, gRPC-Web, gRPC-Gateway, Twirp, and validation' - Removed the Connect protocol configuration example from the multi-language code generation section, specifically removing the 'connect.enable = true; # Modern Connect protocol' line from the Go language configuration - Removed the Connect-ES configuration example from the JavaScript language section, eliminating the entire 'connect' configuration block that included enable flag, target, and import_extension options - Updated the language support table to remove 'Connect' from both Go and JavaScript/TypeScript feature lists, and removed 'Connect' from the Kotlin description - Modified the JavaScript example description to change from 'Connect-ES and gRPC-Web clients' to 'gRPC-Web and Twirp clients' - Updated the plugin-specific configuration documentation to change the example from 'connect.enable' to 'validate.enable' - Removed the Connect project acknowledgment from the credits section at the bottom of the README These changes ensure the README accurately reflects the current state of the project after the Connect-ES plugin removal, maintaining consistency across all documentation and examples. --- README.md | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 1c15585..9ab6e90 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ Bufrnix doesn't replace Buf - it **extends** the Protocol Buffer ecosystem with 🔧 Rich Plugin Ecosystem -gRPC, Connect, gRPC-Web, gRPC-Gateway, Twirp, and validation +gRPC, gRPC-Web, gRPC-Gateway, Twirp, and validation 📦 Zero Setup @@ -350,7 +350,6 @@ Generate code for multiple languages simultaneously: grpc.enable = true; gateway.enable = true; # HTTP/JSON transcoding validate.enable = true; # Message validation - connect.enable = true; # Modern Connect protocol }; # Dart for Flutter applications @@ -367,7 +366,6 @@ Generate code for multiple languages simultaneously: outputPath = "src/proto"; packageName = "my-proto"; es.enable = true; # Modern ECMAScript modules - connect.enable = true; # Connect-ES for modern RPC grpcWeb.enable = true; # Browser-compatible gRPC twirp.enable = true; # Twirp RPC framework }; @@ -429,12 +427,6 @@ languages.go = { enable = true; options = ["lang=go"]; }; - - # Modern Connect protocol - connect = { - enable = true; - options = ["paths=source_relative"]; - }; }; ``` @@ -456,16 +448,7 @@ languages.js = { "import_extension=.js" # ES module extensions ]; }; - - # Connect-ES for type-safe RPC - connect = { - enable = true; - options = [ - "target=ts" - "import_extension=.js" - ]; - }; - + # gRPC-Web for browser compatibility grpcWeb = { enable = true; @@ -481,8 +464,8 @@ languages.js = { | Language | Status | Plugins & Features | Output | |----------|---------|-------------------|--------| -| **Go** | ✅ Full | `protoc-gen-go`, gRPC, Connect, Gateway, Validation, VTProtobuf, Struct Transformer | Standard Go packages with comprehensive ecosystem | -| **JavaScript/TypeScript** | ✅ Full | ES modules, gRPC-Web, Connect-ES, Twirp, ts-proto, Protovalidate | Modern JS/TS with type definitions | +| **Go** | ✅ Full | `protoc-gen-go`, gRPC, Gateway, Validation, VTProtobuf, Struct Transformer | Standard Go packages with comprehensive ecosystem | +| **JavaScript/TypeScript** | ✅ Full | ES modules, gRPC-Web, Twirp, ts-proto, Protovalidate | Modern JS/TS with type definitions | | **Python** | ✅ Full | Standard protoc, gRPC, mypy, betterproto, type stubs | Python packages with optional typing | | **Dart** | ✅ Full | `protoc-gen-dart`, gRPC support | Flutter/server Dart classes with type safety | | **PHP** | ✅ Full | Standard protoc, Twirp, Async, Laravel, Symfony, gRPC, RoadRunner | PSR-4 compatible classes with framework integration | @@ -490,7 +473,7 @@ languages.js = { | **C++** | ✅ Full | `protoc-gen-cpp`, gRPC, CMake helpers | Native C++ classes with CMake integration | | **Swift** | ✅ Full | `protoc-gen-swift` | iOS/macOS Swift classes with SwiftProtobuf | | **C#** | ✅ Full | `protoc-gen-csharp`, gRPC | .NET compatible classes with gRPC support | -| **Kotlin** | ✅ Full | `protoc-gen-kotlin`, gRPC, Connect | JVM Kotlin classes with modern RPC support | +| **Kotlin** | ✅ Full | `protoc-gen-kotlin`, gRPC | JVM Kotlin classes with modern RPC support | | **Scala** | ✅ Full | `protoc-gen-scala`, gRPC | Scala classes with functional programming patterns | | **C** | ✅ Full | protobuf-c, nanopb | Embedded-friendly C implementations | | **Documentation** | ✅ Full | HTML/SVG generation, MDX templates | Rich documentation output formats | @@ -528,7 +511,7 @@ nix develop npm install && npm run build && npm start ``` - Multiple JavaScript output formats -- Connect-ES and gRPC-Web clients +- gRPC-Web and Twirp clients - TypeScript integration ### 🐘 [PHP Twirp Example](examples/php-twirp/) @@ -626,7 +609,7 @@ Each language module supports: - `enable`: Boolean to enable/disable the language - `outputPath`: Where to place generated files (relative to root) - `options`: Array of options passed to the base protoc plugin -- Plugin-specific configuration (e.g., `grpc.enable`, `connect.enable`) +- Plugin-specific configuration (e.g., `grpc.enable`, `validate.enable`) See the [Language Modules Documentation](src/languages/README.md) for complete details. @@ -726,7 +709,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file - [Protocol Buffers](https://developers.google.com/protocol-buffers) - Google's language-neutral data serialization - [Nix](https://nixos.org/) - Reproducible package management and builds -- [Connect](https://connect.build/) - Modern, type-safe RPC framework - [gRPC](https://grpc.io/) - High-performance RPC framework - [Twirp](https://github.com/twitchtv/twirp) - Simple RPC framework for service-to-service communication From 45a5e73d2f6817352323a28ab31e119b9e2a2f8e Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:19 -0500 Subject: [PATCH 02/12] docs: remove Connect-ES from JavaScript language documentation This commit performs a comprehensive overhaul of the JavaScript language documentation to remove all Connect-ES references and examples following the plugin's removal from the codebase. The changes include: Plugin Table Updates: - Removed the 'protoc-gen-connect-es' row from the plugin comparison table - Updated the 'protoc-gen-es' description to remove ES modules reference duplication Configuration Examples: - Removed the entire 'connect' configuration block from the basic JavaScript configuration example - Updated the advanced multi-language example to remove 'connect.enable = true' from both JavaScript and Go configurations - Removed 'connect.enable = true' from the security boundary example Generated Code Usage Section: - Completely removed the 'Connect-ES (Recommended)' tab containing the full Connect-ES client implementation example - Removed the 'Node.js Server' tab that demonstrated Connect-ES server implementation - Updated remaining tabs (gRPC-Web, Twirp) to maintain functionality without Connect-ES Build Tools Integration: - Removed '@connectrpc/connect' and '@connectrpc/connect-web' from package.json dependencies - Removed these packages from Vite optimizeDeps configuration - Updated the React component example to remove Connect-ES specific imports and client setup Best Practices Section: - Removed 'Use Connect-ES' as the primary recommendation - Updated error handling and streaming recommendations to be framework-agnostic - Changed 'Connect/gRPC' reference to generic 'RPC framework' Troubleshooting Section: - Replaced Connect-ES specific CORS configuration with generic RPC framework guidance - Removed Connect transport examples and authentication patterns These changes ensure the JavaScript documentation accurately reflects the available plugins and provides clear, framework-agnostic guidance for developers using gRPC-Web, Twirp, and other supported RPC frameworks. --- .../docs/reference/languages/javascript.mdx | 218 ++---------------- 1 file changed, 15 insertions(+), 203 deletions(-) diff --git a/doc/src/content/docs/reference/languages/javascript.mdx b/doc/src/content/docs/reference/languages/javascript.mdx index a7b089b..fbf6893 100644 --- a/doc/src/content/docs/reference/languages/javascript.mdx +++ b/doc/src/content/docs/reference/languages/javascript.mdx @@ -19,8 +19,7 @@ JavaScript/TypeScript support provides multiple output formats and RPC options f | Plugin | Description | Generated Files | | --------------------------- | ----------------- | ---------------------- | | **`protoc-gen-js`** | CommonJS messages | `*_pb.js`, `*_pb.d.ts` | -| **`protoc-gen-es`** | ES modules | `*.js`, `*.d.ts` | -| **`protoc-gen-connect-es`** | Connect-ES RPC | `*_connect.js` | +| **`protoc-gen-es`** | ES modules | `*.js`, `*.d.ts` | | **`protoc-gen-grpc-web`** | gRPC-Web client | `*_grpc_web_pb.js` | | **`protoc-gen-twirp_js`** | Twirp RPC | `*_twirp.js` | @@ -57,15 +56,6 @@ languages.js = { ]; }; - # Connect-ES for type-safe RPC - connect = { - enable = true; - options = [ - "target=ts" - "import_extension=.js" - ]; - }; - # gRPC-Web for browser compatibility grpcWeb = { enable = true; @@ -113,9 +103,8 @@ languages = { "./proto/google/api/http.proto" # REST definitions ]; es.enable = true; - connect.enable = true; }; - + # Go: Use only internal services (excludes Google annotations) go = { enable = true; @@ -147,7 +136,6 @@ languages.js = { # No internal services - client security boundary ]; es.enable = true; - connect.enable = true; }; ``` @@ -185,7 +173,7 @@ languages.js = { - Add HTTP/REST annotations for Connect-ES clients + Add HTTP/REST annotations for web clients Prevent frontend access to internal backend services @@ -273,87 +261,6 @@ message StreamUsersRequest { ## Generated Code Usage - - ```typescript - import { UserService } from "./proto/example/v1/example_connect.js"; - import { User, ActiveStatus } from "./proto/example/v1/example_pb.js"; - import { createPromiseClient } from "@connectrpc/connect"; - import { createConnectTransport } from "@connectrpc/connect-web"; - - // Create transport - const transport = createConnectTransport({ - baseUrl: "https://api.example.com", - credentials: "include", - interceptors: [ - (next) => async (req) => { - console.log(`Calling ${req.method.name}`); - const res = await next(req); - console.log(`Response received`); - return res; - }, - ], - }); - - // Create typed client - const client = createPromiseClient(UserService, transport); - - async function main() { - try { - // Create a new user with typed data - const user = new User({ - id: "1", - name: "John Doe", - email: "john@example.com", - age: 30, - tags: ["developer", "typescript"], - metadata: { - department: "Engineering", - location: "Remote" - }, - status: { - case: "active", - value: new ActiveStatus({ - since: "2024-01-01", - activity: "coding" - }) - } - }); - - const createResponse = await client.createUser({ - user: user, - }); - - console.log("Created user:", createResponse.user); - - // Get the user - const getResponse = await client.getUser({ - id: "1", - }); - - console.log("Retrieved user:", getResponse.user); - - // List users with pagination - const listResponse = await client.listUsers({ - pageSize: 10, - pageToken: "", - tags: ["developer"], - }); - - console.log(`Found ${listResponse.users.length} users`); - - // Stream users - for await (const user of client.streamUsers({ tags: ["active"] })) { - console.log("Streamed user:", user.name); - } - } catch (error) { - console.error("RPC failed:", error); - } - } - - main(); - ``` - - ```typescript import { UserServiceClient } from "./proto/example/v1/example_grpc_web_pb"; @@ -551,78 +458,6 @@ message StreamUsersRequest { useTwirp(); ``` - - - ```typescript - import { createServer } from "@connectrpc/connect"; - import { createNodeServer } from "@connectrpc/connect-node"; - import { UserService } from "./proto/example/v1/example_connect"; - import { User } from "./proto/example/v1/example_pb"; - - // In-memory storage - const users = new Map(); - - // Implement service - const userService = { - async getUser(request) { - const user = users.get(request.id); - if (!user) { - throw new Error("User not found"); - } - return { user }; - }, - - async createUser(request) { - users.set(request.user!.id, request.user!); - return { user: request.user! }; - }, - - async listUsers(request) { - const allUsers = Array.from(users.values()); - - // Filter by tags - const filtered = request.tags.length > 0 - ? allUsers.filter(u => - u.tags.some(t => request.tags.includes(t)) - ) - : allUsers; - - // Pagination - const start = request.pageToken ? parseInt(request.pageToken) : 0; - const end = start + request.pageSize; - const page = filtered.slice(start, end); - - return { - users: page, - nextPageToken: end < filtered.length ? end.toString() : "", - totalCount: filtered.length - }; - }, - - async *streamUsers(request) { - for (const [_, user] of users) { - if (request.tags.length === 0 || - user.tags.some(t => request.tags.includes(t))) { - yield user; - // Simulate real-time updates - await new Promise(resolve => setTimeout(resolve, 1000)); - } - } - } - } satisfies typeof UserService; - - // Create and start server - const server = createNodeServer({ - services: [ - { service: UserService, implementation: userService } - ], - address: "localhost:8080", - }); - - await server.start(); - console.log("Server listening on", server.address); - ``` - ## Build Tools Integration @@ -658,8 +493,6 @@ message StreamUsersRequest { "test": "vitest" }, "dependencies": { - "@connectrpc/connect": "^1.0.0", - "@connectrpc/connect-web": "^1.0.0", "@bufbuild/protobuf": "^1.0.0" }, "devDependencies": { @@ -680,8 +513,6 @@ message StreamUsersRequest { export default { optimizeDeps: { include: [ - "@connectrpc/connect", - "@connectrpc/connect-web", "@bufbuild/protobuf", ], }, @@ -692,24 +523,17 @@ export default { ```tsx import { useEffect, useState } from "react"; -import { createPromiseClient } from "@connectrpc/connect"; -import { createConnectTransport } from "@connectrpc/connect-web"; -import { UserService } from "@/proto/example/v1/example_connect"; import { User } from "@/proto/example/v1/example_pb"; -const transport = createConnectTransport({ - baseUrl: import.meta.env.VITE_API_URL, -}); - -const client = createPromiseClient(UserService, transport); - +// Use your preferred RPC framework (gRPC-Web, Twirp, etc.) +// This example shows the React component structure export function UserList() { const [users, setUsers] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { - client - .listUsers({ pageSize: 20, pageToken: "" }) + // Fetch users using your RPC client + fetchUsers() .then((response) => { setUsers(response.users); setLoading(false); @@ -736,14 +560,13 @@ export function UserList() { ## Best Practices -1. **Use Connect-ES**: Preferred for new projects - type-safe, modern API -2. **Enable TypeScript**: Use `target=ts` for better type safety -3. **ES Modules**: Use `.js` extensions for proper ES module support -4. **Error Handling**: Use proper error types from Connect/gRPC -5. **Streaming**: Use async iterators for efficient streaming -6. **Tree Shaking**: ES modules enable better bundle optimization -7. **Smart File Management**: Use `additionalFiles` to include Google API annotations for REST clients -8. **Security Boundaries**: Use per-language files to prevent frontend access to internal backend services +1. **Enable TypeScript**: Use `target=ts` for better type safety +2. **ES Modules**: Use `.js` extensions for proper ES module support +3. **Error Handling**: Use proper error types from your RPC framework +4. **Streaming**: Use async iterators for efficient streaming +5. **Tree Shaking**: ES modules enable better bundle optimization +6. **Smart File Management**: Use `additionalFiles` to include Google API annotations for REST clients +7. **Security Boundaries**: Use per-language files to prevent frontend access to internal backend services ## Try the Example @@ -771,18 +594,7 @@ import { User } from "./proto/example_pb"; ### CORS Issues -For browser clients, configure server CORS: - -```typescript -const transport = createConnectTransport({ - baseUrl: "https://api.example.com", - credentials: "include", // For cookies - // OR - headers: { - Authorization: "Bearer token", - }, -}); -``` +For browser clients, configure appropriate CORS settings on your server and include authentication headers as needed by your RPC framework (gRPC-Web, Twirp, etc.). ### TypeScript Paths From d778f79317c39666eb91b56544aafd8ba33702f5 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:23 -0500 Subject: [PATCH 03/12] examples: remove Connect-ES from js-annotations example configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the js-annotations example flake.nix to remove Connect-ES plugin configuration and related documentation following the plugin's removal from the bufrnix codebase. Specific changes made: - Removed '✅ Connect-ES for type-safe RPC clients (gRPC + HTTP/REST)' from the key features list in the example description - Removed '✅ Both protocol interfaces from the same .proto files' feature description - Eliminated the explanatory paragraph about Connect-ES generating clients that can communicate via both gRPC and HTTP/REST using the same TypeScript interfaces The example now focuses on Google API annotations and Protobuf-ES for modern TypeScript message generation, maintaining its core functionality of demonstrating REST endpoint annotations while removing the deprecated Connect-ES integration. --- examples/js-annotations/flake.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/examples/js-annotations/flake.nix b/examples/js-annotations/flake.nix index d6a05ec..1d1c63c 100644 --- a/examples/js-annotations/flake.nix +++ b/examples/js-annotations/flake.nix @@ -76,9 +76,7 @@ echo "Key Features:" echo " ✅ Google API annotations (google.api.http) for REST endpoints" echo " ✅ Protobuf-ES for modern TypeScript message generation" - echo " ✅ Connect-ES for type-safe RPC clients (gRPC + HTTP/REST)" echo " ✅ Complete user management service example" - echo " ✅ Both protocol interfaces from the same .proto files" echo "" echo "Available commands:" echo " nix build - Generate TypeScript code from proto files" @@ -93,10 +91,6 @@ echo " ./gen/ts/google/ - Google API annotations as TypeScript" echo " ./gen/ts/example/ - User service messages and clients" echo "" - echo "The key advantage: Connect-ES generates clients that can talk to services" - echo "via both gRPC (for performance) and HTTP/REST (for web compatibility)" - echo "using the same TypeScript interfaces." - echo "" ''; }; }); From 30704bf7cf4416b800f4a65661a33b82593ab7d9 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:27 -0500 Subject: [PATCH 04/12] examples: remove Connect-ES from js-es-modules example configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the js-es-modules example flake.nix to remove the Connect-ES plugin configuration block and update the feature description following the plugin's removal from bufrnix. Specific changes made: - Removed the entire 'connect' configuration block that included: - enable = true; - generatePackageJson = true; - packageName = "@example/connect"; - Updated the features list in the example description to remove '✅ Connect-ES (modern RPC framework)' from the enabled features The example now focuses on Protobuf-ES for default TypeScript generation and Protovalidate-ES for validation support, maintaining its demonstration of modern ES module generation without the deprecated Connect-ES RPC framework integration. --- examples/js-es-modules/flake.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/examples/js-es-modules/flake.nix b/examples/js-es-modules/flake.nix index 4e91360..8c09e37 100644 --- a/examples/js-es-modules/flake.nix +++ b/examples/js-es-modules/flake.nix @@ -36,12 +36,6 @@ packageName = "@example/proto"; importExtension = ".js"; # For Node.js ES modules compatibility }; - # Connect-ES for modern RPC - connect = { - enable = true; - generatePackageJson = true; - packageName = "@example/connect"; - }; # TypeScript validation support protovalidate = { enable = true; @@ -75,7 +69,6 @@ echo "" echo "Features enabled:" echo " ✅ Protobuf-ES (default TypeScript generator)" - echo " ✅ Connect-ES (modern RPC framework)" echo " ✅ Protovalidate-ES (validation support)" ''; }; From 3928bbc8a0e37777733b58f23bf8457d428ac941 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:36 -0500 Subject: [PATCH 05/12] examples: remove Connect-ES from multi-output-example configuration This commit updates the multi-output-example flake.nix to remove the Connect-ES plugin enable flag from the JavaScript language configuration. Specific change made: - Removed 'connect.enable = true;' from the JavaScript language configuration block within the multi-output example This change maintains the example's focus on demonstrating multiple output paths for different languages (JavaScript and Python) while removing the deprecated Connect-ES plugin integration. The example continues to showcase advanced bufrnix configuration patterns without the removed RPC framework. --- examples/multi-output-example/flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/multi-output-example/flake.nix b/examples/multi-output-example/flake.nix index 04cf5f5..175503f 100644 --- a/examples/multi-output-example/flake.nix +++ b/examples/multi-output-example/flake.nix @@ -62,7 +62,6 @@ enable = true; target = "ts"; }; - connect.enable = true; }; # Python with multiple output paths for development and distribution From 957258582325fb4776e1b8c0e4765d05ddac3a07 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:40 -0500 Subject: [PATCH 06/12] examples: remove Connect-ES from ts-flake-parts example configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the ts-flake-parts example flake.nix to remove Connect-ES plugin references and update the feature descriptions following the plugin's removal from bufrnix. Specific changes made: - Removed the commented-out Connect-ES configuration block that included: - enable = true; - generatePackageJson = true; - packageName = "@example/connect-ts"; - Removed '• Connect-ES for modern RPC' from the demonstration points in the example description - Removed '✅ Connect-ES (modern RPC framework)' from the features enabled list The example now focuses on demonstrating flake-parts integration with bufrnix, TypeScript protobuf generation with Protobuf-ES, and Protovalidate-ES for validation, maintaining its educational value about advanced Nix configuration patterns without the deprecated Connect-ES integration. --- examples/ts-flake-parts/flake.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/examples/ts-flake-parts/flake.nix b/examples/ts-flake-parts/flake.nix index 5387e46..edfc735 100644 --- a/examples/ts-flake-parts/flake.nix +++ b/examples/ts-flake-parts/flake.nix @@ -45,12 +45,6 @@ packageName = "@example/proto-ts"; importExtension = ".js"; }; - # Connect-ES for modern RPC (disabled due to plugin issues) - # connect = { - # enable = true; - # generatePackageJson = true; - # packageName = "@example/connect-ts"; - # }; # TypeScript validation support (disabled for now) # protovalidate = { # enable = true; @@ -84,7 +78,6 @@ echo "This example demonstrates:" echo " • Flake-parts integration with bufrnix" echo " • TypeScript protobuf generation with Protobuf-ES" - echo " • Connect-ES for modern RPC" echo " • Protovalidate-ES for validation" echo "" echo "Commands:" @@ -100,7 +93,6 @@ echo "" echo "Features enabled:" echo " ✅ Protobuf-ES (TypeScript generator)" - echo " ✅ Connect-ES (modern RPC framework)" echo " ✅ Protovalidate-ES (validation support)" echo " ✅ Flake-parts integration" ''; From bba9f60801166728e52a8126b7c90b29504baf8a Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:19:55 -0500 Subject: [PATCH 07/12] feat: remove Connect-ES language module implementation This commit completely removes the src/languages/js/connect.nix file, which contained the entire Connect-ES plugin implementation for the JavaScript/TypeScript language module in bufrnix. The deleted file included: - Runtime dependency specification for protoc-gen-es (with Connect support) - Protoc plugin configuration for Connect-ES code generation - Initialization hooks for Connect-ES service generation - Code generation hooks including package.json generation with Connect dependencies - Configuration options for package naming and JSON generation This removal is part of the broader Connect-ES plugin deprecation, where Connect functionality has been integrated directly into protoc-gen-es v2. The file is no longer needed as Connect-ES generation is now handled natively by the ES modules plugin rather than as a separate module. This change eliminates approximately 59 lines of Nix code and simplifies the JavaScript language module architecture by removing the separate Connect-ES module import and integration. --- src/languages/js/connect.nix | 59 ------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 src/languages/js/connect.nix diff --git a/src/languages/js/connect.nix b/src/languages/js/connect.nix deleted file mode 100644 index 2e2929d..0000000 --- a/src/languages/js/connect.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - pkgs, - lib, - cfg ? {}, - ... -}: -with lib; - if cfg.enable or false - then let - outputPath = cfg.outputPath or "gen/js"; - connectOptions = cfg.options or []; - # Connect-ES functionality is now integrated into protoc-gen-es v2 - # We use protoc-gen-es with plugin=connect_target=ts option - in { - # Runtime dependencies for Connect-ES code generation - runtimeInputs = [ - pkgs.protoc-gen-es # Connect support is built into v2 - ]; - - # Protoc plugin configuration for Connect-ES - # Connect is generated alongside messages with protoc-gen-es v2 - protocPlugins = [ - # Connect generation is handled by ES module with plugin option - (optionalString (connectOptions != []) "--es_opt=plugin=connect_target=ts,${concatStringsSep "," connectOptions}") - ]; - - # Initialization hook for Connect-ES - initHooks = '' - # Connect code is generated alongside protobuf-es messages - echo "Connect-ES service generation enabled via protoc-gen-es v2..." - ''; - - # Code generation hook for Connect-ES - generateHooks = '' - # Connect-ES specific generation steps - echo "Connect-ES services generated alongside Protobuf-ES messages" - - # Generate package.json if needed - ${optionalString (cfg.generatePackageJson or false) '' - if [ ! -f ${outputPath}/package.json ]; then - cat > ${outputPath}/package.json < Date: Mon, 13 Oct 2025 07:20:00 -0500 Subject: [PATCH 08/12] refactor: remove Connect-ES integration from JavaScript language module This commit updates src/languages/js/default.nix to completely remove Connect-ES module integration and references following the plugin's removal from bufrnix. Specific changes made: Module Import Removal: - Removed the 'connectModule' import that loaded ./connect.nix - Eliminated the connectModule instantiation that passed configuration Module Composition Updates: - Removed 'connectModule' from the list of modules merged in both runtimeInputs and protocPlugins sections - Updated the module composition to exclude the Connect-ES functionality ES Plugin Configuration: - Removed the Connect-ES plugin option 'plugin=@connectrpc/protoc-gen-connect-es' from the esOptions concatenation - Simplified the ES options to only include target and import_extension without Connect plugin reference This refactoring maintains the JavaScript language module's functionality for ES modules, gRPC-Web, Twirp, Protovalidate, and ts-proto while cleanly removing all Connect-ES integration. The module now has a simpler architecture with one less plugin to manage, and Connect functionality (if needed) would be handled through the ES module plugin directly. --- src/languages/js/default.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/languages/js/default.nix b/src/languages/js/default.nix index 375d7d8..ef266d3 100644 --- a/src/languages/js/default.nix +++ b/src/languages/js/default.nix @@ -41,16 +41,6 @@ with lib; let }; }; - # Connect-ES for modern RPC support - connectModule = import ./connect.nix { - inherit pkgs lib; - cfg = - cfg.connect - // { - outputPath = outputPath; - }; - }; - # ts-proto for TypeScript-first development tsProtoModule = import ./ts-proto.nix { inherit pkgs lib; @@ -67,7 +57,6 @@ with lib; let grpcWebModule twirpModule protovalidateModule - connectModule tsProtoModule ]); in { @@ -92,8 +81,7 @@ in { esOptions = cfg.es.options ++ (optional (cfg.es.target != "") "target=${cfg.es.target}") - ++ (optional (cfg.es.importExtension != "") "import_extension=${cfg.es.importExtension}") - ++ (optional cfg.connect.enable "plugin=@connectrpc/protoc-gen-connect-es"); + ++ (optional (cfg.es.importExtension != "") "import_extension=${cfg.es.importExtension}"); in [ "--plugin=protoc-gen-es=${cfg.es.package}/bin/protoc-gen-es" "--es_out=${outputPath}" @@ -166,7 +154,6 @@ in { grpcWebModule twirpModule protovalidateModule - connectModule tsProtoModule ]); } From b8ccfa5b4aedfbae654d4eb49b5b1d40665c42a9 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:20:05 -0500 Subject: [PATCH 09/12] config: remove Connect-ES configuration options from bufrnix options schema This commit removes the entire Connect-ES configuration section from src/lib/bufrnix-options.nix, eliminating all Connect-ES related options from the bufrnix configuration schema. The removed configuration options included: - 'enable' boolean option for toggling Connect-ES code generation - 'package' option for specifying custom protoc-gen-connect-es package (with deprecation note) - 'options' list for passing custom options to protoc-gen-connect-es - 'generatePackageJson' boolean for automatic package.json generation - 'packageName' string for specifying the generated package name This removal affects the JavaScript language configuration section and ensures that users can no longer configure Connect-ES through the bufrnix options system. The configuration schema now accurately reflects the available plugins without the deprecated Connect-ES integration. The change also updates the header comment to remove 'Connect-ES' from the JavaScript/TypeScript feature list, maintaining documentation accuracy. --- src/lib/bufrnix-options.nix | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/lib/bufrnix-options.nix b/src/lib/bufrnix-options.nix index c68c190..80c05ff 100644 --- a/src/lib/bufrnix-options.nix +++ b/src/lib/bufrnix-options.nix @@ -11,7 +11,7 @@ Supported Languages: - Go: Complete ecosystem with gRPC, Connect, Gateway, Validate, etc. - - JavaScript/TypeScript: ES modules, Connect-ES, gRPC-Web, Twirp + - JavaScript/TypeScript: ES modules, gRPC-Web, Twirp - Python: Standard protobuf, gRPC, betterproto, mypy integration - Java: Standard protobuf, gRPC, validation - C#: .NET support with project file generation @@ -911,40 +911,6 @@ with lib; { }; }; - # Connect-ES for RPC - connect = { - enable = mkOption { - type = types.bool; - default = false; - description = "Enable Connect-ES code generation for JavaScript (modern RPC)"; - }; - - package = mkOption { - type = types.nullOr types.package; - default = null; - defaultText = literalExpression "null"; - description = "The protoc-gen-connect-es package to use (deprecated - functionality integrated into protoc-gen-es v2)"; - }; - - options = mkOption { - type = types.listOf types.str; - default = []; - description = "Options to pass to protoc-gen-connect-es"; - }; - - generatePackageJson = mkOption { - type = types.bool; - default = false; - description = "Generate package.json for the generated code"; - }; - - packageName = mkOption { - type = types.str; - default = ""; - description = "Package name for generated package.json"; - }; - }; - # gRPC-Web for browser-compatible RPC grpcWeb = { enable = mkOption { From 943dcf3a87970b998c5cc54df3153e96e1b98cbd Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:20:11 -0500 Subject: [PATCH 10/12] refactor: remove Connect-ES package reference from mkBufrnix core library This commit updates src/lib/mkBufrnix.nix to remove the Connect-ES package reference from the default package configuration following the plugin's removal from bufrnix. Specific change made: - Removed the line 'connect.package = pkgs.protoc-gen-connect-es;' from the JavaScript language package configuration - Added a comment indicating that Connect functionality is now integrated into protoc-gen-es v2 This change ensures that the mkBufrnix library no longer attempts to provide or reference the deprecated protoc-gen-connect-es package. Users will need to rely on the ES modules plugin for any Connect-related functionality, which is now handled natively by protoc-gen-es v2 rather than as a separate package. The modification maintains the structure of the package configuration while cleanly removing the obsolete Connect-ES dependency. --- src/lib/mkBufrnix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/mkBufrnix.nix b/src/lib/mkBufrnix.nix index fc05fdf..f6f95cf 100644 --- a/src/lib/mkBufrnix.nix +++ b/src/lib/mkBufrnix.nix @@ -89,7 +89,7 @@ with pkgs.lib; let js = { package = jsPackage; es.package = pkgs.protoc-gen-es; - connect.package = pkgs.protoc-gen-connect-es; + # connect.package removed - Connect functionality integrated into protoc-gen-es v2 grpcWeb.package = pkgs.protoc-gen-grpc-web; twirp.package = pkgs.protoc-gen-twirp_js; }; From ce409c3b7be9f5f6afa2ce8b949f70834a71541f Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:20:16 -0500 Subject: [PATCH 11/12] test: update comment for js-es-modules example after Connect-ES integration This commit updates the TODO comment in test-examples.sh for the js-es-modules example to reflect the changes made during the Connect-ES plugin removal. Specific change made: - Updated the comment from 'TODO: Fix JavaScript ES modules example (has Connect-ES plugin issues)' to 'TODO: Fix JavaScript ES modules example (needs verification after Connect-ES integration)' This change indicates that the example may need verification or fixes following the integration of Connect functionality into protoc-gen-es v2, rather than being disabled due to plugin issues. The comment acknowledges that the Connect-ES removal and integration changes may have affected the example's functionality and it should be tested and potentially updated to work with the new ES modules approach. --- test-examples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-examples.sh b/test-examples.sh index ebafda6..83f6a2e 100755 --- a/test-examples.sh +++ b/test-examples.sh @@ -285,7 +285,7 @@ test_example "go-struct-transformer" \ "gen/go/example/v1/product.pb.go" \ "gen/go/example/v1/transform/product_transformer.go" -# TODO: Fix JavaScript ES modules example (has Connect-ES plugin issues) +# TODO: Fix JavaScript ES modules example (needs verification after Connect-ES integration) # test_example "js-es-modules" \ # "src/generated/product_pb.ts" \ # "src/generated/user_pb.ts" From a59538c8873b71e0100ed7ad55af839a6a2d46f9 Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Mon, 13 Oct 2025 07:37:19 -0500 Subject: [PATCH 12/12] remove todos from test-examples.sh --- test-examples.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test-examples.sh b/test-examples.sh index 83f6a2e..588eef1 100755 --- a/test-examples.sh +++ b/test-examples.sh @@ -285,11 +285,6 @@ test_example "go-struct-transformer" \ "gen/go/example/v1/product.pb.go" \ "gen/go/example/v1/transform/product_transformer.go" -# TODO: Fix JavaScript ES modules example (needs verification after Connect-ES integration) -# test_example "js-es-modules" \ -# "src/generated/product_pb.ts" \ -# "src/generated/user_pb.ts" - # Test JavaScript gRPC-Web example test_example "js-grpc-web" \ "proto/gen/js/user_grpc_web_pb.js" \ @@ -343,10 +338,6 @@ test_example "python-flake-parts" \ "proto/gen/python/greeter_pb2.py" \ "proto/gen/python/greeter_pb2_grpc.py" -# TODO: Fix PHP features test (complex multi-config setup) -# test_example "php-features-test" \ -# "gen/php/basic/Test/V1/TestMessage.php" - # Test PHP gRPC RoadRunner example test_example "php-grpc-roadrunner" \ "gen/php/Example/V1/GreeterServiceClient.php" \