UI5 CLI 4.0 specification is incompatible with web workers

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

Maintainer thường phản hồi trong vòng 2 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
build-system, cli

Hướng nghiên cứu

Start by reproducing the failure with a UI5 library containing MyWorker.js and ui5 build, using the reported specVersion 4.0.6 environment. Read the Builder documentation on JavaScript files requiring top-level scope and compare the error with the expected behavior. Done means a web worker script builds successfully under specification 4.0 without loading the UI5 framework in the worker.

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

Mô tả

help provided

For UI5 projects utilizing web workers, the new restriction on "JavaScript Files Requiring Top Level Scope" in specification 4.0 renders the projects incompatible with the UI5 CLI build.

The problem is that a web worker script cannot be wrapped in a sap.ui.require or sap.ui.define function call since it is neither possible nor desirable to load the UI5 framework within a worker. The worker's driver scripts, by definition, run code in the global context, which the new specification prohibits.

Expected Behavior

Build completes successfully as in the previous specification versions.

Current Behavior

Builds fail with error error lbt:bundle:Builder Module {...redacted...}/SomeWorker.js requires top level scope and can only be embedded as a string (requires 'eval'), which is not supported with specVersion 4.0 and higher. For more information, see the UI5 Tooling documentation https://sap.github.io/ui5-tooling/stable/pages/Builder/#javascript-files-requiring-top-level-scope

Steps to Reproduce the Issue

  1. Create a UI5 library
  2. Add a script "MyWorker.js" somewhere in the package tree
  3. Add text console.log("hello worker!") as file contents
  4. Run ui5 build
  5. Note build failure on the MyWorker.js file.

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 4.0.6
  • Node.js Version: 20.11.0
  • npm Version: 10.2.4
  • OS/Platform: MacOS
  • Browser (if relevant): N/A
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

{...}
Ngôn ngữ chính
JavaScript
Star
510
Fork
80
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
12

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 UI5/cli

Tất cả issue của UI5/cli

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.