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

migration: named slots collision with javascript keywords #14277

Closed
TorstenDittmann opened this issue Nov 12, 2024 · 0 comments · Fixed by #14278
Closed

migration: named slots collision with javascript keywords #14277

TorstenDittmann opened this issue Nov 12, 2024 · 0 comments · Fixed by #14278

Comments

@TorstenDittmann
Copy link
Contributor

TorstenDittmann commented Nov 12, 2024

Describe the bug

Using named slots with a name that is a reserved keyword in JS, will create a broken snippet 👍🏻

Probably all of these will affect migration => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords

Create a PR that will re-use the @migration-task logic => #14278

Reproduction

having

<slot name="new">
    ...
</slot>

will create following in migration:

{#snippet new()}

and results into the following error:

ts: 'new' is a reserved word in JavaScript and cannot be used here

Logs

No logs during migration

System Info

System:
    OS: macOS 15.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 85.53 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
    npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm
    pnpm: 9.7.0 - ~/.nvm/versions/node/v20.13.1/bin/pnpm
    bun: 1.1.30 - ~/.bun/bin/bun
  Browsers:
    Chrome: 130.0.6723.117
    Safari: 18.1
  npmPackages:
    svelte: ^5.0.0 => 5.1.15

Severity

annoyance

dummdidumm pushed a commit that referenced this issue Nov 12, 2024
Fixes named slots with a reserved keyword not working anymore after migration. Re-uses the @migration-task logic for invalid identifiers.

Fixes #14277
trueadm pushed a commit that referenced this issue Nov 13, 2024
Fixes named slots with a reserved keyword not working anymore after migration. Re-uses the @migration-task logic for invalid identifiers.

Fixes #14277
trueadm pushed a commit that referenced this issue Nov 13, 2024
Fixes named slots with a reserved keyword not working anymore after migration. Re-uses the @migration-task logic for invalid identifiers.

Fixes #14277
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 a pull request may close this issue.

1 participant