Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Implements the Q1 2026 roadmap items: i18n support, test system enhancement, performance optimization, and documentation upgrade.

@object-ui/i18n — new package

  • i18next-based with I18nProvider, useObjectTranslation hook, createI18n factory
  • 10 built-in locale packs: en, zh, ja, ko, de, fr, es, pt, ru, ar
  • RTL support (isRTL(), getDirection(), auto document.dir updates)
  • Intl-based formatting: formatDate, formatDateTime, formatRelativeTime, formatCurrency, formatNumber
  • 32 tests
import { I18nProvider, useObjectTranslation } from '@object-ui/i18n';

<I18nProvider config={{ defaultLanguage: 'zh' }}>
  <App />
</I18nProvider>

// In components:
const { t, language, changeLanguage, direction } = useObjectTranslation();

Test system enhancement

  • Playwright E2E config (playwright.config.ts) with Chromium/Firefox/WebKit/mobile projects
  • Smoke test suite (e2e/smoke.spec.ts)
  • 56 new core unit tests covering previously untested modules:
    • SchemaBuilder (27) — all 7 builder types
    • SchemaValidator (15) — validate, assert, isValid, formatErrors
    • ExpressionContext (14) — scopes, dot notation, child contexts

Performance utilities

  • createLazyPlugin() enhanced with configurable retry logic and PluginErrorBoundary
  • New preloadPlugin() for anticipatory module loading
const Grid = createLazyPlugin(() => import('@object-ui/plugin-grid'), {
  retries: 3,
  errorFallback: ({ error, retry }) => <button onClick={retry}>Retry</button>,
});

// Preload on hover
<button onMouseEnter={() => preloadPlugin(() => import('@object-ui/plugin-grid'))}>

Documentation

  • 5-minute quick start guide (content/docs/guide/quick-start.md), added as first entry in guide nav

Housekeeping

  • vitest.config.mts: added @object-ui/i18n alias, excluded **/e2e/**
  • .gitignore: added test-results/, playwright-report/
  • ROADMAP.md: checked off completed Q1 items

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 8, 2026 4:06pm
objectui-console Ready Ready Preview, Comment Feb 8, 2026 4:06pm
objectui-storybook Ready Ready Preview, Comment Feb 8, 2026 4:06pm

Request Review

Copilot AI and others added 2 commits February 8, 2026 15:46
…ort, and formatting utilities

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…56 tests)

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI and others added 2 commits February 8, 2026 15:57
…ndaries), quick start guide, and update ROADMAP

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…back

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Q1 2026 roadmap development feat: Q1 2026 Roadmap — i18n package, test infrastructure, perf utilities, quick-start guide Feb 8, 2026
Copilot AI requested a review from hotlong February 8, 2026 16:04
@@ -0,0 +1,228 @@
import { describe, it, expect, beforeEach } from 'vitest';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import beforeEach.

Copilot Autofix

AI 3 days ago

To fix an unused import, you remove just the unused identifier from the import statement, leaving the rest of the imports intact so existing functionality is unchanged. In this case, beforeEach is imported from vitest but never used in the test file, so we should remove beforeEach from the destructuring import.

Concretely, in packages/i18n/src/__tests__/i18n.test.ts, edit the first line so that beforeEach is no longer listed in the imported names. No other lines or imports need to be changed, and no additional methods or definitions are required for this fix.

Suggested changeset 1
packages/i18n/src/__tests__/i18n.test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/i18n/src/__tests__/i18n.test.ts b/packages/i18n/src/__tests__/i18n.test.ts
--- a/packages/i18n/src/__tests__/i18n.test.ts
+++ b/packages/i18n/src/__tests__/i18n.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect, beforeEach } from 'vitest';
+import { describe, it, expect } from 'vitest';
 import {
   createI18n,
   getDirection,
EOF
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { describe, it, expect } from 'vitest';
import {
createI18n,
getDirection,
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +2 to +13
import {
createI18n,
getDirection,
getAvailableLanguages,
builtInLocales,
isRTL,
RTL_LANGUAGES,
formatDate,
formatDateTime,
formatCurrency,
formatNumber,
} from '../index';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import formatDateTime.

Copilot Autofix

AI 3 days ago

To fix an unused import, you simply remove it from the import list while keeping the rest of the imports intact. This eliminates dead code, keeps the test file clean, and avoids confusion about which APIs are actually being exercised.

In this file, the best minimal fix is to delete formatDateTime from the named imports from ../index on lines 2–13. No additional code changes or new functionality are required. Concretely, in packages/i18n/src/__tests__/i18n.test.ts, edit the import block so that formatDateTime is no longer present, leaving all the other imported symbols unchanged. No new methods, imports, or definitions are needed.

Suggested changeset 1
packages/i18n/src/__tests__/i18n.test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/i18n/src/__tests__/i18n.test.ts b/packages/i18n/src/__tests__/i18n.test.ts
--- a/packages/i18n/src/__tests__/i18n.test.ts
+++ b/packages/i18n/src/__tests__/i18n.test.ts
@@ -7,7 +7,6 @@
   isRTL,
   RTL_LANGUAGES,
   formatDate,
-  formatDateTime,
   formatCurrency,
   formatNumber,
 } from '../index';
EOF
@@ -7,7 +7,6 @@
isRTL,
RTL_LANGUAGES,
formatDate,
formatDateTime,
formatCurrency,
formatNumber,
} from '../index';
Copilot is powered by AI and may make mistakes. Always verify output.

it('all locales have the same top-level keys', () => {
const enKeys = Object.keys(builtInLocales.en).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused variable lang.

Copilot Autofix

AI 3 days ago

In general, the way to fix this is to either remove unused variables or replace them with a conventional placeholder (such as _) to indicate they are intentionally unused. For destructuring in for...of loops, you can destructure only the elements you need.

Here, on line 166 in packages/i18n/src/__tests__/i18n.test.ts, the loop:

for (const [lang, locale] of Object.entries(builtInLocales)) {

should be updated to avoid binding lang. The best change without affecting behavior is:

for (const [, locale] of Object.entries(builtInLocales)) {

This keeps the structure of iterating over entries but only binds locale, which is what the body uses. The same pattern appears again later at lines 174–175, so we should make the analogous change there as well to keep the tests consistent and remove both unused lang bindings. No new imports, functions, or other definitions are required.

Suggested changeset 1
packages/i18n/src/__tests__/i18n.test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/i18n/src/__tests__/i18n.test.ts b/packages/i18n/src/__tests__/i18n.test.ts
--- a/packages/i18n/src/__tests__/i18n.test.ts
+++ b/packages/i18n/src/__tests__/i18n.test.ts
@@ -163,7 +163,7 @@
 
     it('all locales have the same top-level keys', () => {
       const enKeys = Object.keys(builtInLocales.en).sort();
-      for (const [lang, locale] of Object.entries(builtInLocales)) {
+      for (const [, locale] of Object.entries(builtInLocales)) {
         const keys = Object.keys(locale).sort();
         expect(keys).toEqual(enKeys);
       }
@@ -171,7 +171,7 @@
 
     it('all locales have common section keys matching English', () => {
       const enCommonKeys = Object.keys(builtInLocales.en.common).sort();
-      for (const [lang, locale] of Object.entries(builtInLocales)) {
+      for (const [, locale] of Object.entries(builtInLocales)) {
         const keys = Object.keys(locale.common).sort();
         expect(keys).toEqual(enCommonKeys);
       }
EOF
@@ -163,7 +163,7 @@

it('all locales have the same top-level keys', () => {
const enKeys = Object.keys(builtInLocales.en).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {
for (const [, locale] of Object.entries(builtInLocales)) {
const keys = Object.keys(locale).sort();
expect(keys).toEqual(enKeys);
}
@@ -171,7 +171,7 @@

it('all locales have common section keys matching English', () => {
const enCommonKeys = Object.keys(builtInLocales.en.common).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {
for (const [, locale] of Object.entries(builtInLocales)) {
const keys = Object.keys(locale.common).sort();
expect(keys).toEqual(enCommonKeys);
}
Copilot is powered by AI and may make mistakes. Always verify output.

it('all locales have common section keys matching English', () => {
const enCommonKeys = Object.keys(builtInLocales.en.common).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused variable lang.

Copilot Autofix

AI 3 days ago

In general, to fix an unused variable reported in a loop destructuring pattern, remove the unused binding while preserving the used one. For this case, the simplest change is to stop destructuring into [lang, locale] and instead iterate over the Object.values of builtInLocales, since only locale is needed.

Specifically, in packages/i18n/src/__tests__/i18n.test.ts around line 172–178, replace:

for (const [lang, locale] of Object.entries(builtInLocales)) {
  const keys = Object.keys(locale.common).sort();
  expect(keys).toEqual(enCommonKeys);
}

with:

for (const locale of Object.values(builtInLocales)) {
  const keys = Object.keys(locale.common).sort();
  expect(keys).toEqual(enCommonKeys);
}

This removes the unused lang variable without altering the logic of the test. No new imports or additional definitions are required.

Suggested changeset 1
packages/i18n/src/__tests__/i18n.test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/i18n/src/__tests__/i18n.test.ts b/packages/i18n/src/__tests__/i18n.test.ts
--- a/packages/i18n/src/__tests__/i18n.test.ts
+++ b/packages/i18n/src/__tests__/i18n.test.ts
@@ -171,7 +171,7 @@
 
     it('all locales have common section keys matching English', () => {
       const enCommonKeys = Object.keys(builtInLocales.en.common).sort();
-      for (const [lang, locale] of Object.entries(builtInLocales)) {
+      for (const locale of Object.values(builtInLocales)) {
         const keys = Object.keys(locale.common).sort();
         expect(keys).toEqual(enCommonKeys);
       }
EOF
@@ -171,7 +171,7 @@

it('all locales have common section keys matching English', () => {
const enCommonKeys = Object.keys(builtInLocales.en.common).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {
for (const locale of Object.values(builtInLocales)) {
const keys = Object.keys(locale.common).sort();
expect(keys).toEqual(enCommonKeys);
}
Copilot is powered by AI and may make mistakes. Always verify output.
@hotlong hotlong marked this pull request as ready for review February 9, 2026 01:09
Copilot AI review requested due to automatic review settings February 9, 2026 01:09
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1808.45KB 425.11KB
core (index.js) 0.70KB 0.31KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 22.92KB 5.60KB
fields (index.js) 87.61KB 17.17KB
i18n (i18n.js) 2.03KB 0.77KB
i18n (index.js) 1.65KB 0.66KB
i18n (provider.js) 2.88KB 0.98KB
layout (index.js) 14.61KB 4.51KB
plugin-aggrid (AddressField-BOOmnmjw.js) 3.05KB 0.76KB
plugin-aggrid (AgGridImpl-C6tmNFRA.js) 5.27KB 1.92KB
plugin-aggrid (AutoNumberField-jwAcEtba.js) 0.28KB 0.27KB
plugin-aggrid (FileField-C4nU7miP.js) 3.50KB 1.34KB
plugin-aggrid (FormulaField-D1GL121M.js) 0.52KB 0.38KB
plugin-aggrid (GeolocationField-C1rZIU8y.js) 4.46KB 1.50KB
plugin-aggrid (GridField-CPgulvWp.js) 1.71KB 0.68KB
plugin-aggrid (LocationField-RR6ofgYb.js) 0.93KB 0.54KB
plugin-aggrid (MasterDetailField-BhnckP0p.js) 3.86KB 1.17KB
plugin-aggrid (ObjectAgGridImpl-B-5mB-ka.js) 919.77KB 203.53KB
plugin-aggrid (ObjectField-B_XsSVG6.js) 1.61KB 0.77KB
plugin-aggrid (QRCodeField-DaUmd72E.js) 3.38KB 1.23KB
plugin-aggrid (RichTextField-kBVmNoQx.js) 1.16KB 0.59KB
plugin-aggrid (SignatureField-C-p3Glla.js) 3.32KB 1.28KB
plugin-aggrid (SummaryField-C_zIAVHC.js) 0.48KB 0.37KB
plugin-aggrid (UserField-DMwir776.js) 2.44KB 0.93KB
plugin-aggrid (VectorField-BTIkrvgu.js) 0.79KB 0.45KB
plugin-aggrid (index-D86IZ-2v.js) 19.21KB 4.90KB
plugin-aggrid (index.js) 0.22KB 0.16KB
plugin-calendar (index.js) 31.63KB 8.05KB
plugin-charts (AdvancedChartImpl-DFmeUY4Q.js) 124.69KB 25.93KB
plugin-charts (BarChart-C_I0OFbj.js) 542.77KB 135.30KB
plugin-charts (ChartImpl-B5LY4On3.js) 3.17KB 1.10KB
plugin-charts (index-DSBO2Kdy.js) 15.18KB 4.46KB
plugin-charts (index.js) 0.19KB 0.16KB
plugin-chatbot (index.js) 1200.27KB 344.58KB
plugin-dashboard (index.js) 179.65KB 44.66KB
plugin-detail (index.js) 1708.01KB 402.97KB
plugin-editor (MonacoImpl-hfdmoz6k.js) 18.15KB 5.59KB
plugin-editor (index-CuYbY6xb.js) 10.10KB 3.32KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-form (index.js) 52.17KB 10.49KB
plugin-gantt (index.js) 159.96KB 37.59KB
plugin-grid (index.js) 45.16KB 12.17KB
plugin-kanban (KanbanEnhanced-DjadKL5D.js) 31.43KB 9.03KB
plugin-kanban (KanbanImpl-BHAT_ney.js) 5.28KB 1.91KB
plugin-kanban (index-BhdljdIe.js) 17.29KB 5.01KB
plugin-kanban (index.js) 0.27KB 0.17KB
plugin-kanban (sortable.esm-ZHwgFQIO.js) 71.42KB 18.98KB
plugin-list (index.js) 1722.35KB 406.47KB
plugin-map (index.js) 126.32KB 30.52KB
plugin-map (maplibre-gl-CNsW26De.js) 1418.32KB 302.53KB
plugin-markdown (MarkdownImpl-DufQ-eRU.js) 256.68KB 64.45KB
plugin-markdown (index-CrmE78vF.js) 9.63KB 3.17KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-report (index.js) 46.62KB 8.81KB
plugin-timeline (index.js) 105.30KB 24.14KB
plugin-view (index.js) 47.44KB 12.12KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 3.28KB 1.30KB
react (index.js) 0.39KB 0.25KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 0.20KB 0.18KB
types (views.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@hotlong hotlong merged commit d40be3d into main Feb 9, 2026
17 of 18 checks passed
Copy link
Contributor

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 implements several Q1 2026 roadmap items across the monorepo: a new @object-ui/i18n package (locale packs + formatting + React provider), Playwright E2E infrastructure, additional unit tests for core modules, and improvements to lazy plugin loading utilities in @object-ui/react, plus associated documentation/config housekeeping.

Changes:

  • Added @object-ui/i18n package with built-in locales, RTL helpers, React provider/hooks, and Intl-based formatting utilities.
  • Introduced Playwright E2E setup (playwright.config.ts, e2e/ smoke test) and updated test tooling config (vitest.config.mts, .gitignore, root scripts).
  • Enhanced createLazyPlugin() with retry/error handling options and added preloadPlugin().

Reviewed changes

Copilot reviewed 30 out of 32 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
vitest.config.mts Excludes e2e/ from Vitest and adds alias for @object-ui/i18n.
pnpm-lock.yaml Locks new dependencies for Playwright + i18n stack.
playwright.config.ts Adds Playwright E2E configuration and dev-server orchestration.
packages/react/src/LazyPluginLoader.tsx Adds retry options, error boundary support, and preloadPlugin().
packages/i18n/tsconfig.json Adds TS build config for the new i18n package.
packages/i18n/src/utils/index.ts Re-exports formatting utilities/types.
packages/i18n/src/utils/formatting.ts Implements Intl-based date/number/currency/relative time formatting helpers.
packages/i18n/src/provider.tsx Adds I18nProvider, useObjectTranslation, and context helpers (incl. document dir/lang updates).
packages/i18n/src/locales/zh.ts Adds Chinese locale pack.
packages/i18n/src/locales/ru.ts Adds Russian locale pack.
packages/i18n/src/locales/pt.ts Adds Portuguese locale pack.
packages/i18n/src/locales/ko.ts Adds Korean locale pack.
packages/i18n/src/locales/ja.ts Adds Japanese locale pack.
packages/i18n/src/locales/index.ts Exports locale packs, RTL language list, and isRTL().
packages/i18n/src/locales/fr.ts Adds French locale pack.
packages/i18n/src/locales/es.ts Adds Spanish locale pack.
packages/i18n/src/locales/en.ts Adds English default locale pack and TranslationKeys type.
packages/i18n/src/locales/de.ts Adds German locale pack.
packages/i18n/src/locales/ar.ts Adds Arabic locale pack.
packages/i18n/src/index.ts Public entrypoint exports for provider, locales, RTL utils, and formatting helpers.
packages/i18n/src/i18n.ts Implements createI18n, direction helpers, resource merging, and language detection.
packages/i18n/src/tests/i18n.test.ts Adds unit tests for i18n initialization, translations, RTL utilities, and formatting.
packages/i18n/package.json Declares new package metadata, scripts, deps/peers, and exports map.
packages/core/src/validation/tests/schema-validator.test.ts Adds tests for schema validation helpers.
packages/core/src/evaluator/tests/ExpressionContext.test.ts Adds tests for ExpressionContext behavior and scope handling.
packages/core/src/builder/tests/schema-builder.test.ts Adds tests for schema builder factory functions and chaining.
package.json Adds Playwright scripts and @playwright/test devDependency.
e2e/smoke.spec.ts Adds basic console app smoke tests.
content/docs/guide/quick-start.md Adds a new “Quick Start” guide page.
content/docs/guide/meta.json Adds quick-start as the first guide nav entry.
ROADMAP.md Checks off completed Q1 items.
.gitignore Ignores Playwright artifacts (test-results, playwright-report).
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +61 to +65
export function formatDateTime(
date: Date | string | number,
options: DateFormatOptions = {},
): string {
const { locale = 'en', style = 'medium' } = options;
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

formatDateTime ignores dateStyle/timeStyle even though they’re part of DateFormatOptions (only formatDate honors them). This makes the options interface misleading and prevents callers from using Intl’s built-in styles for date+time. Consider applying the same dateStyle/timeStyle override logic here as well.

Copilot uses AI. Check for mistakes.
instance.init({
lng,
fallbackLng: fallbackLanguage,
resources: mergedResources,
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

createI18n returns the instance immediately after calling instance.init(...), but init is async in i18next. Consumers may call t() before initialization completes and get missing/incorrect translations. Consider either (1) setting initImmediate: false to make init synchronous for in-memory resources, or (2) making createI18n async and awaiting instance.init() before returning.

Suggested change
resources: mergedResources,
resources: mergedResources,
initImmediate: false,

Copilot uses AI. Check for mistakes.
"msw": "^2.12.7",
"msw-storybook-addon": "^2.0.6",
"@playwright/test": "^1.58.2",
"playwright": "^1.58.0",
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Version ranges for Playwright are mismatched: @playwright/test is ^1.58.2 while playwright is ^1.58.0. This can lead to multiple Playwright versions in the lockfile (and larger installs / inconsistent browser binaries). Consider aligning the versions (or removing the direct playwright dependency if @playwright/test is the intended entrypoint).

Suggested change
"playwright": "^1.58.0",
"playwright": "^1.58.2",

Copilot uses AI. Check for mistakes.
Comment on lines +142 to +146
if (errorFallback) {
return (
<PluginErrorBoundary fallback={errorFallback}>
{content}
</PluginErrorBoundary>
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The retry callback provided to errorFallback only resets the error boundary state, but it doesn’t restart the failed React.lazy() import. After a lazy import rejects, React caches the rejection for that lazy component type, so clicking Retry will keep rendering the same error. Consider recreating the lazy component on retry (e.g., a retry counter that changes the lazy initializer / key) so retry() actually triggers a fresh dynamic import.

Copilot uses AI. Check for mistakes.
Comment on lines +117 to +123
const { locale = 'en', currency = 'USD', minimumFractionDigits, maximumFractionDigits } = options;

return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits,
maximumFractionDigits,
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

CurrencyFormatOptions defines a style option, but formatCurrency always forces style: 'currency' and never reads options.style. Either remove style from the options type or pass it through to Intl.NumberFormat (and only require currency when style is 'currency').

Suggested change
const { locale = 'en', currency = 'USD', minimumFractionDigits, maximumFractionDigits } = options;
return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits,
maximumFractionDigits,
const {
locale = 'en',
style = 'currency',
currency,
minimumFractionDigits,
maximumFractionDigits,
} = options;
const baseOptions: Intl.NumberFormatOptions = {
style,
minimumFractionDigits,
maximumFractionDigits,
};
const currencyOptions: Intl.NumberFormatOptions =
style === 'currency'
? { currency: currency ?? 'USD' }
: {};
return new Intl.NumberFormat(locale, {
...baseOptions,
...currencyOptions,

Copilot uses AI. Check for mistakes.
Comment on lines +127 to +131
const { retries = 2, retryDelay = 1000, errorFallback } = options || {};

const retryImport = retries > 0
? createRetryImport(importFn, retries, retryDelay)
: importFn;
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

New behaviors (retries, retryDelay, errorFallback, and preloadPlugin) aren’t covered by tests in this PR. Since packages/react/src/__tests__/LazyPluginLoader.test.tsx already exists, please add/extend tests to cover: retry attempt count + delay behavior, rendering errorFallback on failure, and that retry() triggers a fresh import attempt.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,228 @@
import { describe, it, expect, beforeEach } from 'vitest';
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Unused import beforeEach.

Suggested change
import { describe, it, expect, beforeEach } from 'vitest';
import { describe, it, expect } from 'vitest';

Copilot uses AI. Check for mistakes.
isRTL,
RTL_LANGUAGES,
formatDate,
formatDateTime,
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Unused import formatDateTime.

Suggested change
formatDateTime,

Copilot uses AI. Check for mistakes.

it('all locales have the same top-level keys', () => {
const enKeys = Object.keys(builtInLocales.en).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Unused variable lang.

Copilot uses AI. Check for mistakes.

it('all locales have common section keys matching English', () => {
const enCommonKeys = Object.keys(builtInLocales.en.common).sort();
for (const [lang, locale] of Object.entries(builtInLocales)) {
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Unused variable lang.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants