Skip to content

chore: remove wasm from exclude list#714

Merged
ctrlc03 merged 2 commits into
mainfrom
chore/wasm-dep
Sep 17, 2025
Merged

chore: remove wasm from exclude list#714
ctrlc03 merged 2 commits into
mainfrom
chore/wasm-dep

Conversation

@cedoor

@cedoor cedoor commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

Closes #713

Summary by CodeRabbit

  • Chores

    • Updated client build configuration to allow an additional dependency to be pre-bundled by the dev server.
    • Minor formatting tweak with no functional impact.
  • Performance

    • Faster dev-server startup and improved hot-reload from expanded pre-bundling.
    • Potentially smoother initial local loads and fewer build hiccups during development.

@cedoor cedoor requested a review from ctrlc03 September 10, 2025 15:54
@vercel

vercel Bot commented Sep 10, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
crisp Skipped Skipped Sep 17, 2025 5:32pm
enclave-docs Skipped Skipped Sep 17, 2025 5:32pm

@coderabbitai

coderabbitai Bot commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Updated Vite configs: the default template stops excluding @enclave-e3/wasm from optimizeDeps, while the CRISP example contains only a cosmetic quote-style change. No public API/signature changes.

Changes

Cohort / File(s) Summary of changes
Vite optimizeDeps update (default template)
templates/default/client/vite.config.ts
Removed @enclave-e3/wasm from optimizeDeps.exclude; exclude list now only contains ['@rollup/browser'].
Formatting tweak (CRISP example)
examples/CRISP/client/vite.config.ts
Quote style for esbuildOptions.target changed from "esnext" to 'esnext' (cosmetic); optimizeDeps.exclude unchanged.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant Vite as Vite
    participant Esbuild as esbuild (optimizeDeps)
    participant Resolver as Module Resolver
    participant WASM as @enclave-e3/wasm

    Dev->>Vite: start dev server / build
    Vite->>Esbuild: run optimizeDeps (pre-bundle)
    Esbuild->>Resolver: resolve deps using exclude list
    Note over Esbuild,Resolver: Default template — WASM is no longer excluded
    Resolver-->>Esbuild: include WASM package
    Esbuild->>WASM: pre-bundle WASM package
    Esbuild-->>Vite: return optimized deps
    Vite-->>Dev: serve app with bundled dependencies
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • cedoor

Poem

I nibbled excludes and set one free,
Let WASM hop into the bundling tree.
Vite hums softly, esbuild takes a leap,
Modules bundled snugly — no more missing piece. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The PR removes @enclave-e3/wasm from the default template Vite config (templates/default/client/vite.config.ts), which addresses the core of issue #713, but examples/CRISP/client/vite.config.ts still lists @enclave-e3/wasm in optimizeDeps.exclude so the fix is only partial across the repository. Because not all occurrences were updated, example projects may continue to see the runtime failure described in #713. Therefore the PR does not fully satisfy the linked issue as submitted. Remove @enclave-e3/wasm from every Vite config that currently excludes it (for example examples/CRISP/client/vite.config.ts) or explicitly document that the scope is limited to the template; then run a local build to verify the app runs and update the PR so it fully closes #713. After those changes, request re-review.
Out of Scope Changes Check ⚠️ Warning The meaningful functional change is limited to the template Vite config, while examples/CRISP/client/vite.config.ts contains only a cosmetic quote-style change (esnext string quoting) that is unrelated to the linked issue and therefore out-of-scope. That cosmetic edit adds noise to the PR and makes it harder to review the functional intent. Because the PR includes unrelated formatting changes, it contains out-of-scope modifications. Revert or separate the cosmetic quote-style change into its own formatting PR and keep this PR focused on removing @enclave-e3/wasm from all Vite exclude lists; once only relevant functional changes remain, run tests/builds and request re-review. This will make the change set clearer and reduce review friction.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: remove wasm from exclude list" is concise and accurately describes the primary change in the PR — removing @enclave-e3/wasm from Vite's optimizeDeps.exclude. It uses a conventional commit prefix and contains no extraneous details, making the intent clear to reviewers. The title is appropriate for the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/wasm-dep

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a096dc and df73850.

📒 Files selected for processing (2)
  • examples/CRISP/client/vite.config.ts (1 hunks)
  • templates/default/client/vite.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • examples/CRISP/client/vite.config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • templates/default/client/vite.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test_contracts
  • GitHub Check: rust_unit
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: integration_prebuild
  • GitHub Check: test_net

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
templates/default/client/vite.config.ts (1)

20-21: Add esbuildOptions.target: 'esnext' to optimizeDeps

@enclave-e3/wasm is declared in packages/enclave-sdk/package.json:42 and no other vite.config.ts still excludes it; setting the esbuild target to esnext prevents errors on modern syntax and top-level await during pre-bundling:

   optimizeDeps: {
+    esbuildOptions: { target: 'esnext' },
     exclude: ['@rollup/browser'],
   },
examples/CRISP/client/vite.config.ts (1)

25-26: Good call removing wasm deps from exclude; consider forcing include if usage is dynamic

If @enclave-e3/wasm is only dynamically imported (or only used in workers), Vite may skip pre-bundling. Optionally force it into pre-bundle to stabilize cold starts:

  optimizeDeps: {
-   esbuildOptions: { target: 'esnext' },
-   exclude: ['@rollup/browser', '@noir-lang/noirc_abi', '@noir-lang/acvm_js'],
+   esbuildOptions: { target: 'esnext' },
+   include: ['@enclave-e3/wasm'], // optional: ensure pre-bundling even if not a direct entry import
+   exclude: ['@rollup/browser', '@noir-lang/noirc_abi', '@noir-lang/acvm_js'],
  },

Also, for consistency, mirror this esbuildOptions.target setting in the default template (it currently lacks it).

Please run a quick dev and build smoke locally to confirm esbuild’s pre-bundle doesn’t error on wasm imports and that runtime starts cleanly (no pre-bundle warnings about wasm).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b10468 and d52af33.

📒 Files selected for processing (2)
  • examples/CRISP/client/vite.config.ts (1 hunks)
  • templates/default/client/vite.config.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build_enclave_cli
  • GitHub Check: integration_prebuild
  • GitHub Check: build_sdk
  • GitHub Check: rust_unit
  • GitHub Check: test_net
  • GitHub Check: test_contracts

@vercel vercel Bot temporarily deployed to Preview – crisp September 17, 2025 17:32 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs September 17, 2025 17:32 Inactive
@ctrlc03 ctrlc03 enabled auto-merge (squash) September 17, 2025 17:32
@ctrlc03 ctrlc03 merged commit 6ad33df into main Sep 17, 2025
24 checks passed
@ctrlc03 ctrlc03 deleted the chore/wasm-dep branch September 18, 2025 14:04
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.

Remove WASM dependencies from Vite exclude list

2 participants