-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Current Limitation
The Asgardeo JavaScript SDKs currently have all i18n (internationalization) functionality centralized within the @asgardeo/javascript
package. While this provides a central location, it creates several limitations:
- Tight Coupling: All packages that need i18n functionality must depend on the entire
@asgardeo/javascript
package, even if they only need translations - Bundle Size: Packages importing i18n features also pull in the entire JavaScript SDK, increasing bundle size unnecessarily
- Circular Dependencies: Risk of circular dependency issues when other packages need to provide i18n support back to the JavaScript package
- Separation of Concerns: I18n functionality is mixed with core authentication logic, making it harder to maintain and extend
- Reusability: Other framework-specific packages cannot easily reuse i18n functionality without importing the full JavaScript SDK
Suggested Improvement
Extract the internationalization functionality from the @asgardeo/javascript
package into a dedicated @asgardeo/i18n
package that can be independently consumed by all Asgardeo JavaScript SDKs. This improvement includes:
-
Standalone I18n Package: Create a new
@asgardeo/i18n
package containing:- Core i18n models and types (
I18nBundle
,I18nTranslations
,I18nMetadata
) - Default translation bundles (starting with
en-US
) - Utility functions for i18n management (
getI18nBundles
)
- Core i18n models and types (
-
JavaScript Package Cleanup: Refactor
@asgardeo/javascript
to:- Remove i18n models, translations, and utilities
- Import i18n functionality from the new dedicated package
- Maintain backward compatibility for existing
I18nPreferences
exports
-
Enhanced Architecture:
- Cleaner separation of concerns between authentication and i18n
- Reduced bundle size for packages that only need i18n functionality
- Better modularity and maintainability
- Easier testing and development of i18n features in isolation
-
Framework Integration: Update React and other framework-specific packages to directly consume the
@asgardeo/i18n
package while maintaining their specific context providers and hooks.
Please select the package issue is related to
@asgardeo/express
Version
current
Reporter Checklist
- I have searched the existing issues and this is not a duplicate.
- I have provided all the necessary information.
- I have verified the improvement is not available in the latest version of the package.