ampproject / ampproject/amp-react-prototype

Children attribute mutations

オープン
#53 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
TBD
主要言語
JavaScript
スター
36
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

説明

Most of composite elements would want to know their children, which can be easily monitored using mutation observer:

```
mutationObserver.observe(this.element, {childList: true});
```

This works well when the component does not differentiate the types of children. E.g. "all children are carousel's slides". When children have different designations we can use attributes to assign them different roles. For instance, a customized "next" button in the carousel can be marked up as ``. If these attributes can change after the initialization, we may need to observe each child for attribute changes as well. E.g.

```
mutationObserver.observe(child, {attributes: true, attributesFilter: ...});
```

The goal is to avoid this as much as possible given the additional performance and code management cost.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

この issue ではファイル、テスト、エントリーポイントが指定されていません。レポートにある composite-element と MutationObserver の例から始めてください。完了とするには、不要な監視を行わずに子要素の属性変更を処理するための、決定済みで実行可能なスコープが必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。