popcodeorg / popcodeorg/popcode
Preload next iframe to use for preview
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 191
- Fork
- 143
- Merge trung bình
- 4 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 5
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi vòng đời iframe hiện có, cách sử dụng compiledProjectKey và trạng thái Redux liên quan đến việc biên dịch project. Xem lại preview.html và hành vi được mô tả trong #2107. Được xem là hoàn tất khi một preview frame mới được tải trước khi biên dịch, sau đó được tái sử dụng khi project đã biên dịch sẵn sàng mà không làm gián đoạn hành vi chuyển tiếp hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- frontend, web-dev
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100