Skip to content

docs: Vite plugin demo app and README for 4.6.0 - #85

Merged
alekswebnet merged 2 commits into
masterfrom
docs/vite-plugin-demo
Nov 24, 2026
Merged

alekswebnet merged 2 commits into
masterfrom
docs/vite-plugin-demo

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

README and demo for the Vite plugin released in 4.6.0 (#84). The hosted docs change in missing-elements.github.io#108.

  • demo/vite-plugin/ is a minimal Vite app with the plugin. It installs the published package (^4.6.0), so it doesn't depend on a local build. Its PDF holds one scanned image compressed with CCITT, which PDF.js decodes with wasm/jbig2.wasm. Its README says how to run it and how to see the problem the plugin solves.
  • README: Vite and the frameworks built on it get the plugin, and webpack, Next.js and other bundlers get the copy + assets-base. Both link to the new docs sections, and the cache note points to the docs before an upgrade.
  • demo/assets-base.html: its comment said bundlers don't need assets-base. Bundled apps do need it for the data, unless they use the plugin.
  • .gitignore: public → /public, so only the root folder the sync script fills is ignored and the demo can keep its PDF in its own public/. The lockfile the demo creates is ignored.

Note for the README links

#vite-plugin and #other-bundlers-and-assets-base exist only after the docs PR merges. Merge that one first, or together with this one.

Validation

The demo was installed from npm into a scratch folder (4.6.0, Vite 8.3.8), built, served with vite preview and opened in Firefox:

Build Left half of the page Console
With the plugin (297 files) black no warnings
Without the plugin (11 files) white Unable to decode image "img_p0_1": "Jbig2Error: JBig2 failed to initialize"
vite dev, without the plugin black no warnings

vite preview answers the missing assets/wasm/ files with the app's HTML page and a 200, not a 404, so the demo's README describes the console warning rather than a 404.

Checklist

  • The change is focused and includes tests for behavior changes. No behavior changes: docs, a demo and an ignore rule.
  • Relevant tests and the build pass locally.
  • Public API, behavior, or user-guidance documentation is updated where needed.
  • Accessibility impact has been considered, including keyboard navigation and focus visibility. The viewer is untouched.
  • This pull request does not disclose a security vulnerability.

🤖 Generated with Claude Code


Summary by cubic

Adds a minimal Vite demo app and updates the README to document the Vite plugin shipped in 4.6.0. The demo installs the published package and reproduces the blank-page problem that occurs when an app is built without the plugin.

  • demo/vite-plugin/ is a minimal Vite app with a CCITT-compressed scan; built without the plugin the image stays white with a Jbig2Error console warning.
  • The README now points Vite-based frameworks to the plugin, and webpack, Next.js and other bundlers to copying dist plus assets-base, linking to the new docs sections. It also says what to do when the host caches assets as immutable.
  • .gitignore now ignores only the root public/ folder so the demo can keep its PDF, and ignores the demo's generated lockfile.
  • The assets-base.html comment now notes that bundled apps need it for the PDF.js data unless they use the plugin.

Written for commit 35750b4. Summary will update on new commits.

View guided diff Turn on auto-fix

demo/vite-plugin is a minimal Vite app that installs the published
package and uses the plugin; its PDF holds one CCITT image, which stays
white when the app is built without the plugin. The README names the
Vite-based frameworks, links the docs' new Vite plugin and
other-bundlers sections, and points to the caching note before an
upgrade.

.gitignore now ignores only the root public/ folder, so the demo can
keep its PDF in its own public/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-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.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread README.md Resolved
Comment thread .gitignore Resolved
Comment thread demo/assets-base.html Resolved
Comment thread demo/vite-plugin/index.html Resolved
The README says what to do about an immutable cache instead of only
pointing to the docs. The assets-base demo comment no longer reads as if
the demo loads from a CDN. The Vite plugin demo lays the page out as a
flex column, so the viewer fills what the text leaves on any width
instead of a fixed calc().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alekswebnet
alekswebnet merged commit 49f2be1 into master Nov 24, 2026
7 checks passed
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