E0: удалить преждевременный browser API - #356
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughУдалён legacy strict floor-clamp из ChangesRuntime API и переходы
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/colors/effective-bg.js (1)
313-323: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueИнвариант «read-only» задокументирован, но не защищён на уровне кода.
parseCssColorCachedвозвращает элемент кэша напрямую; случайная мутация массива вызывающей стороной незаметно испортит запись вparseCacheдля всех последующих обращений с той же строкой. Комментарий фиксирует контракт, но не гарантирует его.🛡️ Возможное усиление инварианта
export function parseCssColorCached(css) { let hit = parseCache.get(css); if (hit === undefined) { hit = parseCssColor(css); + if (hit) Object.freeze(hit); if (parseCache.size >= PARSE_CACHE_CAP) parseCache.clear(); parseCache.set(css, hit); } return hit; }🤖 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/colors/effective-bg.js` around lines 313 - 323, Защитите запись в parseCache от мутаций вызывающей стороны в parseCssColorCached: возвращайте копию закэшированного массива, а не hit напрямую, сохраняя оригинал только внутри кэша. Не изменяйте поведение parseCssColor для некэшированных вызовов и логику заполнения кэша.
🤖 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.
Inline comments:
In `@crates/labcolors-wasm/Cargo.toml`:
- Around line 18-21: Сократите комментарий в Cargo.toml, удалив упоминания
pre-cutover, целевой архитектуры, миграции и отсутствия второго артефакта.
Оставьте только устойчивый инвариант: этот WASM-артефакт владеет
JSON-конфигурацией и legacy resolve/recheck bindings с point evaluators, а также
границы ответственности. Переведите итоговый комментарий на краткий русский
язык.
---
Outside diff comments:
In `@packages/colors/effective-bg.js`:
- Around line 313-323: Защитите запись в parseCache от мутаций вызывающей
стороны в parseCssColorCached: возвращайте копию закэшированного массива, а не
hit напрямую, сохраняя оригинал только внутри кэша. Не изменяйте поведение
parseCssColor для некэшированных вызовов и логику заполнения кэша.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8cd6acb7-ee88-432e-ac89-2c3d94bd3c4d
📒 Files selected for processing (28)
crates/labcolors-core/src/hash.rscrates/labcolors-core/tests/data/fnv1a-vectors.txtcrates/labcolors-core/tests/fnv1a_vectors.rscrates/labcolors-wasm/Cargo.tomlcrates/labcolors-wasm/src/dto.rscrates/labcolors-wasm/src/engine.rscrates/labcolors-wasm/src/lib.rspackages/colors/README.mdpackages/colors/adapt-theme.d.tspackages/colors/adapt-theme.jspackages/colors/bench/hotpath.bench.mjspackages/colors/effective-bg.d.tspackages/colors/effective-bg.jspackages/colors/fnv1a.d.tspackages/colors/fnv1a.jspackages/colors/index.d.tspackages/colors/index.jspackages/colors/package.jsonpackages/colors/smoke.consumer.tspackages/colors/test/adapt-theme-translucent.test.mjspackages/colors/test/adapt-theme.test.mjspackages/colors/test/fnv1a-differential.test.mjspackages/colors/test/hotpath-parity.test.mjspackages/colors/test/public-api-cleanup.test.mjspackages/colors/test/public-claims.test.mjspackages/colors/test/release-contract.test.mjspackages/colors/tsconfig.jsonscripts/verify-package-release.mjs
💤 Files with no reviewable changes (10)
- packages/colors/fnv1a.d.ts
- packages/colors/tsconfig.json
- packages/colors/fnv1a.js
- packages/colors/test/fnv1a-differential.test.mjs
- packages/colors/effective-bg.d.ts
- packages/colors/index.d.ts
- packages/colors/adapt-theme.d.ts
- packages/colors/test/public-claims.test.mjs
- packages/colors/package.json
- packages/colors/test/adapt-theme-translucent.test.mjs
|
Оба замечания исправлены в 3d1f734.
@coderabbitai review |
|
✅ Action performedReview finished.
|
|
Branch synchronised with merged V1a main at 985d140 without history rewrite; PR diff remains E0-only. Final exact head: 81db500. @coderabbitai review |
|
✅ Action performedReview finished.
|
Корневая проблема
Browser-пакет публиковал незавершённые вспомогательные поверхности до того, как у продукта появился единый point-compositor и честная модель неизвестного backdrop. Это создавало второй источник истины и преждевременный API-контракт.
Что изменено
effective-bgи JS-FNV поверхности, их типы, экспорт и самопроверяющий differential-тест;strictиз заявлений Rust/WASM/npm;adaptTheme/watchTheme;Доказательства
cargo fmt --all -- --check: green;310b54201a80e9c9c2212ddfc94c76b7a3cf4a7b8a3dfd003d7a1e38ad39bfae;Это deletion-first срез: 255 добавлений, 748 удалений.
Summary by CodeRabbit
Изменения API
adaptThemeубрана опцияstrict.Изменения поведения
Документация
watchThemeиadaptTheme.Проверки