Skip to content

docs: update Vite setup for native WebAssembly support - #53

Open
hyoban wants to merge 2 commits into
loro-dev:mainfrom
hyoban:docs/vite-native-wasm
Open

hyoban wants to merge 2 commits into
loro-dev:mainfrom
hyoban:docs/vite-native-wasm

Conversation

@hyoban

@hyoban hyoban commented Oct 10, 2026 •

Copy link
Copy Markdown

Summary

The Getting Started guide recommends WASM and top-level-await plugins for every Vite project. Vite 8.1 includes WASM ESM integration and its default browser targets support TLA, so those plugins are no longer needed with the default targets.

  • Add a Vite 8.1+ section and explain the TLA requirement for custom browser targets.
  • Document dependency exclusion as a conditional development workaround for the WASM initialization error reproduced with Vite 8.1.0 and loro-crdt 1.16.4.
  • Keep the two-plugin setup for older Vite versions, with a link explaining native-TLA targets.

References:

Validation

  • Documentation code-block tests: 148 passed (npm exec --yes --package=deno -- pnpm test).
  • pnpm build: passed, including sitemap/SEO build checks and OpenNext Cloudflare packaging.
  • Inspected the updated Getting Started page from the production build.
  • Previously verified a standalone Vite 8.1.0 + loro-crdt 1.16.4 fixture without WASM/TLA plugins: development and production preview passed snapshot replication, undo, and redo in Chromium. Production emitted a separate WASM asset.
  • In that fixture, reproduced the development-mode initialization error without dependency exclusion and verified that excluding Loro fixes it.

The older-Vite version matrix was not rerun. The exclusion workaround has only been verified with the version combination named above.

@hyoban
hyoban marked this pull request as ready for review October 10, 2026 02:29
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

No deployments
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