-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: generic env handling #5811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRefactored the Vite plugin pipeline to support per-environment server function handling. The directive configuration is now dynamic via options. Plugins are generated per-environment rather than using a single multipurpose instance. A new Changes
Sequence Diagram(s)sequenceDiagram
participant Vite as Vite
participant Core as Main Plugin<br/>(plugin.ts)
participant SC as StartCompiler<br/>Plugin
participant SF as ServerFn<br/>Plugin
participant Handler as handleCreateServerFn
Vite->>Core: Init with options
Note over Core: Build environments array<br/>(client, server, +custom if providerEnv)
Core->>SC: startCompilerPlugin({framework, environments})
Note over SC: Create per-env plugins
SC->>SC: perEnvCompilerPlugin(client)
SC->>SC: perEnvCompilerPlugin(server)
Core->>SF: createServerFnPlugin({framework, directive, environments})
Note over SF: Create per-env plugins
SF->>SF: perEnvCompilerPlugin(client)
SF->>SF: perEnvCompilerPlugin(server)
Vite->>SC: Transform in client env
Note over SC: Apply client-specific filters<br/>Environment type: 'client'
Vite->>SC: Transform in server env
Note over SC: Apply server-specific filters<br/>Environment type: 'server'
Vite->>SF: Transform server function
SF->>Handler: handleCreateServerFn
Note over Handler: Generate wrapper with<br/>opts.directive (dynamic)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/{*-start,start-*}/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (3)packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts (2)
packages/start-plugin-core/src/start-compiler-plugin/plugin.ts (3)
packages/start-plugin-core/src/plugin.ts (3)
🪛 ast-grep (0.39.9)packages/start-plugin-core/src/create-server-fn-plugin/plugin.ts[warning] 158-158: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns. (regexp-from-variable) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (4)
Comment |
|
View your CI Pipeline Execution ↗ for commit 1fcdd98
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/nitro-v2-vite-plugin
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-router-ssr-query
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
Summary by CodeRabbit
New Features
providerEnvoption to configure a custom server environment for server functionsRefactor