popcodeorg / popcodeorg/popcode
Preload next iframe to use for preview
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 191
- フォーク
- 143
- 平均マージ
- 4日 11時間
- マージ済み PR(30日)
- 5
説明
Each time the current project changes, we load up a new project in a fresh iframe. We also keep the previous iteration of the preview frame in the DOM until the new one is fully ready, to ensure the smoothest possible transition.
However, with #2107, loading the next frame is a bit heavier weight, because it loads an actual HTML page with a JavaScript bundle attached. While all the loaded content is static and should be thoroughly cached, the browser still needs to parse everything every time. So, let’s proactively load a fresh iframe with preview.html before we are ready to put a compiled project in it.
One wrinkle here is that the collection of frames we are showing currently is keyed on compiledProjectKey, which is only generated when we start to compile an iteration of the current project. However we want to render this preloaded frame in advance of any compilation starting. Having given it only a little thought, I think the move is probably to shift our semantics a little bit and rename compiledProjectKey to previewFrameKey (if I’m not mistaken this fits all current usage of that property); and then add a nextPreviewFrameKey to Redux state, which is “popped” off each time we initiate project compilation, and replaced with a freshly-generated one.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、既存の iframe のライフサイクル、compiledProjectKey の使用方法、プロジェクトのコンパイルに関する Redux の状態を追跡します。preview.html と #2107 で説明されている動作を確認してください。コンパイル前に新しい preview frame が読み込まれ、コンパイル済みプロジェクトの準備ができた時点で既存の遷移動作を妨げることなく再利用されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- frontend, web-dev
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100