Skip to content

V3 polishing.1#20

Open
DRFR0ST wants to merge 29 commits into
masterfrom
v3-polishing.1
Open

V3 polishing.1#20
DRFR0ST wants to merge 29 commits into
masterfrom
v3-polishing.1

Conversation

@DRFR0ST
Copy link
Copy Markdown
Collaborator

@DRFR0ST DRFR0ST commented Jan 19, 2024

No description provided.

@DRFR0ST DRFR0ST requested a review from Copilot August 13, 2025 22:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/utils/helpers.ts
* Disabled for 'production' environment.
* @param translations The translations object.
*/
export const raportMissingTranslations = <T>(
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

Function name contains a typo. 'raportMissingTranslations' should be 'reportMissingTranslations'.

Suggested change
export const raportMissingTranslations = <T>(
export const reportMissingTranslations = <T>(

Copilot uses AI. Check for mistakes.
Comment thread src/react/hooks.ts
export const makeTranslations =
<L, P>(LitteraContext: React.Context<LitteraContextValue<L, P>>) =>
<T, K extends keyof T>(translations: LitteraTranslations<T>) => {
raportMissingTranslations(translations)
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

Function call contains a typo. 'raportMissingTranslations' should be 'reportMissingTranslations'.

Suggested change
raportMissingTranslations(translations)
reportMissingTranslations(translations)

Copilot uses AI. Check for mistakes.
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.

3 participants