Add new Partials mode - upsert
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- deno, typescript
- Ambito
- frontend
Direzione di ricerca
Start by reading the partial update implementation and the existing replace, append, and prepend modes; the issue does not name specific files or tests. Decide whether keyed child replacement belongs in a new upsert mode or in the existing modes, then define tests for matching and unmatched keys. Done means the chosen behavior is implemented and verified, but the issue gives no test entry point.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I propose adding an additional mode for partials to complement replace, append, and prepend. At this stage I have called it upsert.
Associated pull request- #2834
It functions similar to append, however each direct child node in the Partial update with a ‘key’ prop is compared to the direct children of the corresponding Partial already in the document. If a match is found, it will swap out that element, otherwise it will append the new node to the existing content.
I believe this has several use cases, the simplest I can think would be a todo list, where individual todo items can be sent to the client to populate a list, or update as they are modified, without using islands or any additional client side JavaScript. Another example, which is my specific use case, is that I need to update a list of recent chats in a messaging app as new messages arrive. Rather than send another copy of the entire list on each update, I can send just the individual item, which would feature an unread message badge. My current work around is using global state to maintain an array of the DOM nodes, and sending that list to the server with every request, in order to determine whether a message is coming from someone already in the recent list or not, so I don’t end up with duplicates.
If adding this additional mode is considered adding unnecessary complexity, then an alternative solution might be that both append and prepend would automatically substitute child nodes if a matching key is detected. Preact warns about having duplicate keys in component children already, but Fresh will currently not check this.
I am happy to take on feedback, both for this feature, as well as the correct etiquette for contributing. I am a solo web developer with absolutely no experience collaborating on projects.
- Lingua principale
- TypeScript
- Stelle
- 13.8k
- Fork
- 757
- Merge medio
- 3m
- PR unite (30g)
- 2
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di freshframework/fresh
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
freshframework/fresh#3920 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
freshframework/fresh#3833 ·
-
feat
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
freshframework/fresh#3803 · 1 commento ·
-
Did you stop maintaining it?Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
freshframework/fresh#3918 · 1 commento · 4 reazioni ·
-
Tab title doesn't update to <Head> <title> when navigating to a page with another <title>Forse già presa @1AbdullahButt l’ha presa 8 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
freshframework/fresh#3916 ·
Tutte le issue di freshframework/fresh
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
software-mansion/argent#1946 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
podman-desktop/podman-desktop#20216 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
WordPress/ai#1386 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
omdsh-dev/DSH-better-sidebar#1205 ·
I maintainer di solito rispondono entro 3 giorni