Skip to content

fix: add preview-only package entrypoint - #21

Merged
messagesgoel-blip merged 1 commit into
2.xfrom
fix/preview-subpath-export
Jun 8, 2026
Merged

fix: add preview-only package entrypoint#21
messagesgoel-blip merged 1 commit into
2.xfrom
fix/preview-subpath-export

Conversation

@messagesgoel-blip

@messagesgoel-blip messagesgoel-blip commented Jun 8, 2026

Copy link
Copy Markdown

User description

Summary

  • add @numeracode/whimsy-file-browser/preview as a side-effect-light preview entrypoint
  • build preview separately from the legacy browser root entry
  • update docs so Whimsy imports preview primitives from the subpath

Test plan

  • npm run typecheck --workspace packages/chonky
  • npm test --workspace packages/chonky -- --run preview-shell.test.tsx
  • npm run build --workspace packages/chonky
  • npm pack --workspace packages/chonky --dry-run

Discovered during the Whimsy preview unification spike: importing the package root evaluates legacy redux/browser modules, so preview-only consumers need a subpath.


CodeAnt-AI Description

Add a preview-only import path for file browser previews

What Changed

  • Preview components can now be imported from @numeracode/whimsy-file-browser/preview instead of the package root
  • The preview-only path exposes the shell, tile, lightbox, previewer, and related preview types for host apps that only need preview features
  • The main docs now point preview integrations to the new subpath and call out that it avoids loading the legacy browser runtime

Impact

✅ Smaller preview-only imports
✅ Faster preview startup in host apps
✅ Fewer legacy browser dependencies loaded for preview surfaces

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • Added a dedicated /preview subpath export for importing preview components and utilities separately.
  • Documentation

    • Updated README guidance to clarify that preview-only integrations should import components from the /preview subpath instead of the package root, reducing unnecessary legacy runtime loading.

@cr-gpt

cr-gpt Bot commented Jun 8, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai

codeant-ai Bot commented Jun 8, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @messagesgoel-blip, you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@messagesgoel-blip

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

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 Plus

Run ID: 7dafccf1-a9fe-46b7-bbe8-a745ecd23cbb

📥 Commits

Reviewing files that changed from the base of the PR and between 92f24fa and 9fa3fc2.

📒 Files selected for processing (4)
  • README.md
  • packages/chonky/README.md
  • packages/chonky/package.json
  • packages/chonky/src/preview.ts

📝 Walkthrough

Walkthrough

This PR establishes a new /preview package subpath export and a barrel module (src/preview.ts) to enable preview-only integrations. The package is updated to compile the new barrel alongside the main entry point, exports are added to package.json, and documentation is updated to guide consumers to the subpath to avoid loading the legacy browser/redux runtime.

Changes

Preview subpath export

Layer / File(s) Summary
Package export configuration and build setup
packages/chonky/package.json
The exports map defines a new ./preview subpath with types, ESM, and CJS entry points. Build and dev scripts are updated to compile both src/index.ts and src/preview.ts.
Preview barrel module
packages/chonky/src/preview.ts
New barrel re-exports FilePreviewer, MediaLightbox, PreviewShell, PreviewTile, PreviewFallback, defaultPreviewRenderers, createBrowserOpaqueId, and related types from browser-item and preview-shell type modules.
Documentation updates
README.md, packages/chonky/README.md
Root and package READMEs updated to instruct consumers to import preview components from @numeracode/whimsy-file-browser/preview subpath to avoid loading legacy browser/redux runtime.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Numeracode/whimsy-file-browser#14: Introduced BrowserOpaqueId, BrowserItem, and preview-related types that are now re-exported through the new ./preview barrel.
  • Numeracode/whimsy-file-browser#20: Introduced the PreviewShell, FilePreviewer, and other preview UI components that are now exposed via the ./preview subpath.
  • Numeracode/whimsy-file-browser#13: Modernized the tsup/exports build setup in package.json that now enables the addition of the ./preview subpath and separate building of src/preview.ts.

Suggested labels

track:preview, kind:slice, size:L

Poem

🐰 A preview path so clean and bright,
No redux weight to slow the flight,
Just shells and tiles, lean and tight—
Consumers dance in pure delight!

🚥 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 change: adding a preview-only package entrypoint at the /preview subpath to avoid loading legacy modules.
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 fix/preview-subpath-export

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

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Action performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Jun 8, 2026
@codeant-ai

codeant-ai Bot commented Jun 8, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@messagesgoel-blip
messagesgoel-blip merged commit 9fd9292 into 2.x Jun 8, 2026
4 checks passed
@messagesgoel-blip
messagesgoel-blip deleted the fix/preview-subpath-export branch June 8, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant