Wanted: validated-publication

Đang mở
#51 3 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu bằng việc xem xét các lợi ích của validated-method được liên kết trong issue và các mẫu publication và subscription được mô tả. Đề xuất không nêu tên tệp hoặc test nào; trước tiên, việc triển khai sẽ cần thống nhất về phạm vi và một API cho validation, tái sử dụng query, dữ liệu reactive được lấy về và các publication tổng hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
193
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của meteor/validated-method

Tất cả issue của meteor/validated-method

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.