Skip to content

Build the codec worker as a standalone Vite artifact - #54

Merged
xinaesthete merged 1 commit into
mainfrom
codex/fix-vite-worker-bootstrap-attempt2
Jun 22, 2026
Merged

Build the codec worker as a standalone Vite artifact#54
xinaesthete merged 1 commit into
mainfrom
codex/fix-vite-worker-bootstrap-attempt2

Conversation

@xinaesthete

@xinaesthete xinaesthete commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Previous attempt at fixing #50 was not adequate. Hopefully this will be.

  • Build codec-worker in a separate Vite mode so it ships as a self-contained bundle
  • Keep the main package build focused on the library entry points
  • Update package metadata and README wording to reflect the new worker artifact
  • Add a changeset for the zarrextra patch release

Testing

  • Not run (not requested)

Summary by CodeRabbit

  • New Features

    • Codec worker now available as a self-contained artifact optimized for Vite consumers.
  • Documentation

    • Clarified worker script documentation and added notes on future lightweight bundle options when JP2K/HTJ2K codecs are not required.
  • Chores

    • Refined package build configuration and publishing structure.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1b127979-4b7c-430e-994d-729790a52b20

📥 Commits

Reviewing files that changed from the base of the PR and between 2796d38 and 3c7251b.

📒 Files selected for processing (4)
  • .changeset/solid-codec-worker.md
  • packages/zarrextra/README.md
  • packages/zarrextra/package.json
  • packages/zarrextra/vite.config.ts

📝 Walkthrough

Walkthrough

The zarrextra Vite build is split into two passes: the standard multi-entry library build and a new codec-worker mode build that emits a fully self-contained codec-worker.js with all dependencies inlined and no externals. The package.json build script runs both passes, and a files whitelist is added for publishing.

Changes

zarrextra codec-worker self-contained build

Layer / File(s) Summary
Mode-aware Vite config and build entries
packages/zarrextra/vite.config.ts
Converts the static defineConfig export to a ({ mode }) callback. In codec-worker mode: uses only the codec-worker file as the lib entry, emits codec-worker.js, disables codeSplitting, skips DTS generation, and inlines all dependencies (no externals). In the default mode, behavior is unchanged: externalizes pkgExternals, emits index/workers entries, and generates DTS with the expanded exclude list.
Package build script, publish files, changelog, and docs
packages/zarrextra/package.json, .changeset/solid-codec-worker.md, packages/zarrextra/README.md
scripts.build is updated to run vite build && vite build --mode codec-worker. A "files": ["dist"] whitelist is added. The changeset documents the patch bump. The README notes that the current bundled worker is the default and that future entries may provide lighter bundles without JP2K/HTJ2K codecs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Taylor-CCB-Group/SpatialData.js#52: Directly related — exposes the codec-worker entry and updates URL/export paths that depend on the codec-worker.js artifact produced by this build change.

Poem

🐇 Two build passes, one for all,
One self-contained to heed the call!
No externals left behind,
A worker bundle, tightly twined.
The rabbit cheers with codec glee — 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: building the codec worker as a standalone Vite artifact, which is the core change across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-vite-worker-bootstrap-attempt2

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.

@xinaesthete
xinaesthete merged commit c84758c into main Jun 22, 2026
2 checks passed
@xinaesthete
xinaesthete deleted the codex/fix-vite-worker-bootstrap-attempt2 branch June 22, 2026 12:07
@github-actions github-actions Bot mentioned this pull request Jun 22, 2026
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