ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

Optimization suggestions

Open 974758241 opened this issue 2 years ago • 1 comments

  1. You can progress to compressed files such as sap.ui.core.js
  2. The user can specify the language to be packaged
  3. If I want to contribute, how can I do it?

974758241 avatar Apr 30 '22 02:04 974758241

Could you please share some more details on your proposed optimization? I.e. what is the problem you want to solve? And how do you want to solve it, in more detail?

You can find our contributing guideline here: https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md#-contributing-code

RandomByte avatar May 02 '22 07:05 RandomByte

Could you please share some more details about your thoughts on 1. and 2.?

flovogt avatar Feb 21 '23 13:02 flovogt

  1. There are many things that can be done about sap.ui.core.js. For example, a large number of text comments and line breaks can be removed, which can be packaged in webpack5. Developers can choose whether or not to remove comments when packaging, which will reduce the size of the code, especially when a large number of programs are deployed to FLP. This performance improvement is huge, of course, there is a lot of room for improvement in sap.ui.core.js, especially 'Free UI5 Develop'.
  2. With regard to translation files, most users will not require all languages, but only one to two. When we package, we can delete other translation files (messagebundle*.properties) according to the language specified by the user.
  3. After the user has packaged, many files can be deleted, such as "sap.m.AppRenderer.js", leaving only the library-preload.js related to the library used by the user, so that the overall code size will be much smaller after packaging, which is helpful for developers to carry out rapid CI/CD.

Edit RandomByte: Layout changes for readability

974758241 avatar Feb 22 '23 01:02 974758241

  1. There are many things that can be done about sap.ui.core.js. For example, a large number of text comments and line breaks can be removed, which can be packaged in webpack5. Developers can choose whether or not to remove comments when packaging, which will reduce the size of the code, especially when a large number of programs are deployed to FLP. This performance improvement is huge, of course, there is a lot of room for improvement in sap.ui.core.js, especially 'Free UI5 Develop'.

Comments are generally removed when bundling, with only few exceptions such as copyright statements being preserved for legal reasons. See for example: https://ui5.sap.com/resources/sap-ui-core.js

You should be able to see the same behavior when checking the Component-preload.js or library-preload.js files in the build result of your projects.

Can you share more details where you see a large size of comments in bundles created by UI5 Tooling?

  1. With regard to translation files, most users will not require all languages, but only one to two. When we package, we can delete other translation files (messagebundle*.properties) according to the language specified by the user.

This might be a reasonable enhancement in the future. It could be possible to filter localization files based on a configured set of languages. But this needs further clarification. We should check whether this can be solved in a custom task first.

  1. After the user has packaged, many files can be deleted, such as "sap.m.AppRenderer.js", leaving only the library-preload.js related to the library used by the user, so that the overall code size will be much smaller after packaging, which is helpful for developers to carry out rapid CI/CD.

This might be the same requirement as discussed in https://github.com/SAP/ui5-tooling/issues/731

RandomByte avatar Apr 14 '23 16:04 RandomByte

This issue has been automatically marked as stale because it has been open for 60 days with no activity. It will be closed in 10 days if no further activity occurs.

github-actions[bot] avatar Jun 13 '23 20:06 github-actions[bot]