fix: deeply find themed variables#535
Conversation
📝 WalkthroughWalkthroughThis PR adds recursive themed-variable dependency detection. A new ChangesTransitive Themed-Variable Dependency Detection
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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/uniwind/tests/native/styles-parsing/meta.test.ts (1)
29-29: 💤 Low valueConsider safer alternatives to
eval()for executing compiled code.While
eval()is acceptable here since the code is internally generated (not user input) and isolated to tests, consider these alternatives for better maintainability:
- Use
new Function()with explicit parameters for slightly better scoping- Use Node's
vmmodule for sandboxed execution- Structure the compiled output as a proper module if the format allows
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/uniwind/tests/native/styles-parsing/meta.test.ts` at line 29, The test currently executes compiled code via eval(`(${virtualCode})`); replace this with a safer executor such as new Function or Node's vm to avoid global scope leakage: for example, create a function using new Function(`return (${virtualCode})`)() to explicitly scope execution, or use vm.Script(virtualCode) and runInNewContext(sandbox) to sandbox globals; update the call site that uses eval(`(${virtualCode})`) in the test to use one of these approaches and ensure any required inputs/exports are passed via explicit parameters or the sandbox object.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/uniwind/tests/native/styles-parsing/meta.test.ts`:
- Line 29: The test currently executes compiled code via
eval(`(${virtualCode})`); replace this with a safer executor such as new
Function or Node's vm to avoid global scope leakage: for example, create a
function using new Function(`return (${virtualCode})`)() to explicitly scope
execution, or use vm.Script(virtualCode) and runInNewContext(sandbox) to sandbox
globals; update the call site that uses eval(`(${virtualCode})`) in the test to
use one of these approaches and ensure any required inputs/exports are passed
via explicit parameters or the sandbox object.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2ea0b470-ed56-4381-b5ff-37583575de4a
📒 Files selected for processing (3)
packages/uniwind/src/metro/addMetaToStylesTemplate.tspackages/uniwind/tests/native/styles-parsing/meta.test.tspackages/uniwind/tests/test.css
|
🚀 This pull request is included in v1.6.5. See Release v1.6.5 for release notes. |
Summary by CodeRabbit
Bug Fixes
Tests