Giter Club home page Giter Club logo

Comments (7)

maraisr avatar maraisr commented on June 18, 2024

Hi @abeforgit thanks for the issue! Yeah that isnt the greatest DX for sure. But in 0.1.4 we did release a fix that made it so the typings all work as it should.

But in saying that i see you're using TypeScript 3 — maybe all i need to do is check when typeVersions as introduced and set that is its version, currently its > 4

from diary.

abeforgit avatar abeforgit commented on June 18, 2024

ah yes thatll be it
I'll see if I can't make a pr to support lower ts versions, upgrading is a bit of a battle on our end

from diary.

abeforgit avatar abeforgit commented on June 18, 2024

I'd suggest adding to the README that currently only ts >4 is supported, I'd consider this issue as resolved then

from diary.

maraisr avatar maraisr commented on June 18, 2024

I don't think any of the TypeScript itself is a hard and fast v4+, do you mind helping me test this? Can you open up node_modules/diary/package.json and change the typeVersions to >3 ald let me know if that works for you.

If that works we can surely raise a PR.

from diary.

abeforgit avatar abeforgit commented on June 18, 2024

Taking the version down works indeed, but it's not quite that simple. Taking the version down implies we would support that version of typescript, which is actually quite annoying to verify if we want to keep developing using the latest typescript compiler.
Reference here: microsoft/TypeScript#31907
There is this package: https://github.com/sandersn/downlevel-dts which attempts to automatically create "polyfills" for older typescript versions, but it's not perfect and they explicitly say you'd need to verify it manually with the specific tsc version.

According to this comment there are no plans to provide any native support for this in typescript.

On the other hand, since this is really only an issue about types, not about functionality, it wouldn't be too bad to just kind of assume things will work and handle issues as they appear. Typescript should also be one of the easier packages to upgrade since as long as it compiles it shouldn't interfere with the way the program works.

I had no idea packaging ts projects was this much of a pain 😅 this is my first experience with it

from diary.

abeforgit avatar abeforgit commented on June 18, 2024

In any case if you do end up going for it I'd suggest targeting 3.4 or higher, to keep the option for using downlevel-dts open

from diary.

abeforgit avatar abeforgit commented on June 18, 2024

Fyi I did end up just updating our typescript version to latest, it was not painful at all :) for me you can close this issue, maybe still add a hint in the readme that if people need support for lower versions they can raise an issue?

from diary.

Related Issues (14)

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.