UI5 CLI 4.0 specification is incompatible with web workers
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- build-system, cli
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Create a UI5 library
- Add a script "MyWorker.js" somewhere in the package tree
- Add text
console.log("hello worker!")as file contents - Run ui5 build
- Note build failure on the MyWorker.js file.
Context
- UI5 Module Version (output of
ui5 --versionwhen 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
{...}
- Dominant language
- JavaScript
- Stars
- 510
- Forks
- 80
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UI5/cli
-
Build cache: buildThemes cache is invalidated by irrelevant library.js / .library content changesOpenmodule/ui5-builder module/ui5-fs module/ui5-project
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
module/ui5-project
Difficulty 4/5 3-5 days Newbie friendliness 64/100
Maintainers usually reply within 2 days
-
[ROADMAP] UI5 CLI 6.0 / Specification Version 6.0May be free again @flovogt claimed this 116 days ago, and no pull request is open. Openroadmap
UI5/cli#1485 · 1 reaction · 1 assignee ·
Maintainers usually reply within 2 days
-
build excludes from application project are not applied to dependenciesMay be free again @flovogt claimed this 90 days ago, and no pull request is open. Open
UI5/cli#1446 · 3 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Maintainers usually reply within 2 days
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
laaielichter/AgentHaven#294 ·
Maintainers usually reply within 1 day
-
documentation P3 tests
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
cafebugado/backendeventos-public-api#128 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/OpenSearch-Dashboards#13289 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
erkamyaman/rea-games#246 ·
Maintainers usually reply within 1 day