-
Notifications
You must be signed in to change notification settings - Fork 625
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
Add react-scan #10710
Add react-scan #10710
Conversation
WalkthroughThe changes add a new script command and a development dependency to the project. The Changes
Sequence Diagram(s)sequenceDiagram
participant Env as Environment Variable
participant Vite as Vite Config
participant Plugin as reactScan Plugin
Env->>Vite: Check ENABLE_REACT_SCAN
Vite-->>Plugin: Initialize plugin (enable if "true")
Plugin->>Vite: Report active status
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (9)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying care-fe with
|
Latest commit: |
b05e1f1
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f662644b.care-fe.pages.dev |
Branch Preview URL: | https://sainak-feat-react-scan.care-fe.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
vite.config.mts (1)
187-202
: Add validation for ENABLE_REACT_SCAN environment variable.Consider adding validation for the ENABLE_REACT_SCAN environment variable in the ValidateEnv schema to ensure it's properly typed and documented.
validator: "zod", schema: { REACT_CARE_API_URL: z.string().url(), REACT_SENTRY_DSN: z.string().url().optional(), REACT_SENTRY_ENVIRONMENT: z.string().optional(), + REACT_ENABLE_REACT_SCAN: z.enum(["true", "false"]).optional() + .describe("Optional: Enable react-scan feature"), REACT_CDN_URLS: z .string() .optional()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.json
(1 hunks)vite.config.mts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Redirect rules - care-ohc
- GitHub Check: Header rules - care-ohc
- GitHub Check: Pages changed - care-ohc
- GitHub Check: Test
- GitHub Check: cypress-run (1)
- GitHub Check: OSSAR-Scan
- GitHub Check: CodeQL-Build
- GitHub Check: OSSAR-Scan
🔇 Additional comments (2)
package.json (1)
127-127
:❓ Verification inconclusive
Verify the package version and stability.
The package version 0.1.3 seems to be an early release. Let's verify if this is the latest stable version.
🌐 Web query:
What is the latest version of @react-scan/vite-plugin-react-scan? Are there any known issues or stability concerns?
💡 Result:
The latest version of
@react-scan/vite-plugin-react-scan
mentioned in recent GitHub discussions is v0.0.54, which resolved a critical production build error where"scan"
was not exported properly from the module[6]. This issue occurred in basic Vite SPA setups and was traced to incorrect module exports in earlier versions (≤v0.0.52)[6][7].Known Issues & Stability
Build Export Errors
Earlier versions (≤v0.0.52) caused production build failures due to missing exports ("scan" is not exported
)[6]. This was fixed in v0.0.53/54.Development vs Production Use
While some users questioned whetherreact-scan
should be limited to development environments, maintainers clarified it’s intended for both development and production diagnostics[7]. No additional stability concerns are explicitly documented beyond the resolved export issue.For production use, ensure you’re on v0.0.54+ and verify compatibility with your Vite/React configuration[6][7].
Citations:
- 1: https://www.npmjs.com/package/@vitejs/plugin-react
- 2: https://vite.dev/guide/troubleshooting
- 3: https://react.dev/learn/react-compiler
- 4: https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md
- 5: https://www.restack.io/p/vite-react-bundle-analyzer-answer
- 6: "scan" is not exported by "node_modules/react-scan/dist/rsc-shim.mjs" aidenybai/react-scan#125
- 7: I believe the react-scan should not be visible on production...only works on developement aidenybai/react-scan#83
- 8: https://security.snyk.io/package/npm/@alloc%2Fvite-plugin-react
- 9: https://v2.vitejs.dev/config/
- 10: https://www.npmjs.com/package/@sentry/vite-plugin
Action Required: Verify Stability of @react-scan/vite-plugin-react-scan Version
The dependency is currently set to use version "^0.1.3". However, recent GitHub discussions indicate that the stable version—which fixed critical export issues—is v0.0.54 (and by extension, any release on or shortly after v0.0.54 should be used for production). Since version numbers below 1.0.0 can be unstable and may not follow strict semver expectations, please:
- Confirm whether v0.1.3 includes additional fixes or changes beyond those in v0.0.54.
- Perform targeted testing in your Vite/React environment to ensure that v0.1.3 is stable for production use.
- If any issues are observed, consider reverting to or pinning the dependency to a known stable version (v0.0.54 or later verified release).
vite.config.mts (1)
3-3
: LGTM! Plugin configuration looks good.The reactScan plugin is correctly imported and configured with the enable flag tied to the ENABLE_REACT_SCAN environment variable.
Also applies to: 212-214
CARE
|
Project |
CARE
|
Branch Review |
sainak/feat/react-scan
|
Run status |
|
Run duration | 06m 51s |
Commit |
|
Committer | Aakash Singh |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
11
|
View all changes introduced in this branch ↗︎ |
@sainak Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Proposed Changes
ENABLE_REACT_SCAN
totrue
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit