Skip to content

Comments

Upgrade to the @moq packages#75

Merged
kixelated merged 5 commits intomainfrom
update-packages
Feb 20, 2026
Merged

Upgrade to the @moq packages#75
kixelated merged 5 commits intomainfrom
update-packages

Conversation

@kixelated
Copy link
Collaborator

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Warning

Rate limit exceeded

@kixelated has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Walkthrough

This pull request replaces the single @kixelated/hang client with two packages: @moq/publish and @moq/watch. Source components (publish, watch) are refactored to use new MoQ imports and UI wrappers (moq-publish-ui, moq-watch-ui); the Support component file is removed. Configuration and tooling updates include astro.config, package.json, justfile, biome.json, and elements.d.ts (new intrinsic elements and Attrs type). Documentation and blog pages are updated to reference the new packages and API shape.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a description explaining the upgrade from @kixelated/hang to @moq packages, including the motivation and impact of changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Upgrade to the @moq packages' directly and clearly summarizes the main change: replacing @kixelated/hang with @moq/publish and @moq/watch packages across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-packages

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Publish code 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/publish package instead. The correct API is Broadcast from @moq/publish. At minimum, readers copying this snippet will get a ReferenceError.

📝 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: prod in justfile and package.json use different serving tools

The justfile's prod runs bun astro preview --open (Astro's built-in Node.js static server), while package.json's prod script runs wrangler pages dev ./dist --open (Cloudflare Pages simulation). For a static site deployed to Cloudflare Pages, wrangler pages dev more accurately emulates CF Pages behaviours like custom _headers/_redirects rules. 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 including Attrs in the explicit moq-publish-ui/moq-watch-ui declarations for consistency

The @moq/publish and @moq/watch packages are installed and their UI wrapper elements are used in the codebase. Although attr:* is currently used only on <moq-publish> and <moq-watch> (not the -ui wrappers), the explicit declarations in IntrinsicElements override the inherited types from ElementProps<HTMLElementTagNameMap>, which means they lack the Attrs intersection. This would cause TypeScript errors if attr:* 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.

Comment on lines +56 to +64
<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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Comment on lines +1 to +4
// Use the moq web components.
import "@moq/watch/support/element";
import "@moq/watch/element";
import "@moq/watch/ui";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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 -20

Repository: 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 -50

Repository: 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 -50

Repository: 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 -20

Repository: 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 2

Repository: moq-dev/moq.dev

Length of output: 86


🏁 Script executed:

#!/bin/bash
# Read the elements.d.ts file
cat src/elements.d.ts

Repository: 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 2

Repository: 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).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
biome.json (2)

21-47: noUnknownAtRules.options.ignore: ["tailwind"] is redundant once the css.parser.tailwindDirectives bug is fixed.

css.parser.tailwindDirectives is an opt-in CSS parser feature in Biome 2.3.0+ that enables native Tailwind syntax support. With it enabled, Biome should natively recognize @tailwind and not flag it as an unknown at-rule. However, there is a confirmed bug in Biome 2.3.x where @tailwind directives are still flagged as warnings even when css.parser.tailwindDirectives is enabled.

The ignore: ["tailwind"] entry is a valid workaround for this active bug — the ignore option on noUnknownAtRules suppresses diagnostics for any unknown at-rule that matches the list. Once the upstream bug is resolved, the ignore list 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.experimentalFullSupportEnabled is explicitly experimental — expect potential false-positives.

This flag enables Biome's experimental full-support HTML parser for .vue, .svelte, and .astro files — 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 overrides block (lines 53–69) that suppresses noUnusedVariables, noUnusedImports, useConst, and useImportType for **/*.astro is appropriate compensation. The Biome changelog notes that those rules are now more stable and some overrides may no longer be needed when using experimentalFullSupportEnabled, though a few false positives from parser issues may remain.

Consider validating the full npm run check pass on .astro files 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: Confirm biome.json was 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 notes biome.json was updated in this PR — if that update was manual rather than via biome migrate, some keys may be silently ignored or cause errors.

💡 Suggested verification

Run bunx biome migrate --write if not already done, then bunx biome check to 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.

@kixelated kixelated enabled auto-merge (squash) February 20, 2026 22:39
@kixelated kixelated merged commit 49d3297 into main Feb 20, 2026
1 check passed
@kixelated kixelated deleted the update-packages branch February 20, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant