Skip to content

[FEATURE] bundle/Builder: Support async require sections and conditional core boot - #1020

Merged
flovogt merged 1 commit into
mainfrom
bundle-async-require-section-cond-boot
Jun 12, 2024
Merged

flovogt merged 1 commit into
mainfrom
bundle-async-require-section-cond-boot

Conversation

@RandomByte

@RandomByte RandomByte commented May 17, 2024

Copy link
Copy Markdown
Member

The builder is able to create bundles not containing "sap.ui.requireSync" calls, so that the bundles can be used also within UI5 Version 2 and later, where this internal API is not available anymore.

JIRA: CPOUI5FOUNDATION-789

@RandomByte RandomByte changed the title [FEATURE] bundle/Builder: Support async require sections [FEATURE] bundle/Builder: Support async require sections and conditional core boot May 17, 2024
@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch 4 times, most recently from 0314e80 to 74ff4ab Compare May 28, 2024 13:07
@coveralls

coveralls commented May 28, 2024

Copy link
Copy Markdown

Coverage Status

coverage: 94.663% (+0.02%) from 94.643%
when pulling 5adecf8 on bundle-async-require-section-cond-boot
into 1cdae55 on main.

@flovogt flovogt self-assigned this May 28, 2024
@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch 4 times, most recently from af1d63a to a673874 Compare May 31, 2024 08:22
@flovogt
flovogt marked this pull request as ready for review May 31, 2024 08:24
@flovogt flovogt removed their assignment May 31, 2024
@flovogt
flovogt self-requested a review May 31, 2024 08:36
Comment thread lib/processors/bundlers/moduleBundler.js Outdated
@RandomByte
RandomByte requested a review from codeworrior May 31, 2024 10:37
@RandomByte

Copy link
Copy Markdown
Member Author

LGTM, but would be great if @codeworrior could take a brief look at the LBT changes

@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch from 11ea0fe to e2168a9 Compare May 31, 2024 10:51
Comment thread lib/lbt/bundle/Builder.js Outdated
Comment thread lib/lbt/bundle/Builder.js Outdated
Comment thread lib/processors/bundlers/moduleBundler.js Outdated

@codeworrior codeworrior left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generateStandaloneAppBundle does not provide the UI5 version to the bundler, I guess because the config should be under our control. But in the intermediate state of this Pr, this might cause the generation of a self-contained bundle for UI5 2.0 with a sync require. Just mentioning it.

Comment thread lib/lbt/bundle/Builder.js Outdated
Comment thread lib/lbt/bundle/Builder.js Outdated
Comment thread lib/lbt/bundle/ResolvedBundleDefinition.js
Comment thread lib/processors/bundlers/moduleBundler.js Outdated
@RandomByte

Copy link
Copy Markdown
Member Author

The generateStandaloneAppBundle does not provide the UI5 version to the bundler, I guess because the config should be under our control. But in the intermediate state of this Pr, this might cause the generation of a self-contained bundle for UI5 2.0 with a sync require. Just mentioning it.

The UI5 version does not determine whether a sync- or async require is generated. This is rather define by the bundle configuration. Currently, the self-contained build does not explicitly set async: false for the require section, leading to an async require:

bundleDefinition.sections.push({
mode: "require",
filters: [
"sap/ui/core/Core.js"
]
});

@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch 3 times, most recently from 99432ce to 6778414 Compare June 7, 2024 11:15

@RandomByte RandomByte left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (I can't approve)

@flovogt
flovogt requested review from codeworrior and matz3 June 7, 2024 12:13
Comment thread lib/tasks/bundlers/generateLibraryPreload.js

@matz3 matz3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version needs to be also passed in generateStandaloneAppBundle task

@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch 2 times, most recently from 5ee5d4a to 52d8a5a Compare June 12, 2024 08:15
@flovogt

flovogt commented Jun 12, 2024

Copy link
Copy Markdown
Member

Version needs to be also passed in generateStandaloneAppBundle task

Done

@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch from 52d8a5a to 5979b49 Compare June 12, 2024 13:35
…nal core boot

The builder is able to create bundles not containing "sap.ui.requireSync" calls, so that the bundles can be used also within UI5 Version 2 and later, where this internal API is not available anymore.

JIRA: CPOUI5FOUNDATION-789

Co-authored-by: Merlin Beutlberger <m.beutlberger@sap.com>
@flovogt
flovogt force-pushed the bundle-async-require-section-cond-boot branch from 5979b49 to 5adecf8 Compare June 12, 2024 14:14
@flovogt
flovogt merged commit e421e2f into main Jun 12, 2024
@flovogt
flovogt deleted the bundle-async-require-section-cond-boot branch June 12, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants