fix: apply configureVite hook in dev mode#14
Merged
Conversation
✅ Deploy Preview for paretojs canceled.
|
SSR Framework Benchmark Results
Requests/sec (median, higher is better)
Latency p50 / p99 (median, lower is better)
Solo TTFB (1 connection, median, lower is better)
Avg Response Size (lower is better)
Max Sustainable QPS (Ramp-up Load Test)
Summary
Static SSR — Detail
Data Loading — Detail
Streaming SSR — Detail
API / JSON — Detail
Build SizeCommit: 79038e3 | Workflow run |
Replace the framework-specific configureVite hook with standard Vite config. Users now customize Vite via vite.config.ts in their project root, which Vite natively loads and merges in both dev and build modes. This aligns with the Vite ecosystem convention (TanStack Start, Vike, etc.) where frameworks do not expose custom config hooks — users write standard vite.config.ts and the framework is either a Vite plugin or passes its internal config as inline config to createServer/build. Changes: - Remove configureVite from ParetoConfig type and defaults - Remove configureVite calls from createClientConfig/createServerConfig - Add ssr.noExternal to dev server config (was missing, only in build) - Add vite to peerDependencies so users can write vite.config.ts - Add vite.config.ts e2e tests in both examples - Convert examples to ESM (type: module, export default) - Fix flaky stream e2e test (use waitUntil: commit for streaming pages) Closes #13 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8fec5ae to
c5471d1
Compare
- Bump @paretojs/core and create-pareto to 5.0.0 - Add CHANGELOG entry documenting the configureVite removal and migration to standard vite.config.ts - Update config docs (en + zh, website + core) to replace the configureVite section with a vite.config.ts guide - Update resource-routes doc cross-references Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set envPrefix: 'PARETO_' on the dev Vite instance (was previously only on the build config). This ensures dev and build behave identically: only PARETO_-prefixed env vars are inlined into client code via import.meta.env, while unprefixed vars stay server-only via process.env. Add e2e tests that verify the isolation end-to-end: - Server loader can read both prefixed and unprefixed vars via process.env - Client reads PARETO_ vars via import.meta.env - Client cannot access unprefixed server-only vars like API_SECRET Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
configureVitewas only applied duringpareto build(viacreateClientConfig/createServerConfig) but completely skipped inpareto dev, wherecreateViteServerreceived a hardcoded configconfig.configureVite(baseConfig, { isServer: false })before passing tocreateViteServerCloses #13
Test plan
dev-configure-vite.test.ts): mocks all deps, verifiesconfigureViteis called with{ isServer: false }and that the transformed config reachescreateViteServerconfigure-vite.spec.ts): adds apareto.config.jsthat injects adefineglobal viaconfigureVite, then a test page renders that value — confirms the hook is applied end-to-end in dev mode🤖 Generated with Claude Code