Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Improving `Largest Contentful Paint` time?

Aperta
#673 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
next.js, react, typescript

Direzione di ricerca

Inizia con l'uso di CodeMirror mostrato nell'issue e profila il suo impatto su Largest Contentful Paint nella configurazione Next.js e Vercel segnalata. Confronta il comportamento di caricamento e rendering dell'editor con la misurazione LCP della pagina; il lavoro è completato quando vengono identificati una causa riproducibile e un miglioramento chiaramente validato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi there, I'm using this library for https://www.timecomplexity.ai, and it's working nicely, so thank you for that!

One issue I'm seeing though is that the Largest Contentful Paint time is quite high because of this library:

Screenshot 2024-07-14 at 3 22 05 PM

Curious if you have any suggestions on how to improve this? I'm using it in a next.js site hosted on Vercel like this:

import CodeMirror from '@uiw/react-codemirror'
import {go} from '@codemirror/legacy-modes/mode/go'
import {xcodeDarkInit} from '@uiw/codemirror-theme-xcode'

export default function Analysis() {
  return (
      <CodeMirror
            value={inputCode}
            placeholder={'Use AI to analyze your code\'s runtime complexity.\nWorks across languages and without requiring headers, imports, or a main statement - just the code itself.\nPlease note that results may be incorrect in subtle (or not so subtle) ways, so use at your own risk!'}
            autoFocus
            editable={!loading}
            minHeight="300px"
            extensions={[
              StreamLanguage.define(go),
              EditorView.lineWrapping
            ]}
            theme={xcodeDarkInit({
              settings: {
                fontFamily: inputCode.length === 0 ? 'var(--font-inter)' : ''
              }
            })}
            onChange={(value: any) => {
              if (value.length > MAX_CODE_LENGTH) {
                setErrorMessage(`Please enter code less than ${MAX_CODE_LENGTH} characters. You are currently at ${value.length} characters.`)
              } else if (typeof errorMessage !== 'string' || typeof errorMessage === 'string' && errorMessage.length !== 0) {
                setErrorMessage('')
              }
              setInputCode(value)
            }}
          />
    )
 }
Lingua principale
TypeScript
Stelle
2.3k
Fork
162
Merge medio
2h 41m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uiwjs/react-codemirror

Tutte le issue di uiwjs/react-codemirror

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.