Wanted: validated-publication

Offen
#51 3 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
20/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
javascript
Bereich
api, backend

Rechercherichtung

Beginne damit, die im Issue verlinkten Vorteile von validated-method sowie die beschriebenen Muster für Publikationen und Subscriptions zu überprüfen. Der Vorschlag nennt keine Dateien oder Tests; für die Umsetzung müsste zunächst der Umfang und eine API für Validierung, die Wiederverwendung von Queries, abgerufene reaktive Daten und zusammengesetzte Publikationen vereinbart werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Doesn't really belong on this project but not sure where else to put it.

But it would be nice to accomplish something that has a similar list benefits that validate method has:

  • Have an object that represents your publication. Refer to it through JavaScript scope rather than by a magic string name.

  • Built-in validation of arguments through aldeed:simple-schema, or roll your own argument validation.

  • Provide access to the same query that will be used inside the publication. Because of reasons described here I often times find myself copying and pasting a lot of the database queries.

  • Or even better than the above be able to do a single call that returns the subscription handler like before, but also, an already fetched list of the documents found. And have it be reactive. Ideally I could write in a ReactMeteorData container something like the following:

    export default createContainer(() => {
    const { handle, data } = publicationObject.subscribeAndFetch();
    return {
      loading: !handle.ready(),
      data: data,
    }
    }, 
    

When it comes down to it I feel like I copy the same pattern pretty often: subscribe, pass along the handle.ready() info, do the same query on the collection as happened in the publication, and pass along that data.

And oh yeah, obviously be able to handle compsite publications.

Would this be bad form to have something like this? It seems like it would be a great nice to have, just like validated-method is wonderful.

Vorherrschende Sprache
JavaScript
Sterne
193
Forks
30
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus meteor/validated-method

Alle Issues in meteor/validated-method

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.