Skip to content

Typescript Generics #2204

Closed
Closed
@jycouet

Description

@jycouet

Describe the bug

In https://github.com/dummdidumm/rfcs/blob/ts-typedefs-within-svelte-components/text/ts-typing-props-slots-events.md#generics I was able to learn about generics.

I would like to have:

<script lang="ts" generics="T extends Record<string, any>">

Unfortunalty I get ERROR: Unterminated string literal. (probably due to < and > parsing).


Timing seems great, I'm wondering if sveltejs/svelte#9482 will not solve this at the same time?

Reproduction

https://github.com/jycouet/kit-generics

Logs

No response

System Info

System:
    OS: macOS 14.1.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 17.00 GB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/node
    npm: 10.2.3 - ~/.nvm/versions/node/v21.2.0/bin/npm
    pnpm: 8.10.5 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 119.0.6045.123
    Safari: 17.1
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.1 
    @sveltejs/kit: ^1.27.4 => 1.27.6 
    svelte: ^4.0.5 => 4.2.3 
    vite: ^4.4.2 => 4.5.0

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions