-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: Types not being exported and autocomplete not working #284
Conversation
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "flagsmith", | |||
"version": "9.0.0", | |||
"version": "9.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up that I increased the patch version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now you have to keep react-native's inline too
@@ -1,6 +1,7 @@ | |||
import { IFlagsmith } from './types'; | |||
declare const flagsmith: IFlagsmith; | |||
export default flagsmith; | |||
export * from './types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to understand the use of the wildcard export here. In a python context, whenever I see an import *
, it's an immediate red flag, but maybe that's not the case here because /types
explicitly defines what it wants to export I suppose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This'll basically mean we can import anything that was exported in types directly from flagsmith, i.e. it'll let us do
import { IInitConfig, IState } from 'flagsmith';
rather than need to do
import { IInitConfig, IState } from 'flagsmith/types';
It's an improvement rather than a fix to the original issue.
This PR fixes the following problems:
Types are found in 'react.d.ts', but this result could not be resolved when respecting package.json "exports"
)Cannot find module './evaluation-context' or its corresponding type declarations.
Cannot find module './evaluation-context' or its corresponding type declarations. #283