-
-
Notifications
You must be signed in to change notification settings - Fork 96
Labels
breaking changeBreaking changeBreaking changecomponent/vocabActivity Vocabulary relatedActivity Vocabulary relatedpriority/mediumMedium priority issuesMedium priority issuestype/deprecationDeprecation notices and migrationDeprecation notices and migrationtype/documentationImprovements or additions to documentationImprovements or additions to documentationtype/enhancementImprovements to existing featuresImprovements to existing featurestype/refactorCode refactoringCode refactoring
Milestone
Description
Problem
Currently, Fedify uses the third-party @phensley/language-tag package and its LanguageTag class to represent language tags and locales. For Fedify 2.0, we should migrate to the standardized Intl.Locale class which is part of the web platform and provides better compatibility across different JavaScript environments.
Benefits
- Standard API:
Intl.Localeis a web standard, ensuring better long-term compatibility - Reduced dependencies: Eliminates the need for the
@phensley/language-tagthird-party package - Better platform support: Native support across Deno, Node.js, and Bun environments
- Performance: Native implementation is likely more performant than userland code
Tasks
- Audit current usage of
@phensley/language-tagandLanguageTagthroughout the codebase - Replace
LanguageTagwithIntl.Localein all relevant code - Update type definitions and interfaces that reference
LanguageTag - Update tests to use
Intl.Localeinstead ofLanguageTag - Remove
@phensley/language-tagdependency from package.json - Update documentation and examples to reflect the new API
- Verify compatibility across all supported environments (Deno, Node.js, Bun)
Breaking Changes
This will be a breaking change for Fedify 2.0 as any public APIs that currently accept or return LanguageTag will now use Intl.Locale instead.
Migration Guide
Users will need to:
- Replace
LanguageTagimports withIntl.Locale - Update any code that creates or manipulates language tags to use the
Intl.Localeconstructor and methods - Review any custom code that depends on
LanguageTag-specific methods or properties
Target
This should be completed as part of the Fedify 2.0 release.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changeBreaking changeBreaking changecomponent/vocabActivity Vocabulary relatedActivity Vocabulary relatedpriority/mediumMedium priority issuesMedium priority issuestype/deprecationDeprecation notices and migrationDeprecation notices and migrationtype/documentationImprovements or additions to documentationImprovements or additions to documentationtype/enhancementImprovements to existing featuresImprovements to existing featurestype/refactorCode refactoringCode refactoring