Skip to content

Translate react-dom #45

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Feb 6, 2019
Merged

Conversation

gotchane
Copy link
Contributor

@gotchane gotchane commented Feb 2, 2019

This PR is a part of #4.

Translation: https://reactjs.org/docs/react-dom.html

Please review 🙏

@smikitky smikitky self-requested a review February 2, 2019 09:04
Copy link
Contributor

@sasurau4 sasurau4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます 👍
ほとんど、スタイルに関する指摘です。修正よろしくお願いします。

@tesseralis tesseralis mentioned this pull request Feb 2, 2019
90 tasks
@gotchane
Copy link
Contributor Author

gotchane commented Feb 3, 2019

@sasurau4 @smikitky

ご確認ありがとうございます!
レビューいただいた点修正しました!

@sasurau4
Copy link
Contributor

sasurau4 commented Feb 3, 2019

LGTM 🚀
お疲れ様です! 👍
@smikitky さんのレビューも入ると思うのでお待ちを 🙏

@koba04 koba04 requested review from koba04 and removed request for koba04 February 4, 2019 01:15
@gotchane
Copy link
Contributor Author

gotchane commented Feb 5, 2019

見返して気づいた修正点を少し修正しました。
引き続きレビューお待ちしております 🙇

Copy link
Member

@koba04 koba04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gotchane レビューしましたので確認お願いします 🙇
hydrateについては、「クライアントと合わせる」という訳から「クライアントで再利用する」に変えましたが、これについては他の方の意見も聞きたいです。

Co-Authored-By: gotchane <20318418+gotchane@users.noreply.github.com>
@gotchane
Copy link
Contributor Author

gotchane commented Feb 6, 2019

@koba04
Suggestion ありがとうございます!反映しました。
「クライアントで再利用する」という表現、僕は良いと思いました!

Copy link
Member

@smikitky smikitky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認をお願いします。

hydrate は直訳すると「水分を与える」(水素 hydrogen と同じ語源)ですが、要するに「入れ物(コンテナdiv)に中身を注ぐ」、もっと端的に言うとSSRにおいては単にコンテナに(HTMLに変換される)コンテンツを書き込むことだと思います。hydrate 自体に「再利用する」という意味はありません。しかも SSR 特有の単語かと思いきや、クライアント側のコードの render に対してまで hydrate を使っている文が2か所あり(これは原文が不親切)、その場合は「(初回)レンダー」と換言しても問題ないと思います。

>
> Using `ReactDOM.render()` to hydrate a server-rendered container is deprecated and will be removed in React 17. Use [`hydrate()`](#hydrate) instead.
> サーバで描画されたコンテナをクライアントで再利用するために `ReactDOM.render()` を使用することは非推奨となり、React 17 では削除されます。代わりに [`hydrate()`](#hydrate) を使用してください。
Copy link
Member

@smikitky smikitky Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> サーバで描画されたコンテナをクライアントで再利用するために `ReactDOM.render()` を使用することは非推奨となり、React 17 では削除されます。代わりに [`hydrate()`](#hydrate) を使用してください。
> サーバで描画されたコンテナにコンテンツを書き込むために `ReactDOM.render()` を使用することは非推奨となり、React 17 では削除されます。代わりに [`hydrate()`](#hydrate) を使用してください。

原文に近づけたつもりですが、これはどちらでもいいです

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

挙動をイメージしやすいように実際の挙動からこの訳を出しましたが、指摘の通り原文の単語にこの意味はないので、どちらを取るかですね。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらは挙動のイメージのしやすさを踏まえ、「再利用する」のままにしますね。

@@ -62,15 +62,15 @@ If the optional callback is provided, it will be executed after the component is
ReactDOM.hydrate(element, container[, callback])
```

Same as [`render()`](#render), but is used to hydrate a container whose HTML contents were rendered by [`ReactDOMServer`](/docs/react-dom-server.html). React will attempt to attach event listeners to the existing markup.
[`render()`](#render) と同様ですが、[`ReactDOMServer`](/docs/react-dom-server.html) により HTML コンテンツが描画されたコンテナをクライアントで再利用するために使用されます。React は既存のマークアップにイベントリスナをアタッチしようとします。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`render()`](#render) と同様ですが、[`ReactDOMServer`](/docs/react-dom-server.html) により HTML コンテンツが描画されたコンテナをクライアントで再利用するために使用されます。React は既存のマークアップにイベントリスナをアタッチしようとします。
[`render()`](#render) と同様ですが、[`ReactDOMServer`](/docs/react-dom-server.html) によって HTML コンテンツが描画されるコンテナに書き込むために使用されます。React は既存のマークアップにイベントリスナをアタッチしようとします。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「書き込む」だと、ReactDOM.hydrate()のタイミングで何かDOM更新するように受け取られるのではと感じたのですが如何でしょう?
原文かつ挙動にあった言葉が思い浮かばないですが...。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません SSR は殆ど素人なので実際の挙動に合っているようでしたら元の文で大丈夫です

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「注入する」「賦活する」あたりの言葉も浮かびましたがどうせ意味不明になりそう…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらも同様、「再利用する」のままにします!

@koba04
Copy link
Member

koba04 commented Feb 6, 2019

hydrateについては、SSRで構築されたDOMに「動きを与える」(React Elementを構築してイベントリストを設定するなど)と理解しています。
確かにこの文章だと、その行為そのもの(再利用と表現した部分)と、hydrateを含んだrenderを指しているものがありますね。

@smikitky
Copy link
Member

smikitky commented Feb 6, 2019

なるほど、hydrate とは render の一部なんですね…とりあえずクライアントの render を指している部分についての修正ができていれば、SSR側については分かりやすく訳せていれば大丈夫だと思います。

Co-Authored-By: gotchane <20318418+gotchane@users.noreply.github.com>
@gotchane
Copy link
Contributor Author

gotchane commented Feb 6, 2019

@smikitky @koba04
レビュー・コメントありがとうございました!
単語の意味の確認通して、React の挙動についてとても勉強になりました。

議論を踏まえ、SSR の部分のみ「再利用する」のままにし、残りのご指摘を反映しました。
再度ご確認いただけるとありがたいです 🙏

@koba04 koba04 merged commit 0caf551 into reactjs:master Feb 6, 2019
@koba04
Copy link
Member

koba04 commented Feb 6, 2019

@gotchane mergeしました 🚀 ありがとうございます 👏👏👏

@gotchane gotchane deleted the translate/reference-react-dom branch February 7, 2019 00:10
@gotchane
Copy link
Contributor Author

gotchane commented Feb 7, 2019

ありがとうございました 🚀 🚀 🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants