Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INTERNAL] Async bundling for require section #1048

Merged
merged 21 commits into from
Jul 23, 2024
Merged

Conversation

d3xter666
Copy link
Contributor

@d3xter666 d3xter666 commented Jul 11, 2024

Require's section async flag has different default values based on the specVersion. However, async require is now build by default.
We need to explicitly default async=false for specVersions lower than 4.0

@d3xter666 d3xter666 marked this pull request as draft July 11, 2024 09:17
@coveralls
Copy link

coveralls commented Jul 11, 2024

Coverage Status

coverage: 94.711% (+0.002%) from 94.709%
when pulling ae0fb09 on fix-async-require-bundling
into 8a2868d on main.

@d3xter666 d3xter666 requested review from matz3 and a team July 11, 2024 13:37
@d3xter666 d3xter666 marked this pull request as ready for review July 11, 2024 13:38
@matz3
Copy link
Member

matz3 commented Jul 11, 2024

Please use [INTERNAL] as this fixes an issue of a feature that hasn't been released, so it is not relevant to be mentioned in the changelog.

Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

Works as expected 👍🏻

@matz3 matz3 requested a review from a team July 11, 2024 13:53
flovogt
flovogt previously approved these changes Jul 11, 2024
@matz3
Copy link
Member

matz3 commented Jul 12, 2024

Please also keep @RandomByte's comment in mind: #1042 (comment)

@d3xter666 d3xter666 requested a review from KlattG July 12, 2024 07:22
@d3xter666 d3xter666 changed the title [FIX] Async bundling for require section [INTERNAL] Async bundling for require section Jul 12, 2024
@d3xter666
Copy link
Contributor Author

d3xter666 commented Jul 12, 2024

@KlattG , would you take a look at this one, please?
lib/processors/bundlers/moduleBundler.js

lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
@matz3 matz3 requested a review from a team July 12, 2024 08:41
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
@d3xter666
Copy link
Contributor Author

d3xter666 commented Jul 17, 2024

The build fails as we need to publish specVersion: 4.0 in order tests to run successfully

@matz3
Copy link
Member

matz3 commented Jul 17, 2024

The build fails as we need to publish specVersion: 4.0 in order tests to sun successfully

Tests already fail in main as we're about to do the release. cc @flovogt

Independent from that there are also two eslint errors introduced with this PR.

@d3xter666
Copy link
Contributor Author

d3xter666 commented Jul 18, 2024

Hi @KlattG,

I have updated the texts according to the comments above.
Would you take a look again at this PR, please?

https://github.com/SAP/ui5-builder/pull/1048/files#diff-255002459f4f366a0dceae0db4927dd06d44894f887b3ba210884d9a399f48d1

@d3xter666 d3xter666 requested a review from KlattG July 18, 2024 12:45
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
@matz3 matz3 requested a review from KlattG July 19, 2024 08:47
Copy link
Contributor

@KlattG KlattG left a comment

Choose a reason for hiding this comment

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

Just one small suggestion, otherwise fine.

lib/processors/bundlers/moduleBundler.js Outdated Show resolved Hide resolved
@matz3 matz3 requested a review from a team July 19, 2024 08:57
@@ -75,6 +75,10 @@ const log = getLogger("builder:processors:bundlers:moduleBundler");
* @property {boolean} [declareRawModules=false] Whether raw modules should be declared after jQuery.sap.global
* became available. With the usage of the ui5loader, this flag should be set to 'false'
* @property {boolean} [sort=true] Whether the modules should be sorted by their dependencies
* @property {boolean} [async=true] Whether the `require` section of the module should be loaded asynchronously.
* When set to true, the modules are loaded using `sap.ui.require` instead of `sap.ui.requireSync`.
Copy link
Member

Choose a reason for hiding this comment

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

Should we mention that each section creates one sap.ui.require call (or alternatively, that the modules are required in parallel)?

@matz3
Copy link
Member

matz3 commented Jul 22, 2024

@KlattG could you please check my changes in 3a8289b?

Copy link
Contributor

@KlattG KlattG left a comment

Choose a reason for hiding this comment

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

LGTM

matz3
matz3 previously approved these changes Jul 22, 2024
@matz3 matz3 force-pushed the fix-async-require-bundling branch from e0f8451 to a06c99a Compare July 23, 2024 12:31
@matz3 matz3 merged commit 63a9e82 into main Jul 23, 2024
6 of 19 checks passed
@matz3 matz3 deleted the fix-async-require-bundling branch July 23, 2024 13:17
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.

6 participants