Serialization API
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
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
Hướng nghiên cứu
Bắt đầu với lib/node.js quanh các dòng 141-355 và đọc test/spec/serialize.js cùng test/spec/deserialize.js để hiểu biểu diễn AST được đề xuất và phạm vi bao phủ. Được xem là hoàn tất khi các yêu cầu của Node API đối với việc tuần tự hóa, giải tuần tự hóa, các accessor công khai và dữ liệu node tùy chỉnh đã được giải quyết, đồng thời vẫn giữ nguyên hành vi deep-equality được tham chiếu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am now serializing and deserializing the AST with a 1:1 exact match such that it could be converted to a JSON document and back to an AST tree.
The rationale for this functionality is that I want to pipe an AST document between processes and felt that parsing documents on the way in and rendering on the way out was too much overhead.
The implementation is two static methods Node.serialize() and Node.deserialize(), I would like it if possible to add these methods to the commonmark Node class.
The code is here:
https://github.com/mkdoc/mkast/blob/aa0fa3c5bf4ca45e8c961ad14640543da60ec529/lib/node.js#L141-L355
The test specs serialize and deserialize have 100% coverage on those methods. Notably the deserialize spec ensures a 1:1 correlation with a deep equals comparison.
Note that we don't expose private properties in the serialized object so that iteration can consistently reference firstChild and next regardless of whether it is a full AST node (with parent references) or a detached serialized object.
During this process a few requests regarding public property access have arisen, could I please expose _lastLineBlank and _htmlBlockType with public getters?
Also at times I need to associate custom data with AST nodes and this has been a bit ad-hoc so far, hence the additional properties file etc. that I would like to tuck away in an object that commonmark Node supports, maybe userData or data?
If we can formalize a way to add custom data to nodes then I can update the serialize and deserialize methods to use that and it could be folded in to commonmark Node.
Thanks for all your help and patience - especially with those questions that deserved a RTFM response ;)
- Ngôn ngữ chính
- JavaScript
- Star
- 1.6k
- Fork
- 231
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commonmark/commonmark.js
-
White space handling looks inconsistent between HTML block element vs HTML inline elementCó thể đã có người làm @mamicicekel đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
commonmark/commonmark.js#303 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
commonmark/commonmark.js#298 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
commonmark/commonmark.js#287 · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
commonmark/commonmark.js#275 ·
-
Delegate node walking to othersĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
commonmark/commonmark.js#267 · 3 bình luận ·
Tất cả issue của commonmark/commonmark.js
Issue tương tự
-
`yarn vitest:update` (documented) throws locally; local Cypress scripts target an unserved portĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
rescript-lang/rescript-lang.org#1415 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Deepak3699/Ai_Mentor#244 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
antithesishq/bombadil#361 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ungroomed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dequelabs/axe-core#5455 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
DietrichGebert/ponytail#1072 ·
Maintainer thường phản hồi trong vòng 3 ngày