Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add a browser/PWA version

Đang mở
#894 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, wasm
Lĩnh vực
desktop-dev, web-dev

Hướng nghiên cứu

Bắt đầu bằng cách so sánh hai cách tiếp cận được đề xuất, Broadway và Greenfield, đồng thời đọc tài liệu về Greenfield SDK và mục tương ứng trong example-applications.json. Xác định phạm vi và các yêu cầu hosting cho một playground Workbench chạy trên trình duyệt; được xem là hoàn tất khi đã thống nhất được hướng triển khai, thay vì chỉ có một thử nghiệm phía máy chủ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Many other prototyping tools for UI frameworks have the option to run in the browser to make it easier to share examples or work without setting up a local development environment, even if the target primarily native platforms:

It would be great if it were possible to create a similar web-based playground for Workbench, whether for docs or examples, or just for experimental. There are two ways of achieving this with different complexities:

  • Using Broadway. This way, an instance of Workbench can run on a server somewhere, and be exposed via the HTML/Canvas GTK renderer. This works well for simple examples, but more advanced usecases (OpenGL, embedding, Webviews, Videos etc.) don't work.
  • Using Greenfield. This is a full Wayland compositor that runs in your browser, and can already run the Flatpak version of Workbench out of the box. It can either run apps with Wayland clients attaching natively on the browser site (through WebAssembly), or on the server side (with the raw Flatpak version). From my testing, this works extremely well; even the GTK inspector, video playback, webviews, and OpenGL all work. Also runs in Chrome, Firefox and Safari/GNOME Web without problems.

Here is Workbench, rendering a WebKit webview, running in the browser with the second method:

Screenshot of Workbench running in Chrome

Which was as simple as setting up a new app in Greenfield's example-applications.json:

"/workbench": {
    "name": "Workbench",
    "executable": "flatpak",
    "args": ["run", "re.sonny.Workbench"],
    "env": {}
  },

Ofc, this would require a server (not just a CDN) to actually host the app similarly to how Broadway would require a server. A better way would be to compile Workbench using the Greenfield SDK, which would mean that it could run natively in the browser using Wasm, but I'm fairly certain that this would require some porting work. The Greenfield talk from FOSDEM 2024 contains a lot of interesting info on how this works internally.

Ngôn ngữ chính
JavaScript
Star
846
Fork
91
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của workbenchdev/Workbench

Tất cả issue của workbenchdev/Workbench

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.