Skip to content

[BREAKING] Discontinue bundling of JavaScript modules as string #1036

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

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

flovogt
Copy link
Member

@flovogt flovogt commented Jun 24, 2024

The UI5 bundler packages JavaScript files that are identified as "requiresTopLevelScope" as a string, to be evaluated via "eval" at runtime. This behavior ensures that the script works as expected, e.g. with regards to implicit globals.
This "eval" runtime feature with be discontinued in UI5 2.0 because of security best practices (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) and to comply with stricter CSP settings (unsafe-eval).
By using specVersion 4.0 an error is thrown when bundling a module as string and the module is not included in the bundle at all.

JIRA: CPOUI5FOUNDATION-794

@flovogt flovogt force-pushed the disable-string-bundling branch 3 times, most recently from fc7d29e to b9217ff Compare June 25, 2024 09:23
@d3xter666 d3xter666 force-pushed the disable-string-bundling branch from ea6f16b to f617f0b Compare June 26, 2024 11:57
@coveralls
Copy link

Coverage Status

coverage: 94.681% (+0.01%) from 94.668%
when pulling f617f0b on disable-string-bundling
into 51e2b08 on main.

@coveralls
Copy link

Coverage Status

coverage: 94.681% (+0.01%) from 94.668%
when pulling f617f0b on disable-string-bundling
into 51e2b08 on main.

@coveralls
Copy link

Coverage Status

coverage: 94.681% (+0.01%) from 94.668%
when pulling 136b40d on disable-string-bundling
into 51e2b08 on main.

@coveralls
Copy link

Coverage Status

coverage: 94.681% (+0.01%) from 94.668%
when pulling 2b4a4dc on disable-string-bundling
into 51e2b08 on main.

@flovogt flovogt force-pushed the disable-string-bundling branch from 2b4a4dc to 8791491 Compare July 2, 2024 11:17
@coveralls
Copy link

Coverage Status

coverage: 94.645% (-0.02%) from 94.668%
when pulling 8791491 on disable-string-bundling
into 934956a on main.

@flovogt flovogt force-pushed the disable-string-bundling branch 6 times, most recently from 09b6663 to 88bcad2 Compare July 4, 2024 12:02
@coveralls
Copy link

Coverage Status

coverage: 94.668%. remained the same
when pulling 88bcad2 on disable-string-bundling
into 934956a on main.

@flovogt flovogt requested a review from codeworrior July 4, 2024 12:13
@flovogt flovogt marked this pull request as ready for review July 4, 2024 12:13
@flovogt flovogt requested a review from RandomByte July 4, 2024 12:14
@flovogt flovogt force-pushed the disable-string-bundling branch from 88bcad2 to f8e4b88 Compare July 5, 2024 12:51
@coveralls
Copy link

Coverage Status

coverage: 94.677%. remained the same
when pulling f8e4b88 on disable-string-bundling
into dfa67fe on main.

Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

I'm missing some tests for the case of specVersion 4 project with resources that require bundling as string

@flovogt flovogt force-pushed the disable-string-bundling branch from f8e4b88 to 2781bfe Compare July 5, 2024 13:56
@coveralls
Copy link

Coverage Status

coverage: 94.677%. remained the same
when pulling 2781bfe on disable-string-bundling
into dfa67fe on main.

@flovogt flovogt force-pushed the disable-string-bundling branch 4 times, most recently from 6faad79 to fc4fe78 Compare July 8, 2024 11:54
@flovogt flovogt requested a review from RandomByte July 8, 2024 11:55
@flovogt
Copy link
Member Author

flovogt commented Jul 8, 2024

ui5 tooling integration tests are triggered: 534

RandomByte
RandomByte previously approved these changes Jul 8, 2024
Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

LGTM

@flovogt flovogt force-pushed the disable-string-bundling branch 2 times, most recently from 0402336 to f94939d Compare July 9, 2024 12:45
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.

@flovogt I think I've seen 'higher' more often than 'newer'.

@flovogt flovogt force-pushed the disable-string-bundling branch from f94939d to 2eeb1b4 Compare July 9, 2024 13:50
@flovogt flovogt requested review from KlattG and RandomByte July 9, 2024 13:51
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

@flovogt flovogt force-pushed the disable-string-bundling branch from 2eeb1b4 to 7cb8f6b Compare July 9, 2024 14:33
@flovogt flovogt force-pushed the disable-string-bundling branch from 7cb8f6b to 79e38a5 Compare July 12, 2024 07:22
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 minor point, otherwise LGTM

@flovogt flovogt force-pushed the disable-string-bundling branch from 79e38a5 to 0527308 Compare July 12, 2024 09:08
@flovogt flovogt requested review from matz3 and KlattG July 12, 2024 09:08
The UI5 bundler packages JavaScript files that are identified as "requiresTopLevelScope" as a string, to be evaluated via "eval" at runtime. This behavior ensures that the script works as expected, e.g. with regards to implicit globals.
This "eval" runtime feature with be discontinued in UI5 2.0 because of security best practices (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) and to comply with stricter CSP settings (unsafe-eval).
By using specVersion 4.0 an error is thrown when bundling a module as string and the module is not included in the bundle at all.

JIRA: CPOUI5FOUNDATION-794
@flovogt flovogt force-pushed the disable-string-bundling branch from 0527308 to db37a49 Compare July 12, 2024 12:49
@flovogt flovogt requested a review from matz3 July 12, 2024 12:49
@flovogt flovogt merged commit 7691b08 into main Jul 12, 2024
6 of 16 checks passed
@flovogt flovogt deleted the disable-string-bundling branch July 12, 2024 13:08
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