-
Notifications
You must be signed in to change notification settings - Fork 20
refactor(update SDK exports to use named imports, deprecate default export) ♻️ #11
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
base: main
Are you sure you want to change the base?
refactor(update SDK exports to use named imports, deprecate default export) ♻️ #11
Conversation
…xport): ♻️
### This change aligns the SDK with modern JavaScript/TypeScript best practices, as default exports can cause confusion, especially when multiple exports exist in the same module.
### Benefits: - Improves clarity and consistency when importing the SDK.
- Reduces the chance of errors when integrating the SDK into other projects, as developers can now use `import { AbacatePay } from 'abacatepay'`.
- Addresses an issue where users had difficulty with the default export, enhancing the integration experience.
- Makes the API more modular and aligned with modern import/export patterns.
### Note: The default export is still present but is marked as `@deprecated` and can be removed in future versions.
Closes AbacatePay#5
|
How does it handles different environments like browser, typescript, EJS and CJS? |
Thanks for the question! This PR aims to improve compatibility across environments by favoring named exports, which are better supported in both ESM and CJS when consumed through bundlers or TypeScript-aware tools.
This update doesn’t break compatibility — it just adds more flexibility and improves developer experience in ESM and TypeScript setups. If the maintainers approve, we can mark the default export as deprecated in docs and fully transition in the next major release. |
|
Love the in depth details, will merge it very soon |
|
Oh, could you run the |
60514af to
bb263d4
Compare
Sure, done! |
This change aligns the SDK with modern JavaScript/TypeScript best practices, as default exports can cause confusion, especially when multiple exports exist in the same module.
Benefits:
import { AbacatePay } from 'abacatepay'.Note: The default export is still present but is marked as
@deprecatedand can be removed in future versions.Closes #5