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: evalation-context import, remove deprecation, add types import to… #286

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

kyle-ssg
Copy link
Member

  • added evaluation-context.ts to bundle since it is imported in types.d.ts
  • Removes missed deprecation
  • Adds types to package.json imports to allow for backwards compatibility, without this we get
import { IFlags, IRetrieveInfo, LoadingState } from 'flagsmith/types';
TS2307: Cannot find module flagsmith/types or its corresponding type declarations.

Comment on lines +10 to +14
"./types": {
"import": "./types.d.ts",
"require": "./types.d.ts",
"browser": "./types.d.ts"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by using this we can remove the types export from these files:

Copy link
Member Author

@kyle-ssg kyle-ssg Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe they'd serve different purposes to be honest.

The code I added preserves the ability to import from flagsmith/types, without this it was a breaking change.

The code you added (which is preferred but new) allows us to import types directly from flagsmith.

@kyle-ssg kyle-ssg merged commit 9978a11 into main Jan 22, 2025
1 check passed
@kyle-ssg kyle-ssg deleted the fix/types-and-context-deprecation branch January 22, 2025 09:52
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.

Cannot find module './evaluation-context' or its corresponding type declarations.
2 participants