InputMenu, SelectMenu, CommandPalette, Listbox: load the virtualizer only when `virtualize` is set

Abierto
#7,369 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
65/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start by reading InputMenu.vue, then inspect how SelectMenu.vue, CommandPalette.vue, and Listbox.vue import and render Reka UI virtualizer components. Check the build output to confirm the virtualizer and TanStack Virtual are split into a separately requested chunk when virtualize is enabled. Done means apps without virtualize no longer preload that chunk, while virtualized menus still work.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

triage
Package

v4.x

Environment
  • @nuxt/ui: 4.12.0
  • reka-ui: 2.11.0
  • @tanstack/vue-virtual: 3.13.51
  • @tanstack/virtual-core: 3.19.10
  • Nuxt 4.6.4, Vite 8 (rolldown)
Description

InputMenu.vue imports ComboboxVirtualizer and AutocompleteVirtualizer from reka-ui statically. It renders them only when virtualize is set:

<template v-if="!!props.virtualize">
  <Component.Virtualizer …>

Because the import is static, every app that uses UInputMenu ships reka-ui's ListboxVirtualizer, together with @tanstack/vue-virtual and @tanstack/virtual-core, even when it never virtualizes. SelectMenu.vue, CommandPalette.vue and Listbox.vue follow the same pattern.

In our app, a search bar built on UInputMenu is present on every page, without virtualize:

  • The chunk that holds the virtualizer weighs about 15 KB brotli, of which @tanstack/virtual-core accounts for about 9.5 KB.
  • It is preloaded (modulepreload) on every page.
  • Coverage shows only 13 % of it executed at load, which is module initialization only.
Suggested change

Load the virtualizer components only when virtualize is set, so that bundlers put them, and TanStack Virtual, in a chunk of their own that is requested on demand.

Workaround

None that is clean on the app side: aliasing reka-ui's virtualizer to a stub would break with each update.

Additional context

No response

Lenguaje dominante
TypeScript
Estrellas
7.1k
Forks
1.2k
Merge medio
1 d 2 h
PR fusionados (30 d)
147

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nuxt/ui

Todos los issues de nuxt/ui

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.