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

Replace jquery/ui with the new modular approach #1590

Closed
Quazz opened this issue Oct 24, 2019 · 8 comments
Closed

Replace jquery/ui with the new modular approach #1590

Quazz opened this issue Oct 24, 2019 · 8 comments

Comments

@Quazz
Copy link

Quazz commented Oct 24, 2019

Describe the solution you'd like
Replace each instance of jquery/ui dependency with the relevant modular approach.

The reason this is desirable is that it improves performance, especially on lower end devices. (less javascript to process is alway good!)

Additional context
Magento 2.3.3 changed jquery-ui to be split up into seperate modules. Extensions should now update their scripts to no longer depend on the bulky jquery-ui, but only the modules that it requires

Additional info can be found in this tweet: https://twitter.com/vova_yatsyuk/status/1182192753335324673?s=09

@romainruaud
Copy link
Collaborator

Good catch @Quazz !

Any chance you provide some help on this one ? :)

@Quazz
Copy link
Author

Quazz commented Oct 24, 2019

@romainruaud Haven't fully tested it, but as far as I can tell, just replace jquery/ui with jquery-ui-modules/widget in the following locations:

https://github.com/Smile-SA/elasticsuite/blob/2.8.x/src/module-elasticsuite-catalog/view/frontend/web/js/range-slider-widget.js#L18

https://github.com/Smile-SA/elasticsuite/blob/2.8.x/src/module-elasticsuite-core/view/frontend/web/js/form-mini.js#L24

I don't believe anything other than Widget is used of jquery-ui, but I could be mistaken. Haven't logged any complaints in the browser console so far, in the instances I could think of. Looking over the code, it seems to be accurate, too.

Everything else seems to be handled by the other dependencies.

@romainruaud
Copy link
Collaborator

@androshchuk can you check that the proposed replacement is working ?

@androshchuk
Copy link
Contributor

@romainruaud it's working.

@Quazz thank you for your help.

Regards

@rbayet rbayet reopened this Oct 30, 2019
@rbayet
Copy link
Collaborator

rbayet commented Oct 30, 2019

BC with EE/CE M2 2.3.* to be tested.
I don't fancy introducing a bug for everyone but people using the 2.3.3.

@Quazz
Copy link
Author

Quazz commented Oct 30, 2019

Perhaps the 'delegated dependency' that the tweet mentions is the better approach then?

Magento_Ui/js/modal/modal instead of jquery/ui

@androshchuk
Copy link
Contributor

@rbayet I checked way use Magento_Ui/js/modal/modal instead of jquery/ui in M2 CE 2.3.0 and M2 CE 2.3.3.

Everything works fine.

rbayet added a commit that referenced this issue Oct 31, 2019
…-ui-module

Feature #1590 replace jquery-ui with jquery-ui-module
@rbayet
Copy link
Collaborator

rbayet commented Oct 31, 2019

Solved by PR #1597

@rbayet rbayet closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants