WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Yokomi422
Copy link
Contributor

@Yokomi422 Yokomi422 commented Oct 25, 2025

変更内容

  • @codesandbox/sandpack-react を追加
  • raw-loader を使ってサンプルファイルを読み込むように変更
  • 以下のセクションの解答にSandpack実行環境を追加
    • HTML (02-html)
    • CSS (03-css)
    • 変数 (06-variables)
    • 論理値と論理演算子 (07-boolean)
    • if文 (08-if-statement)
    • 関数 (09-functions)
    • ループ (10-loop)
    • 配列 (11-array)
    • オブジェクト (12-object)
    • DOM (13-dom)
    • イベント (14-events)
    • プロジェクト (15-project)

削除したファイル

Sandpack導入に伴い、ViewSource用に存在していた一部のサンプルファイルを削除

@Yokomi422 Yokomi422 marked this pull request as draft October 25, 2025 11:55
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 25, 2025

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9215bc0
Status: ✅  Deploy successful!
Preview URL: https://488042e9.utcode-learn.pages.dev
Branch Preview URL: https://code-sandpack.utcode-learn.pages.dev

View logs

@Yokomi422 Yokomi422 marked this pull request as ready for review November 22, 2025 08:51
Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

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

途中までですが

後は、Pull requestのタイトルと説明欄を書いていただけると、ありがたいです 🙇
Pull requestの大まかな内容と差分だけからではわからない意図などを書いていただけるとレビューがしやすくなり助かります 🥰

Comment on lines 73 to 82
<Sandpack
template="static"
files={{
"/index.html": answerWhileHtml,
"/script.js": answerWhileJs,
}}
options={{
activeFile: "/script.js",
}}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

こちら動いていなさそうです...
macOSでFirefoxとGoogle Chromeで確認したのですが、いずれも表示されていなさそうでした。

Screenshot 2025-11-28 at 23 46 33

Copy link
Contributor Author

Choose a reason for hiding this comment

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

うーむ
これはどうしよう。

SyntaxError: Identifier 'i' has already been declared

となっている。

@Yokomi422 Yokomi422 changed the title code sandbox 演習問題にSandpackによる実行環境を追加 Dec 6, 2025
Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

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

途中ですが、Sandpackを用いて実行環境を追加すること以外の差分が多く含まれているような気がします。たとえば、既存のViewSourceコンポーネントの削除や場所の移動などが挙げられます。一旦、Sandpackを用いて実行環境を追加することのみに絞っても良いかと思います。

"/style.css": yellowHelloCssCss,
}}
options={{
activeFile: "/index.html",
Copy link
Contributor

Choose a reason for hiding this comment

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

これはCSSに関する演習問題なので、CSSファイルをアクティブにする方が良いように思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"/style.css": fooCss,
}}
options={{
activeFile: "/index.html",
Copy link
Contributor

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.

Comment on lines 60 to 61
<ViewSource url={import.meta.url} path="_samples/answer-while" />

Copy link
Contributor

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.

復活しました

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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.

復活しました

Copy link
Contributor

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.

復活しました

@Yokomi422
Copy link
Contributor Author

@chvmvd
Sandpackがある場所はOpenSandboxボタンがあるから、ViewSourceは不要?

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

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

今回の変更に関係のない差分がまだまだありそうです 👀 またそれによって動かなくなっている箇所も散見されます。

GitHubではPull request内で提案された変更Files Changedタブで表示することができるため、その差分をよく確認してすべての差分が適切な差分となっていることを確認すると事故が防げて便利です。今回の場合はこちらから確認できます。
また、GitHubに限らずGitでソースコードを管理している場合はVS Codeを利用して差分を確認することができるため便利です。 cf. https://learn.utcode.net/docs/web-servers/git/#%E5%A4%89%E6%9B%B4%E5%B1%A5%E6%AD%B4%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B

また、動作確認を行うとソフトウェアなどが正常に動作するかを未然に確認でき事故を防げます。ut.code(); LearnのリポジトリではCloudflareの機能を利用してPull requestで提案された内容のプレビューが自動で生成されるようになっています。今回の場合は、こちらから確認できます。また、ドキュメント内のコードについてもCodeSandboxの機能を用いてプレビューを確認できます。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

現状でstyle.cssに分かれていないため、index.htmlstyle.cssに分離した。

}
```

<ViewSource url={import.meta.url} path="_samples/max-no-else" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ut.code(); Learnではどうして、2つとの同じViewSourceなのに2つ置いてあるのか。

@Yokomi422 Yokomi422 requested a review from chvmvd December 28, 2025 11:13
@Yokomi422
Copy link
Contributor Author

@chvmvd
差分も見て

  • ViewSourceが消えている場所はSandpackに変わっている
  • それ以外はViewSourceが消えていない
    を確認したから、今回は大丈夫と思いたい。。。

@Yokomi422
Copy link
Contributor Author

Sandpackもpreviewで確認しました。

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

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

ざっと見たところ、まだ少なくとも最低で2件は不要な差分が混じっていそうです 👀

@Yokomi422
Copy link
Contributor Author

7d017aa
こいつかー

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

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

軽く差分を見た感じ最低でもまだ3件はありますね👀

@Yokomi422
Copy link
Contributor Author

大量のFile renamed without changes.があった!こいつらは見逃していた。

@Yokomi422 Yokomi422 requested a review from chvmvd December 29, 2025 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants