Code Monkey home page Code Monkey logo

Comments (5)

dummdidumm avatar dummdidumm commented on August 17, 2024 1

This is definetly unrelated to Svelte, therefore closing.

I'd still wanted to figure out why decorators aren't downleveled though. AFAIK ESbuild supports decorators, and so does TS 5.0+, so I would've thought that Vite would downlevel them. Things I tried without success:

  • setting "target": "ES2022" in the tsconfig.json
  • setting build.target to 'es2022' in vite.config.ts

What finally worked, thanks to pointers in vitejs/vite#17308:

  • setting esbuild.target to 'es2022' in vite.config.ts

What also works, but which isn't really what one should do going forward is to set "experimentalDecorators": true in your tsconfig.json. This means TypeScript's obsolete/deprecated decorator downleveling is used.

from svelte.

paoloricciuti avatar paoloricciuti commented on August 17, 2024

This is basically a duplicate of #11502

from svelte.

dummdidumm avatar dummdidumm commented on August 17, 2024

Depends - I would have expected the typescript plugin to run on that file first, which would then down level the decorator. Wondering why that isn't the case, and whether that's due to specific tsconfig settings.

Please provide a proper reproduction link so we can investigate

from svelte.

Padi2312 avatar Padi2312 commented on August 17, 2024

(Its me @gemue-parndt just from my personal account)

@dummdidumm I just uploaded a reproduceable example. example.zip

I also figured out it doesn't depends on the runtime, it doesn't work neither with Bun nor with Node.
Additionally i made the example just with Svelte and Svelte 4, also having the same problem.

from svelte.

gemue-parndt avatar gemue-parndt commented on August 17, 2024

(Its me @gemue-parndt just from my personal account)

@dummdidumm I just uploaded a reproduceable example. example.zip

I also figured out it doesn't depends on the runtime, it doesn't work neither with Bun nor with Node. Additionally i made the example just with Svelte and Svelte 4, also having the same problem.

here you go

from svelte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.