Suggestion: clean separation between QML and JS

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

Maintainer thường phản hồi trong vòng 1 ngày

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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, javascript
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start by reading how MuseScore extensions connect their QML forms and composites to JavaScript actions; the issue points to the courtesy accidentals extension as an example. Determine whether the framework already supports calling shared JavaScript from QML, then define how that separation should work for future extensions. Done means the issue's proposed capability or existing approach is clearly established.

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

Mô tả

I apologize in advance if this is already possible and I just don't understand understand how it works...

I like the separation of extensions into macros, forms, and composite, and I especially like how this works for macros - the actual code is cleanly separated from the manifest. It would be nice if the QML for the forms and composites were also cleanly separated from the code.

For example, consider the courtesy accidentals extension for MuseScore. The "add" action is associated with a JS file that contains the code to add accidentals - great. But the "configure" action is associated with a QML file that displays the dialog and also reproduces most of the code from the JS file. It would be fantastic to have the JS file contain all the code and allow the QML file to simply call over to it. That would simplify maintenance greatly.

I'm not particularly concerned with this particular extension but with future ones contributed by the community (e.g., me :-) ). Pretty much any composite extension is likely to have a similar issue - the main code common to the form and macro version. But even for an extension that is just a form, it still seems like it would be good practice to separate out the QML for the dialog from the JS for the code. Any given programmer might be more comfortable in one area than the other, and might want to rely on AI tools to help. This sort of separation would facilitate that as well.

Or maybe it's possible already and the courtesy accidentals extension just needs to be refactored to take advantage of this?

Ngôn ngữ chính
C++
Star
14
Fork
79
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
43

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 musescore/muse_framework

Tất cả issue của musescore/muse_framework

Issue tương tự

Thêm issue về C++

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.