Multi-file support RFC
Maintainer thường phản hồi trong vòng 1 ngà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
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
Hướng nghiên cứu
Không có tệp triển khai hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách đọc đối tượng cấu hình và tài liệu về import, export và deploy được liên kết trong đề xuất, sau đó lần theo các entry point hiện có của trình chỉnh sửa và quá trình biên dịch. Để hoàn tất sẽ cần triển khai đồng bộ cấu hình tệp, hành vi biên dịch, UI và các tính năng xử lý tệp bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
LiveCodes does not currently support a file system. The (compiled) code from the 3 editors (markup, style & script) are combined into a single web page that can be displayed in the UI, exported, deployed, broadcasted, etc.
In this sense, LiveCodes is similiar to CodePen, JsBin and JS Fiddle, as opposed to others like Codesandbox and Stackblitz which offer a file system and a whole virtual nodejs environment to support it.
This is an early proposal to simulate multi-file support. This is mainly inspired by the official Svelte and Vue playgrounds and an attempt to implement that for the official Ripple playground which is powered by LiveCodes.
Overall plan:
- There is no plan to implement a full virtual file system or introduce a new build system (e.g. rollup/rolldown)
- The multi-file support is planned using importmaps + data URLs, which are already being heavily used in LiveCodes.
The 3 basic editors (markup, style & script) will stay the same and will serve as entrypoints. One or more editor can be hidden using theWhen the config object has ahideTitleproperty.filesproperty, themarkup,styleandscriptproperties are ignored.- Additional files can be added. The file extension determines file type and used compiler.
- File names can have slashes to simulate directory structure (e.g.
components/MyComponent.ripple) - Additional files have to be imported (or added as scripts or stylesheets) from the main entry file (specified using
mainFileproperty and defaults toindex.html) - Script files (e.g. js, ts, jsx, tsx, vue, svelte, ripple, etc) are compiled to js and made available using importmaps.
- Style files (e.g. css, scss, style, etc) are compiled to css and inlined in the css code that imports them.
- Additional markup files (apart from the
mainFile) are not allowed (maybe we can later implement imports for the supported template engines (e.g. pug, mustache, etc) - There is no plan for multi-page apps (multiple HTML files that can be linked)
- Importing JSON makes it available as a JS object.
- Non-JS imports are not allowed (e.g. PHP, C++, Python, etc.). Maybe we can later figure out how to do that for each language (not in the scope of this proposal)
- The UI will allow adding files by a button on the side of the editor tabs. Double-click on the file name allows editing it. A delete button on the tab allows deleting the file. If the tabs are wider than the available space they should scroll horizontally.
- A new
filesproperty will be added to the configuration object to persist state and to allow it to be set from the SDK. It will have this typeArray<{ filename: string; content: string; }>. A newA newallowAddingFilesproperty enables/disables adding files from the UIlockFilesproperty disables adding files from the UI. It will be set tofalseby default.The ability to add new files will be supported in embedded playgrounds first, then we can look into adding it to the UI of the standalone playground app.Adding files in the UI are supported in standalone and embedded playgrounds.- There is no plan to support config files like
package.json,tsconfig.json,.editorconfig, etc. Many of these settings can already be achieved by LiveCodes configuration object. - There is no plan to implement a file tree viewer.
Notes:
- In addition to handling compilation, other features that handle files need to be updated (e.g. import, export and deploy)
Comments and suggestions are welcome.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.5k
- Fork
- 267
- Merge trung bình
- 7 giờ 47 phút
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
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.
Issue khác của live-codes/livecodes
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
live-codes/livecodes#1079 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
live-codes/livecodes#1060 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
live-codes/livecodes#1009 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Release a docker imageĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
live-codes/livecodes#1004 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
I18n: HungarianĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
live-codes/livecodes#980 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của live-codes/livecodes
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
pending close triaging
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
anomalyco/opencode#62582 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
callstack/react-native-paper#5189 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: ESP 2 ROĐang mởapproved check:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày