magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.49k stars 9.3k forks source link

Eliminate unnecessary js files only load files needed #33686

Open mrtuvn opened 3 years ago

mrtuvn commented 3 years ago

Description (*)

Not a bug but i think we should consider remove/reduce un-need js load files to make site render faster. Current magento have many js loaded via requirejs (~190 files) in case no bundling enabled

"simplify js only keep common parts we used and remove not used parts"

Common files we can consider keep at all page (for basic make site workable) underscore requirejs jquery knockoutJs cookie storage translate main common utils section-config.js mixins.js

Ko bindings and all js related ko dependencies should be simply

i18n <= common scope <= common mage-init <= common after-render <= common resizable <= common bind-html <= common knockoutjs/knockout-repeat <= common knockoutjs/knockout-fast-foreach <= common

uncommon ko-bind keyboard optgroup range autoselect datepicker outer_click fadeVisible collapsible staticChecked simple-checked tooltip color-picker

Uncommon files (Load on demands default) ie-class-fixer.js (IE nearly dead and not support) we should replace/remove this REMOVED smart-keyboard-handler.js lib/logger/logger.js lib/logger/console-output-handler.js (should only visible in developer or debug purpose? Why we load it in production mode for show log bug) jquery widget ui effects: No need fancy stuff we only some basic fade, show/hide, toggle => reduce it v.v.

Extra By default all js loaded by requirejs will load with async mode but some case we don't want that. Would be great if we have config or option allow admin to choose async/defer load requirejs depend from backend Not the case add js via layout (with defer attribute)

Expected behavior (*)

Faster render website with minimal amount js I think around 20-30 js files or less files would be great and bring to user/visiter better experiences

Benefits

Yes of course this is good improvements. No one want to have slow experiences while visit ecommerce store

Additional information

m2-assistant[bot] commented 3 years ago

Hi @mrtuvn. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

mrtuvn commented 1 year ago

Still valid problem so i will turn it on

onlinebizsoft commented 1 year ago

Do we have any progress?

Paktas commented 1 year ago

Same as #24830

choussamaster commented 11 months ago

Hi @mrtuvn any updates please ? thanks