Skip to content
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

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

tiagoapolo
Copy link
Contributor

This PR fixes the following problems:

@tiagoapolo tiagoapolo requested a review from kyle-ssg January 20, 2025 16:02
@tiagoapolo tiagoapolo self-assigned this Jan 20, 2025
@@ -1,6 +1,6 @@
{
"name": "flagsmith",
"version": "9.0.0",
"version": "9.0.1",
Copy link
Contributor Author

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

Copy link
Member

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';
Copy link
Contributor

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?

Copy link
Member

@kyle-ssg kyle-ssg Jan 20, 2025

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.

@tiagoapolo tiagoapolo merged commit ad4a206 into main Jan 20, 2025
1 check passed
@tiagoapolo tiagoapolo deleted the fix/283--types-not-exported branch January 20, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants