Skip to content

docs: clarify $bindable fallback binding requirement#18477

Open
barry166 wants to merge 1 commit into
sveltejs:mainfrom
barry166:barry/docs-bindable-fallback-value
Open

docs: clarify $bindable fallback binding requirement#18477
barry166 wants to merge 1 commit into
sveltejs:mainfrom
barry166:barry/docs-bindable-fallback-value

Conversation

@barry166

Copy link
Copy Markdown

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset). N/A, docs-only.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Summary

Closes #18417.

Adds the $bindable page note that the Svelte 5 migration guide already documents: when a bindable prop has a fallback value, a parent using bind: must pass a value other than undefined.

This keeps the docs local to where users first read about $bindable('fallback').

AI assistance

This PR was AI-assisted. I manually reviewed the final diff before submission.

Test plan

  • corepack pnpm lint
  • corepack pnpm test

Note: I also tried corepack pnpm check, but it is blocked in this local environment by a nested install invoking a pnpm 11 lifecycle/build-approval path. The docs-only change is covered by lint and the full test suite above.

The `$bindable` rune page already shows fallback values but did not repeat the runes-mode constraint documented in the Svelte 5 migration guide. This adds the missing note directly where users learn `$bindable`, so readers do not need to discover the non-undefined binding requirement elsewhere.

Constraint: Keep the change documentation-only and aligned with the existing migration guide language

Rejected: Add runtime linting behavior | issue only asks for docs and lint design would need maintainer discussion

Confidence: high

Scope-risk: narrow

Directive: Do not expand this PR into runtime validation without maintainer direction

Tested: corepack pnpm lint

Tested: corepack pnpm test

Not-tested: corepack pnpm check blocked by local pnpm 11 lifecycle build-approval issue during nested install
@changeset-bot

changeset-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 978830e

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

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.

Improve docs when binding to a $bindable with a fallback value

1 participant