Serialization API
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
lib/node.js の 141-355 行付近から始め、提案されている AST 表現とカバレッジを理解するために test/spec/serialize.js と test/spec/deserialize.js を読んでください。完了とは、シリアライズ、デシリアライズ、public accessors、custom node data に関する Node API の要件が解決され、参照されている deep-equality の動作が維持されていることです。
索引モデルが issue の本文から書いたものです。
説明
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 ;)
- 主要言語
- JavaScript
- スター
- 1.6k
- フォーク
- 231
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
commonmark/commonmark.js のほかの issue
-
White space handling looks inconsistent between HTML block element vs HTML inline element対応中かも @mamicicekel が 3 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
commonmark/commonmark.js#303 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
commonmark/commonmark.js#298 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
commonmark/commonmark.js#287 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
commonmark/commonmark.js#275 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
commonmark/commonmark.js#267 · コメント 3 件 ·
commonmark/commonmark.js の issue をすべて見る
似ている issue
-
[BUG] Multi-day events show "Ended" while still in progress対応中かも @tarunagnihotri534 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
data-umbrella/du-event-board#231 · コメント 2 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
NaturalIntelligence/fast-xml-parser#888 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
USACE/chart-docs#766 ·
-
bug callouts regression revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
quarto-dev/quarto-cli#15014 ·
メンテナーはふだん 1 日以内に返信