Skip to content

Performance issue: typing lag in internationalized fields #512

@VitaliyPotapov

Description

@VitaliyPotapov

Describe the bug

I have a document with ~30 i18n fields. Typing into these fields is very slow, characters appear late and the editor feels unresponsive.

To Reproduce

I made a fresh setup of the latest sanity studio and i18n plugin.
Steps to reproduce the behavior:

  1. Install the latest Sanity Studio npm create sanity@latest

  2. Install the latest sanity-plugin-internationalized-array

  3. Configure sanity plugin:

    // sanity.config.ts
    plugins: [
     structureTool(),
     visionTool(),
     internationalizedArray({
       languages: [
         {id: 'en', title: 'English'},
         {id: 'fr', title: 'French'},
       ],
       defaultLanguages: ['en'],
       fieldTypes: ['string'],
     }),
    ], 
  4. Create a document schema with 30 internationalized fields:

     import {defineField} from 'sanity'
     
     export default {
       name: 'person',
       title: 'Person',
       type: 'document',
       fields: [
         ...new Array(30).fill(null).map((_, i) =>
           defineField({
             name: 'field_' + i,
             type: 'internationalizedArrayString',
           }),
         ),
       ],
     }
  5. Build and start studio: npm run build && npm start

  6. Open studio and start typing into field

Expected behavior

No lag while typing.

Videos

Behavior with 1 i18n field (works fine)
Screen.Recording.2025-10-14.at.16.32.06.mov
Behavior with 30 i18n field (I'm typing smoothly as before)
Screen.Recording.2025-10-14.at.16.17.42.mov

Devtools performance screenshot

I made a performance recording via devtools, it show long tasks ~0.5-1 second while typing:

Image

Additional context

Which versions of Sanity are you using?

$ sanity versions
@sanity/cli (global)          4.10.3 (up to date)
@sanity/eslint-config-studio   5.0.2 (up to date)
@sanity/vision                4.10.3 (up to date)
sanity                        4.10.3 (up to date)

What operating system are you using?**

OSX.

Which versions of Node.js / npm are you running?**

$ npm -v && node -v
11.5.2
v22.13.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions