Skip to content

docs(svelte): import browser from $app/env instead of $app/environment - #11936

Open
pieralukasz wants to merge 1 commit into
TanStack:mainfrom
pieralukasz:docs/svelte-app-env
Open

pieralukasz wants to merge 1 commit into
TanStack:mainfrom
pieralukasz:docs/svelte-app-env

Conversation

@pieralukasz

@pieralukasz pieralukasz commented Oct 9, 2026 •

Copy link
Copy Markdown

🎯 Changes

SvelteKit 3 deprecated $app/environment in favour of $app/env. With 3.0.1, importing from $app/environment logs "$app/environment is deprecated, use $app/env instead" in dev, and svelte-check can't find its types. I hit this while setting up svelte-query in a new SvelteKit 3 app and copying from the SSR guide.

This swaps the import in the Svelte SSR guide and in the 7 Svelte examples. $app/env has the same browser export and exists since SvelteKit 2.63, and the examples are on ^2.70.3, so nothing else changes. I ran svelte-check and a build on the basic and ssr examples with their current dependencies, both clean.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation
    • Updated the Svelte SSR setup examples to use $app/env for browser detection.
  • Examples
    • Updated the Svelte sample apps to use the same browser-detection import.

@changeset-bot

changeset-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 993dba7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T10:31:39.223041Z 993dba7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a29b39b-c056-47e6-9199-c872d9802a8d

📥 Commits

Reviewing files that changed from the base of the PR and between aab3528 and 993dba7.


📒 Files selected for processing (8)
  • docs/framework/svelte/ssr.md
  • examples/svelte/auto-refetching/src/routes/+layout.svelte
  • examples/svelte/basic/src/routes/+layout.svelte
  • examples/svelte/load-more-infinite-scroll/src/routes/+layout.svelte
  • examples/svelte/optimistic-updates/src/routes/+layout.svelte
  • examples/svelte/playground/src/routes/+layout.svelte
  • examples/svelte/ssr/src/routes/+layout.ts
  • examples/svelte/star-wars/src/routes/+layout.svelte

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The Svelte SSR guide and seven example layouts now import browser from $app/env instead of $app/environment. Existing query client settings and load behavior remain unchanged.

Changes

SvelteKit environment imports

Layer / File(s) Summary
Update browser imports
docs/framework/svelte/ssr.md, examples/svelte/*/src/routes/+layout.svelte, examples/svelte/ssr/src/routes/+layout.ts
The guide examples and Svelte layouts import browser from $app/env. Existing query client settings and load behavior are unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other


Merge Risk: ⚪ Minimal · up to 993db

The changed imports are supported in the examples, and the guide uses the documented SvelteKit 3 API. No concrete merge-blocking risk is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check Passed The description explains the motivation, scope, compatibility, testing, checklist status, and release impact. All required template sections are present and complete.
Title check Passed The title clearly and concisely identifies the main change: updating Svelte imports from $app/environment to $app/env.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.


✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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