host bindings: empty `[]` / `()` keys accepted, and `aria-*` host bindings stay DOM properties

Đang mở
#704 0 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
56/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
angular, rust
Lĩnh vực
compilers

Hướng nghiên cứu

Start by reading binding_specialization.rs, especially is_aria_attribute and specialize_bindings_for_host, then trace where host binding keys are parsed and validated. Reproduce the empty [] and () cases and the host aria-* cases against the issue’s ngtsc examples. Done when empty keys produce missing-name errors and host aria-* bindings compile as attributes.

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

Mô tả

Found while reviewing #697. Checked against ngtsc 22.2.4.

1. Empty [] / () host keys are accepted

@Directive({ selector: '[d]', host: { '[]': 'a', '()': 'b()' } })
ngtsc   error NG5001: Property name is missing in binding / Event name is missing in binding
Oxc     no error; emits ɵɵlistener("", …) and ɵɵdomProperty("", ctx.a)

2. Host aria-* bindings stay DOM properties

@Directive({ selector: '[d]', host: { '[aria-label]': 'l' } })
export class D { l = 'a'; @HostBinding('aria-hidden') h = true; }
ngtsc   ɵɵattribute("aria-label", ctx.l)("aria-hidden", ctx.h)
Oxc     ɵɵdomProperty("aria-label", ctx.l)("aria-hidden", ctx.h)

binding_specialization.rs rewrites aria-* to an attribute only for templates (is_aria_attribute), not in specialize_bindings_for_host.

Ngôn ngữ chính
Rust
Star
245
Fork
26
Merge trung bình
1 ngày 23 phút
Pull request đã merge (30 ngày)
83

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 voidzero-dev/oxc-angular-compiler

Tất cả issue của voidzero-dev/oxc-angular-compiler

Issue tương tự

Thêm issue về Rust

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.