Skip to content

fix(sv): scope @deprecated tag to legacy create(cwd, options) overload#1064

Merged
jycouet merged 2 commits into
sveltejs:mainfrom
mvanhorn:osc/1063-scope-create-deprecation
Apr 17, 2026
Merged

fix(sv): scope @deprecated tag to legacy create(cwd, options) overload#1064
jycouet merged 2 commits into
sveltejs:mainfrom
mvanhorn:osc/1063-scope-create-deprecation

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Closes #1063

Problem

The @deprecated JSDoc tag added in #1046 was intended to mark only the legacy create(cwd, options) positional form, but in practice editors strike through every reference to the create export — including correct calls like import { create } from 'sv'.

That happens because VS Code and tsserver resolve a symbol's JSDoc from the first overload in source order. Since the deprecated overload was listed first, its @deprecated tag became the canonical documentation for the symbol itself.

Fix

Reorder the overloads so the non-deprecated create(options) signature is declared first. The @deprecated tag now annotates only the legacy create(cwd, options) overload, matching the original intent of #1046.

Before:

  • import { create } → shown as deprecated
  • create({ cwd, ... }) → shown as deprecated
  • create('./', { ... }) → shown as deprecated

After:

  • import { create } → not deprecated
  • create({ cwd, ... }) → not deprecated
  • create('./', { ... }) → deprecated (as intended)

Testing

  • pnpm build regenerates packages/sv/api-surface.md with the overload order swapped (included in the diff)
  • pnpm check passes
  • pnpm lint passes

Changeset (patch) included.

The JSDoc @deprecated on the first overload caused editors to mark the
entire create export as deprecated, including the supported
create({ cwd, ...options }) call. Reorder the overloads so the
non-deprecated signature comes first; editors now strike through only
the legacy positional form.

Closes sveltejs#1063
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 2f5cd90

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@1064
npx https://pkg.pr.new/sv@1064
npx https://pkg.pr.new/@sveltejs/sv-utils@1064

commit: 2f5cd90

Copy link
Copy Markdown
Contributor

@jycouet jycouet left a comment

Choose a reason for hiding this comment

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

Thx

@jycouet jycouet merged commit 92d7ca1 into sveltejs:main Apr 17, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 17, 2026
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.

Types for create deprecate function entirely

2 participants