-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Named export #1551
Comments
Hey @fabrykowski 👋 Thanks for the feedback! After a search, I think For now, given it's should be easy for projects to migrate, I'd just go with |
The breaking change is, that in import * as Redis from 'ioredis';
// or equivalently
// import Redis from 'ioredis';
type RedisClient = Redis.Redis; or import { Redis } from 'ioredis';
type RedisClient = Redis; In v5 the only way is import Redis from 'ioredis';
type RedisClient = Redis; Of course a new major version is not required to be backwards compatible, but adding the named export would allow other libraries (e.g. graphql-redis-subscriptions) to support both versions simultaneously, which would help adopt the new major version. |
Alright. That's a fair enough point. I think we should only export the type to avoid confusion then: export type { default as Redis } from "./Redis"; Is this enough to allow graphql-redis-subscriptions to support both versions simultaneously? Just don't want to give multiple choices for users to import the same thing. |
Sure! I'll update the PR. Thank you! |
Closing via #1552 |
The new version (v5) comes with built-in typings, which I find great!
@types/ioredis
has, however, a named export, whereasioredis
only a default one.Would you consider adding a named export to your type definition, so that existing code with
does not break?
The text was updated successfully, but these errors were encountered: