-
Notifications
You must be signed in to change notification settings - Fork 0
JS Map #47
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
JS Map #47
Conversation
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.
❇️ CodePress Review Summary
👋 Hey team,
Overall the changes look solid, but I spotted 4 must-fix issues and left 0 helpful notes inline.
Here's the quick rundown:
✅ Decision: APPROVE
The changes are coherent, guarded by config/auto-detection, and avoid unsafe DOM mutations. No clear correctness, security, or breaking issues were found; noted risks are non-blocking and testable.
🚧 Needs a bit of love
The required findings focus on unsafe reliance on new Function for metadata injection and generated code, which violates common CSP policies and can fail at function creation time—causing unhandled initialization errors and breaking pages in CSP-restricted environments. The auto-enabled JS metadata map mode exacerbates risk by both depending on eval and skipping DOM-based markers; under CSP this leads to silent, total loss of metadata, and for custom components the early return leaves no reliable DOM anchor carrying codepress-data-fp. Remediation should remove dynamic eval in favor of CSP-safe, AST-emitted assignments and try/catch logic (or at minimum guard the outer invocation), ensure a deterministic DOM element carries codepress-data-fp even in JS map mode, and adjust defaults or add fallbacks so metadata is preserved if JS map population fails.
Add JS metadata map and wrapper-skip modes; Next.js auto-detection
This PR introduces options to avoid React wrapper elements and to store heavy metadata in a JS map instead of DOM attributes, improving compatibility with Next.js and slot/polymorphic component patterns.
Key Changes:
Review Notes: