Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis pull request replaces the single 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/pages/blog/first-cdn.mdx (1)
218-232:⚠️ Potential issue | 🔴 Critical
Watch.Publishcode example is missing its import and references the wrong namespace.This standalone code block uses
new Watch.Publish({...})but should import from and use the@moq/publishpackage instead. The correct API isBroadcastfrom@moq/publish. At minimum, readers copying this snippet will get aReferenceError.📝 Suggested fix
-import { Watch } from "@moq/watch" +import * as Publish from "@moq/publish" // Publish a broadcast. -const publish = new Watch.Publish({ +const publish = new Publish.Broadcast({🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/blog/first-cdn.mdx` around lines 218 - 232, The example incorrectly uses Watch.Publish and lacks an import; update the snippet to import and instantiate the correct API from the `@moq/publish` package by replacing the Watch.Publish usage with the Broadcast class and adding an import for Broadcast from '@moq/publish' so the example becomes new Broadcast({...}) with the same config (e.g., device, url, path, video/detection).
🧹 Nitpick comments (2)
justfile (1)
53-54:prodin justfile andpackage.jsonuse different serving toolsThe justfile's
prodrunsbun astro preview --open(Astro's built-in Node.js static server), whilepackage.json'sprodscript runswrangler pages dev ./dist --open(Cloudflare Pages simulation). For a static site deployed to Cloudflare Pages,wrangler pages devmore accurately emulates CF Pages behaviours like custom_headers/_redirectsrules. Consider aligning the justfile with the npm script:♻️ Proposed alignment
-prod: build - bun astro preview --open +prod: build + bun wrangler pages dev ./dist --open🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@justfile` around lines 53 - 54, The justfile target named prod currently runs "bun astro preview --open" which diverges from package.json's prod script using "wrangler pages dev ./dist --open"; update the justfile prod target to run the same wrangler command so local serving matches Cloudflare Pages emulation (use "wrangler pages dev ./dist --open" as the command for prod), and optionally ensure documentation or a comment notes wrangler is required locally.src/elements.d.ts (1)
17-21: Consider includingAttrsin the explicitmoq-publish-ui/moq-watch-uideclarations for consistencyThe
@moq/publishand@moq/watchpackages are installed and their UI wrapper elements are used in the codebase. Althoughattr:*is currently used only on<moq-publish>and<moq-watch>(not the-uiwrappers), the explicit declarations inIntrinsicElementsoverride the inherited types fromElementProps<HTMLElementTagNameMap>, which means they lack theAttrsintersection. This would cause TypeScript errors ifattr:*is used on these wrapper elements in the future.♻️ Defensive fix
-"moq-publish-ui": HTMLAttributes<HTMLElement>; -"moq-watch-ui": HTMLAttributes<HTMLElement>; +"moq-publish-ui": HTMLAttributes<HTMLElement> & Attrs; +"moq-watch-ui": HTMLAttributes<HTMLElement> & Attrs;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/elements.d.ts` around lines 17 - 21, The explicit IntrinsicElements entries for "moq-publish-ui" and "moq-watch-ui" currently override the inherited ElementProps<HTMLElementTagNameMap> and therefore omit the Attrs intersection; update those declarations so their types include the Attrs intersection (i.e., make "moq-publish-ui" and "moq-watch-ui" use HTMLAttributes<HTMLElement> & Attrs or otherwise merge with Attrs) to preserve support for attr:* on these wrapper elements while keeping the existing ElementProps-based typing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/publish.tsx`:
- Around line 56-64: The video element inside the moq-publish-ui/moq-publish
block can collapse because it uses height: "100%"; update the video styling in
publish.tsx (the <video> inside moq-publish) to use height: "auto" (matching
watch.tsx's canvas) so the preview preserves aspect ratio when the wrapper has
no explicit height, or alternatively ensure moq-publish-ui sets an explicit
height prior to keeping "100%"; change the style on that <video> element
accordingly.
In `@src/components/watch.tsx`:
- Around line 1-4: Add the missing custom element JSX declarations to the
IntrinsicElements interface so TypeScript accepts the JSX tags used in watch.tsx
and publish.tsx: add "moq-watch-support": HTMLAttributes<HTMLElement>,
"moq-watch": HTMLAttributes<HTMLElement>, "moq-publish-support":
HTMLAttributes<HTMLElement>, and "moq-publish": HTMLAttributes<HTMLElement> to
the existing IntrinsicElements declaration (where "moq-publish-ui" and
"moq-watch-ui" are already declared).
---
Outside diff comments:
In `@src/pages/blog/first-cdn.mdx`:
- Around line 218-232: The example incorrectly uses Watch.Publish and lacks an
import; update the snippet to import and instantiate the correct API from the
`@moq/publish` package by replacing the Watch.Publish usage with the Broadcast
class and adding an import for Broadcast from '@moq/publish' so the example
becomes new Broadcast({...}) with the same config (e.g., device, url, path,
video/detection).
---
Nitpick comments:
In `@justfile`:
- Around line 53-54: The justfile target named prod currently runs "bun astro
preview --open" which diverges from package.json's prod script using "wrangler
pages dev ./dist --open"; update the justfile prod target to run the same
wrangler command so local serving matches Cloudflare Pages emulation (use
"wrangler pages dev ./dist --open" as the command for prod), and optionally
ensure documentation or a comment notes wrangler is required locally.
In `@src/elements.d.ts`:
- Around line 17-21: The explicit IntrinsicElements entries for "moq-publish-ui"
and "moq-watch-ui" currently override the inherited
ElementProps<HTMLElementTagNameMap> and therefore omit the Attrs intersection;
update those declarations so their types include the Attrs intersection (i.e.,
make "moq-publish-ui" and "moq-watch-ui" use HTMLAttributes<HTMLElement> & Attrs
or otherwise merge with Attrs) to preserve support for attr:* on these wrapper
elements while keeping the existing ElementProps-based typing.
| <moq-publish-ui> | ||
| <moq-publish attr:url={url.toString()} attr:path={name} attr:source="camera"> | ||
| <video | ||
| style={{ "max-width": "100%", height: "100%", margin: "0 auto", "border-radius": "1rem" }} | ||
| autoplay | ||
| muted | ||
| /> | ||
| </moq-publish> | ||
| </moq-publish-ui> |
There was a problem hiding this comment.
height: "100%" on the video may collapse if moq-publish-ui has no explicit height.
watch.tsx uses height: "auto" for its <canvas>, which preserves aspect ratio without a parent height constraint. Using height: "100%" here could cause the preview video to render at zero height if moq-publish-ui doesn't establish a height. Consider aligning with height: "auto" unless the new UI wrapper guarantees a height.
🔧 Suggested fix
- style={{ "max-width": "100%", height: "100%", margin: "0 auto", "border-radius": "1rem" }}
+ style={{ "max-width": "100%", height: "auto", margin: "0 auto", "border-radius": "1rem" }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/publish.tsx` around lines 56 - 64, The video element inside
the moq-publish-ui/moq-publish block can collapse because it uses height:
"100%"; update the video styling in publish.tsx (the <video> inside moq-publish)
to use height: "auto" (matching watch.tsx's canvas) so the preview preserves
aspect ratio when the wrapper has no explicit height, or alternatively ensure
moq-publish-ui sets an explicit height prior to keeping "100%"; change the style
on that <video> element accordingly.
| // Use the moq web components. | ||
| import "@moq/watch/support/element"; | ||
| import "@moq/watch/element"; | ||
| import "@moq/watch/ui"; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for elements.d.ts file
fd -name "elements.d.ts" src/
# Also check if there's any TypeScript declarations file for web components
fd -name "*.d.ts" src/ | head -20Repository: moq-dev/moq.dev
Length of output: 520
🏁 Script executed:
#!/bin/bash
# Read watch.tsx to see what custom elements are actually used
cat -n src/components/watch.tsx | head -50Repository: moq-dev/moq.dev
Length of output: 2149
🏁 Script executed:
#!/bin/bash
# Read publish.tsx to compare the pattern mentioned in the review
cat -n src/components/publish.tsx | head -50Repository: moq-dev/moq.dev
Length of output: 1808
🏁 Script executed:
#!/bin/bash
# Find elements.d.ts file in src/
find src/ -name "elements.d.ts" -o -name "*.d.ts" | grep -E "(elements|components)" | head -20Repository: moq-dev/moq.dev
Length of output: 76
🏁 Script executed:
#!/bin/bash
# Check if there are any .d.ts files in the entire src/ directory
find src/ -type f -name "*.d.ts"Repository: moq-dev/moq.dev
Length of output: 89
🏁 Script executed:
#!/bin/bash
# Search for moq-watch and moq-publish element declarations in TypeScript files
rg "moq-watch|moq-publish" src/ --type ts --type tsx -A 2Repository: moq-dev/moq.dev
Length of output: 86
🏁 Script executed:
#!/bin/bash
# Read the elements.d.ts file
cat src/elements.d.tsRepository: moq-dev/moq.dev
Length of output: 988
🏁 Script executed:
#!/bin/bash
# Also search for moq-watch and moq-publish in TypeScript files
rg "moq-watch|moq-publish" src/ -t ts -A 2Repository: moq-dev/moq.dev
Length of output: 1546
Add missing custom element declarations to src/elements.d.ts.
The file declares only moq-publish-ui and moq-watch-ui, but watch.tsx uses moq-watch-support and moq-watch, and publish.tsx uses moq-publish-support and moq-publish. Add these missing elements to the IntrinsicElements interface:
"moq-watch-support": HTMLAttributes<HTMLElement>;
"moq-watch": HTMLAttributes<HTMLElement>;
"moq-publish-support": HTMLAttributes<HTMLElement>;
"moq-publish": HTMLAttributes<HTMLElement>;Without these declarations, TypeScript will reject the JSX tags in both components.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/watch.tsx` around lines 1 - 4, Add the missing custom element
JSX declarations to the IntrinsicElements interface so TypeScript accepts the
JSX tags used in watch.tsx and publish.tsx: add "moq-watch-support":
HTMLAttributes<HTMLElement>, "moq-watch": HTMLAttributes<HTMLElement>,
"moq-publish-support": HTMLAttributes<HTMLElement>, and "moq-publish":
HTMLAttributes<HTMLElement> to the existing IntrinsicElements declaration (where
"moq-publish-ui" and "moq-watch-ui" are already declared).
There was a problem hiding this comment.
🧹 Nitpick comments (3)
biome.json (2)
21-47:noUnknownAtRules.options.ignore: ["tailwind"]is redundant once thecss.parser.tailwindDirectivesbug is fixed.
css.parser.tailwindDirectivesis an opt-in CSS parser feature in Biome 2.3.0+ that enables native Tailwind syntax support. With it enabled, Biome should natively recognize@tailwindand not flag it as an unknown at-rule. However, there is a confirmed bug in Biome 2.3.x where@tailwinddirectives are still flagged as warnings even whencss.parser.tailwindDirectivesis enabled.The
ignore: ["tailwind"]entry is a valid workaround for this active bug — theignoreoption onnoUnknownAtRulessuppresses diagnostics for any unknown at-rule that matches the list. Once the upstream bug is resolved, theignorelist can be cleaned up.No action required now, but worth revisiting when upgrading Biome.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@biome.json` around lines 21 - 47, The config currently adds noUnknownAtRules.options.ignore: ["tailwind"] as a workaround for a known Biome 2.3.x bug; leave this in place for now but add a TODO to remove the ignore entry once the upstream bug is fixed and css.parser.tailwindDirectives (in the "css.parser.tailwindDirectives" setting) properly recognizes `@tailwind`; locate the noUnknownAtRules block (noUnknownAtRules -> options -> ignore) and add a short comment/TODO referencing the Biome bug/upgrade so future maintainers remove the ignore when upgrading Biome.
70-72:html.experimentalFullSupportEnabledis explicitly experimental — expect potential false-positives.This flag enables Biome's experimental full-support HTML parser for
.vue,.svelte, and.astrofiles — linting and formatting the JavaScript, HTML, and CSS within them — but the support is considered experimental because there may be cases that aren't fine-parsed yet, causing possible inaccuracies in formatting and linting.The
overridesblock (lines 53–69) that suppressesnoUnusedVariables,noUnusedImports,useConst, anduseImportTypefor**/*.astrois appropriate compensation. The Biome changelog notes that those rules are now more stable and some overrides may no longer be needed when usingexperimentalFullSupportEnabled, though a few false positives from parser issues may remain.Consider validating the full
npm run checkpass on.astrofiles after merging to confirm the override set is still needed and no new false-positives surface.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@biome.json` around lines 70 - 72, The config enables the experimental HTML parser via html.experimentalFullSupportEnabled which can cause false-positives; run a full validation (npm run check) against .astro files and, if no new false-positives appear, remove or narrow the overrides that suppress rules (the overrides block for glob "**/*.astro" that disables noUnusedVariables, noUnusedImports, useConst, and useImportType); if false-positives remain, keep those overrides but annotate the reason in a comment and consider filing a Biome issue with reproducer details for html.experimentalFullSupportEnabled.package.json (1)
27-27: Confirmbiome.jsonwas migrated for the Biome v1 → v2 major upgrade.Before v2, Biome lint rules could only operate on one file at a time; v2 added cross-file analysis and type inference. This is a breaking major-version bump. The official migration path is
biome migrate --write, which updates the config format. The AI summary notesbiome.jsonwas updated in this PR — if that update was manual rather than viabiome migrate, some keys may be silently ignored or cause errors.💡 Suggested verification
Run
bunx biome migrate --writeif not already done, thenbunx biome checkto surface any newly-promoted rules now flagging existing code.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 27, The PR upgraded `@biomejs/biome` to v2 but may not have run the official migration; run the official migration command (biome migrate --write) to convert biome.json to the v2 format, then run biome check to surface any new cross-file rules; if biome.json was edited manually, replace it with the output from biome migrate --write, resolve any newly-promoted rules or config errors reported by biome check, and commit the migrated biome.json so the project uses the supported v2 config format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@biome.json`:
- Around line 21-47: The config currently adds noUnknownAtRules.options.ignore:
["tailwind"] as a workaround for a known Biome 2.3.x bug; leave this in place
for now but add a TODO to remove the ignore entry once the upstream bug is fixed
and css.parser.tailwindDirectives (in the "css.parser.tailwindDirectives"
setting) properly recognizes `@tailwind`; locate the noUnknownAtRules block
(noUnknownAtRules -> options -> ignore) and add a short comment/TODO referencing
the Biome bug/upgrade so future maintainers remove the ignore when upgrading
Biome.
- Around line 70-72: The config enables the experimental HTML parser via
html.experimentalFullSupportEnabled which can cause false-positives; run a full
validation (npm run check) against .astro files and, if no new false-positives
appear, remove or narrow the overrides that suppress rules (the overrides block
for glob "**/*.astro" that disables noUnusedVariables, noUnusedImports,
useConst, and useImportType); if false-positives remain, keep those overrides
but annotate the reason in a comment and consider filing a Biome issue with
reproducer details for html.experimentalFullSupportEnabled.
In `@package.json`:
- Line 27: The PR upgraded `@biomejs/biome` to v2 but may not have run the
official migration; run the official migration command (biome migrate --write)
to convert biome.json to the v2 format, then run biome check to surface any new
cross-file rules; if biome.json was edited manually, replace it with the output
from biome migrate --write, resolve any newly-promoted rules or config errors
reported by biome check, and commit the migrated biome.json so the project uses
the supported v2 config format.
No description provided.