V3 polishing.1#20
Open
DRFR0ST wants to merge 29 commits into
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a major version 3 rewrite of the react-littera library, transitioning from a traditional provider-context pattern to a more modern factory-based approach with simplified APIs and improved TypeScript support.
Key Changes
- Complete API redesign using factory pattern with
createLittera()function - Simplified translation structure (locale-first instead of key-first)
- Modern build tooling migration from Webpack/Jest to Bun
Reviewed Changes
Copilot reviewed 54 out of 68 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Version bump to 3.0.0-next.1 with updated dependencies and build scripts |
| src/index.ts | New main exports focusing on core translate function and React components |
| src/react/service.tsx | New factory function for creating Littera instances with context and provider |
| src/react/hooks.ts | Modern React hooks implementation with TypeScript generics |
| src/core/translate.ts | Simplified core translation logic |
| src/utils/helpers.ts | New utility functions for validation and object manipulation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| * Disabled for 'production' environment. | ||
| * @param translations The translations object. | ||
| */ | ||
| export const raportMissingTranslations = <T>( |
There was a problem hiding this comment.
Function name contains a typo. 'raportMissingTranslations' should be 'reportMissingTranslations'.
Suggested change
| export const raportMissingTranslations = <T>( | |
| export const reportMissingTranslations = <T>( |
| export const makeTranslations = | ||
| <L, P>(LitteraContext: React.Context<LitteraContextValue<L, P>>) => | ||
| <T, K extends keyof T>(translations: LitteraTranslations<T>) => { | ||
| raportMissingTranslations(translations) |
There was a problem hiding this comment.
Function call contains a typo. 'raportMissingTranslations' should be 'reportMissingTranslations'.
Suggested change
| raportMissingTranslations(translations) | |
| reportMissingTranslations(translations) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.