feat(react): add react-main-thread-function example#2270
feat(react): add react-main-thread-function example#2270Yradex wants to merge 2 commits intolynx-family:mainfrom
react-main-thread-function example#2270Conversation
|
📝 WalkthroughWalkthroughA new React example project named Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 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)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will improve performance by 16.7%
Performance Changes
Comparing Footnotes
|
Web Explorer#7803 Bundle Size — 383.74KiB (0%).2ab5fe4(current) vs 9033e2d main#7787(baseline) Bundle metrics
Bundle size by type
|
| Current #7803 |
Baseline #7787 |
|
|---|---|---|
252.83KiB |
252.83KiB |
|
95.85KiB |
95.85KiB |
|
35.06KiB |
35.06KiB |
Bundle analysis report Branch Yradex:mtf-example Project dashboard
Generated by RelativeCI Documentation Report issue
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
examples/react-main-thread-function/lynx.config.js (1)
5-5: Prefer explicit env parsing for bundle-analysis flag.
!!process.env['RSPEEDY_BUNDLE_ANALYSIS']treats"0"/"false"as enabled. Explicit checks avoid accidental profiling.Proposed fix
-const enableBundleAnalysis = !!process.env['RSPEEDY_BUNDLE_ANALYSIS']; +const enableBundleAnalysis = ['1', 'true'].includes( + String(process.env['RSPEEDY_BUNDLE_ANALYSIS']).toLowerCase(), +);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/react-main-thread-function/lynx.config.js` at line 5, The current enableBundleAnalysis flag uses loose truthiness (const enableBundleAnalysis = !!process.env['RSPEEDY_BUNDLE_ANALYSIS']) which treats "0"/"false" as true; change it to explicit parsing by checking the env string value (for example compare against "1" or lowercased "true") when setting enableBundleAnalysis so only intended values enable the feature; update the const enableBundleAnalysis initialization accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/react-main-thread-function/lynx.config.js`:
- Around line 11-13: The schema(url) helper currently always appends
"?fullscreen=true", which breaks URLs that already contain query parameters;
update the schema(url) function to detect if url includes an existing "?" and
append "&fullscreen=true" in that case (otherwise use "?fullscreen=true"),
ensuring you preserve any existing query string or fragment when returning the
final URL.
In `@examples/react-main-thread-function/src/App.css`:
- Line 57: The CSS defines keyframes named Logo--spin and Logo--shake that are
unused and violate stylelint; either delete both `@keyframes` rules if animations
are handled via the Web Animations API in App.tsx, or rename them to kebab-case
(logo-spin and logo-shake) and update any future references accordingly; ensure
no leftover references to Logo--spin or Logo--shake remain in the codebase after
the change.
In `@examples/react-main-thread-function/src/index.tsx`:
- Line 5: Update the import in index.tsx to reference the actual TypeScript
React file: change the import of App (the statement "import { App } from
'./App.jsx'") to import from './App' (remove the .jsx extension) so it resolves
to App.tsx and fixes type-checking/build resolution issues.
---
Nitpick comments:
In `@examples/react-main-thread-function/lynx.config.js`:
- Line 5: The current enableBundleAnalysis flag uses loose truthiness (const
enableBundleAnalysis = !!process.env['RSPEEDY_BUNDLE_ANALYSIS']) which treats
"0"/"false" as true; change it to explicit parsing by checking the env string
value (for example compare against "1" or lowercased "true") when setting
enableBundleAnalysis so only intended values enable the feature; update the
const enableBundleAnalysis initialization accordingly.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
examples/react-main-thread-function/src/assets/arrow.pngis excluded by!**/*.pngexamples/react-main-thread-function/src/assets/lynx-logo.pngis excluded by!**/*.pngexamples/react-main-thread-function/src/assets/react-logo.pngis excluded by!**/*.pngpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
.github/workflows/relative-ci.yml.github/workflows/workflow-bundle-analysis.ymlexamples/react-main-thread-function/lynx.config.jsexamples/react-main-thread-function/package.jsonexamples/react-main-thread-function/src/App.cssexamples/react-main-thread-function/src/App.tsxexamples/react-main-thread-function/src/index.tsxexamples/react-main-thread-function/src/rspeedy-env.d.tsexamples/react-main-thread-function/tsconfig.json
Summary by CodeRabbit
New Features
Chores
Checklist