Comments (7)
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.
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.
I'd suggest adding to the README that currently only ts >4 is supported, I'd consider this issue as resolved then
from diary.
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.
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.
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.
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)
- feature request: diaries that inherit from other scopes HOT 3
- [Feature] Allow logging of arbitrary object without message HOT 7
- [Bug] Handle cases where localStorage is not available. HOT 3
- Support `deno`
- Separate setup from logging in benchmarks HOT 4
- `LogFnAsError` type missing from `src/index.d.ts` HOT 3
- Trying to access process.env HOT 2
- Add check to filter log level HOT 2
- Add in a json logger as an extra
- Build babel plugin to enhance context HOT 3
- Consider anylogger support? HOT 4
- [RFC] Always "log" just don't output HOT 1
- TypeScript: Cannot find module 'diary' or its corresponding type declarations HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diary.