Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update 31-legacy-svelte-self.md #15161

Closed
wants to merge 1 commit into from

Conversation

jaminwebdev
Copy link

Addresses #15160

https://svelte.dev/docs/svelte/legacy-svelte-self shows old prop declaration syntax

<script>
	export let count;
</script>

{#if count > 0}
	<p>counting down... {count}</p>
	<svelte:self count={count - 1} />
{:else}
	<p>lift-off!</p>
{/if}

Should probably update to $props()

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).

Tests and linting

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

Copy link

changeset-bot bot commented Jan 30, 2025

⚠️ No Changeset found

Latest commit: 23d355a

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

Copy link
Member

@Conduitry Conduitry left a comment

Choose a reason for hiding this comment

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

I'm undecided how I feel about this. This is supposed to be demonstrating legacy syntax and how to convert it - but it's <svelte:self> that we're demonstrating how to convert here, not export props. I don't know whether we want to show other aspects of the component in old syntax or new syntax.

@jaminwebdev
Copy link
Author

I'm undecided how I feel about this. This is supposed to be demonstrating legacy syntax and how to convert it - but it's <svelte:self> that we're demonstrating how to convert here, not export props. I don't know whether we want to show other aspects of the component in old syntax or new syntax.

Understood. Was basing it from https://svelte.dev/docs/svelte/v5-migration-guide#svelte:component-is-no-longer-necessary, but I suppose this isn't documentation related to migrating

@Ocean-OS
Copy link
Contributor

I'm undecided how I feel about this. This is supposed to be demonstrating legacy syntax and how to convert it - but it's <svelte:self> that we're demonstrating how to convert here, not export props. I don't know whether we want to show other aspects of the component in old syntax or new syntax.

I feel like mixing the old and new syntax will just lead to confusion.

@gterras
Copy link

gterras commented Jan 31, 2025

I think removing the old docs was already a harsh move for v4 users. I understand switching to V5 is quite easy and all the information needed for v4 is still there, and the team wants to push v5 which is good, but traditional usage in this case is just to have a version selector on the docs page.

There are still people using v4 out there, and navigating the current docs is already hard enough for them. Mixing v5 syntax in legacy pages will make it even harder.

@dummdidumm
Copy link
Member

The old site is on https://v4.svelte.dev and it's linked to right on the https://svelte.dev/docs page

@gterras
Copy link

gterras commented Jan 31, 2025

The old site is on https://v4.svelte.dev and it's linked to right on the https://svelte.dev/docs page

Sorry I wasn't aware of this, it doesn't matter that much then, I think a point in favor of having full v4 syntax in legacy v5 docs is that maintenance is easier (it won't ever need to be updated).

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.

5 participants