Skip to content

feat(examples): add SvelteKit getting-started starter - #3892

Merged
caio-pizzol merged 4 commits into
superdoc:mainfrom
MeritonPylla:feat/sveltekit-example-main
Aug 12, 2026
Merged

caio-pizzol merged 4 commits into
superdoc:mainfrom
MeritonPylla:feat/sveltekit-example-main

Conversation

@MeritonPylla

@MeritonPylla MeritonPylla commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

The examples catalog has React and vanilla quickstarts, but no SvelteKit starter. This adds one under examples/sveltekit.

The part worth a look is SSR. SuperDoc only runs in the browser, so if it loads during SSR you get document is not defined. I didn't want to turn SSR off for the whole app, so I set ssr = false on just the editor route and mount the editor in a client-only $effect. Everything else in an app keeps server rendering.

Registered it like the other v2 examples: examples/README.md, go-links/links.json, and published-routes.json.

Tested locally: typecheck / build / Playwright smoke pass, and it renders a real .docx with a clean console.

Re-opened against main for v2 after #3858 (which targeted v1) was closed.

@MeritonPylla MeritonPylla changed the title feat(examples): add SvelteKit quickstart for v2 feat(examples): add SvelteKit getting-started starter Aug 11, 2026

@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 17 files

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

Re-trigger cubic

Comment thread examples/sveltekit/playwright.config.ts Resolved
@MeritonPylla

Copy link
Copy Markdown
Contributor Author

@caio-pizzol following up on your note on #3858: this is the SvelteKit starter reopened against main for v2. lmk what u think

Port the closed v1 starter (superdoc#3858) onto main's flat examples layout with
SSR scoped off, readiness/export UX, and a Playwright smoke test.
Avoid colliding with custom-ui on 4177 when check:examples runs in parallel.
@MeritonPylla
MeritonPylla force-pushed the feat/sveltekit-example-main branch from 73f1ac9 to 9e115c5 Compare August 12, 2026 07:48
@qodo-code-review

qodo-code-review Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)



View medium (1)
🟠 **Medium**
1. Readiness remains enabled after failure 🐞
Description
After the editor has opened, onException no longer clears ready, so the Export DOCX button
remains enabled even when SuperDoc reports an exception that may invalidate the active editor. This
allows users to attempt export from an errored editor and can produce a failed, empty, or stale
download.
Code

examples/sveltekit/src/routes/+page.svelte[R29-32]

+        if (!opened) {
+          loadFailed = true;
+          if (active) ready = false;
+        }
Evidence
The exception handler only sets ready = false when opened is false. Once onReady sets `opened
= true and ready = true`, a later exception leaves both the readiness flag and the export button
enabled; the button's disabled expression directly depends on ready.

examples/sveltekit/src/routes/+page.svelte[23-34]
examples/sveltekit/src/routes/+page.svelte[64-67]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A SuperDoc exception received after `onReady` leaves `ready` set to true because the handler only clears it while `opened` is false. The export button therefore remains enabled after an exception that may make the editor no longer exportable.

## Issue Context
The button at `examples/sveltekit/src/routes/+page.svelte[65-67]` is disabled solely from `!ready || exporting`. Preserve any intended recoverable-exception behavior, but ensure exceptions classified as fatal invalidate readiness.

## Fix Focus Areas
- examples/sveltekit/src/routes/+page.svelte[28-34]
- examples/sveltekit/src/routes/+page.svelte[64-67]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Context
Review mode: ⚖️ Balanced: This push changes the SvelteKit SSR boundary and Vite dependency optimization, creating runtime/build behavior risks that warrant a complete single-pass review, though it is not dense enough for extended.

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗


Previous review results

Review updated until commit 45cdd1d ⚖️ Balanced

Results up to commit 5de01d1 🚀 Fast


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 📜 Skill insights (0)



View medium (1)
🟠 **Medium**
1. Readiness remains enabled after failure 🐞
Description
After the editor has opened, onException no longer clears ready, so the Export DOCX button
remains enabled even when SuperDoc reports an exception that may invalidate the active editor. This
allows users to attempt export from an errored editor and can produce a failed, empty, or stale
download.
Code

examples/sveltekit/src/routes/+page.svelte[R29-32]

+        if (!opened) {
+          loadFailed = true;
+          if (active) ready = false;
+        }
Evidence
The exception handler only sets ready = false when opened is false. Once onReady sets `opened
= true and ready = true`, a later exception leaves both the readiness flag and the export button
enabled; the button's disabled expression directly depends on ready.

examples/sveltekit/src/routes/+page.svelte[23-34]
examples/sveltekit/src/routes/+page.svelte[64-67]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A SuperDoc exception received after `onReady` leaves `ready` set to true because the handler only clears it while `opened` is false. The export button therefore remains enabled after an exception that may make the editor no longer exportable.

## Issue Context
The button at `examples/sveltekit/src/routes/+page.svelte[65-67]` is disabled solely from `!ready || exporting`. Preserve any intended recoverable-exception behavior, but ensure exceptions classified as fatal invalidate readiness.

## Fix Focus Areas
- examples/sveltekit/src/routes/+page.svelte[28-34]
- examples/sveltekit/src/routes/+page.svelte[64-67]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Powered by Qodo

@caio-pizzol caio-pizzol 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.

Thanks for the contribution, @MeritonPylla! I pushed a few small updates to keep this consistent with our other quickstarts:

  • Kept SSR enabled since SuperDoc starts inside $effect.
  • Fixed pnpm dev so the document worker loads correctly.
  • Updated the README and test to match.

Everything is working locally. We’ll wait for CI and then this should be ready.

@caio-pizzol
caio-pizzol enabled auto-merge (squash) August 12, 2026 20:05
@caio-pizzol
caio-pizzol disabled auto-merge August 12, 2026 20:13
@caio-pizzol
caio-pizzol merged commit 1c57bb1 into superdoc:main Aug 12, 2026
37 checks passed
@MeritonPylla

Copy link
Copy Markdown
Contributor Author

Thanks for the contribution, @MeritonPylla! I pushed a few small updates to keep this consistent with our other quickstarts:

  • Kept SSR enabled since SuperDoc starts inside $effect.
  • Fixed pnpm dev so the document worker loads correctly.
  • Updated the README and test to match.

Everything is working locally. We’ll wait for CI and then this should be ready.

Looking good, thanks to you too

superdoc-bot Bot pushed a commit that referenced this pull request Oct 1, 2026
Note: this ports only the public subtree changes from a mixed source commit (19 public paths, 2 non-public paths ignored).

Ported-From-Source-Repo: superdoc/orbit
Ported-From-Source-Commit: 547b1638c87eb58952b62110f54ffc88a0bed2fa
Ported-Public-Prefix: superdoc/public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants