feat: include @netlify/vite-plugin for platform emulation in dev#650
feat: include @netlify/vite-plugin for platform emulation in dev#650
@netlify/vite-plugin for platform emulation in dev#650Conversation
✅ Deploy Preview for remix-edge ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for remix-serverless ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis pull request consolidates Netlify Vite plugin management within the vite-plugin-react-router package. The Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/vite-plugin-react-router/src/plugin.ts (1)
327-328: Verify plugin ordering is intentional.The React Router plugin is placed before the Netlify Vite plugin. This ordering means React Router-specific hooks (like
config,resolveId,configResolved, etc.) will run before Netlify's general hooks for the same lifecycle events. Confirm this is the intended behavior for proper interoperability.Consider adding a brief comment explaining the plugin ordering rationale:
📝 Suggested comment
+ // React Router plugin must run first to configure SSR build settings before Netlify's general plugin return [reactRouterPlugin, ...netlifyVitePlugin()]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/vite-plugin-react-router/src/plugin.ts` around lines 327 - 328, The plugin array returns reactRouterPlugin before netlifyVitePlugin which causes React Router hooks (config, resolveId, configResolved, etc.) to run before Netlify's hooks; confirm this ordering is intentional and, if so, add a short comment above the return explaining the rationale (why reactRouterPlugin must run first and any potential implications), or if not intentional swap the order so netlifyVitePlugin runs first; reference the return statement that constructs [reactRouterPlugin, ...netlifyVitePlugin()] and the plugin identifiers reactRouterPlugin and netlifyVitePlugin when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/vite-plugin-react-router/src/plugin.ts`:
- Around line 327-328: The plugin array returns reactRouterPlugin before
netlifyVitePlugin which causes React Router hooks (config, resolveId,
configResolved, etc.) to run before Netlify's hooks; confirm this ordering is
intentional and, if so, add a short comment above the return explaining the
rationale (why reactRouterPlugin must run first and any potential implications),
or if not intentional swap the order so netlifyVitePlugin runs first; reference
the return statement that constructs [reactRouterPlugin, ...netlifyVitePlugin()]
and the plugin identifiers reactRouterPlugin and netlifyVitePlugin when making
the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5fef7ae8-8dac-4c3b-abfb-c45cbae4a1b7
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
packages/vite-plugin-react-router/README.mdpackages/vite-plugin-react-router/package.jsonpackages/vite-plugin-react-router/src/plugin.tstests/e2e/fixtures/hydrogen-react-router-site/package.jsontests/e2e/fixtures/hydrogen-react-router-site/vite.config.ts
💤 Files with no reviewable changes (1)
- tests/e2e/fixtures/hydrogen-react-router-site/package.json
Description
@netlify/vite-plugin-react-routernow loads@netlify/vite-pluginautomatically, providing seamless out-of-the-box local Netlify platform emulation inreact-router dev.(We do this already with
@netlify/vite-plugin-tanstack-startand@astrojs/netlify.)Related Tickets & Documents
N/A
QA Instructions, Screenshots, Recordings
Pull down one of the demos or fixture and try
npm run dev.