-
Notifications
You must be signed in to change notification settings - Fork 9.4k
What are your plan to replace RequireJS that has reached End Of Life #30613
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
Comments
Hi @ericmorand. Thank you for your report.
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:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 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. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@krzksz ideas? :-) |
IMO there are not going to be any major changes to Luma. RequireJS EOL or not.
|
@ericmorand: you might be interested in Hyvä: https://youtu.be/kGRkAQNzL1c?t=21752 (but it's not available yet) |
@victortodoran , Luma is not at cause. RequireJS is the only JavaScript loader that is supported by Magento framework and core modules. PWA won't solve the issue, except if they also replace adminhtml area by a PWA. But the issue remains even with themes that are not based on Luma. Luma is not the one that is making use of RequireJS. Every module out there depends on RequireJS for its frontend behavior needs. Anyway, we need to know their plan: when will adminhtml be replaced by a PWA, for example. |
From backend i don't think will have update soon. Store owner will focus on functionality instead look and feel At my thought Magento/Adobe will follow first approach Hope you guys have a great day |
|
From @maghamed in Slack in the
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions. |
Can we discuss more on this |
@sidolov @sivaschenko @gabrieldagama do you have anything to share with us? |
We have discussed this issue internally and came to the following conclusion: Since it is NOT officially announced that the library is in End of Life status we are not required to do any changes. Even the author of the library mentioned that he is still fixing issues. But, to be prepared before End of Life we will proceed with Fork proposed implementation to prevent BiC and react fastly in short term. In the meantime, we are investigating a replacement solution. Internal ticket: https://jira.corp.magento.com/browse/MC-40156 Please let us know if you'd like to help with alternatives investigation and propose the solutions. |
From my observe frontend performant improved a lot when compare to previous version. Magento core team already migrating jquery 3.6.0 internally (maybe @sivaschenko will know this). Maybe it's time for us to review/recheck and remove unnecessary stuff. Clean up jquery ui for minimal used. Loose tight-coupling with 3rd party libs (example: requirejs will take time and much more efforts) Imho i don't think magento will get rid of requirejs at the moment. Other better way are improve old function and also import new lib for improve performance such as lazyload, lazysizes .v.v since jQuery UI modules are now divided into separate files as of Example below ticket/PR for example efforts improvement old functions Load draggable and resizable jquery-ui by @martasiewierska Eliminate MutationObserver.js (merged) calendar.js (merged) Current i have found file Magento_Ui/js/lib/logger/console-logger.js load with quite lot dependencies but used in multiple files We can reduce number of requests by use bundle such as magepack https://github.com/magesuite/magepack |
I frankly don't see an easy resolution to this problem. This looks like something that would require a re-architecture of the JS loading system that M2 employs – and I'm not sure Adobe has the appetite to both take on PWA and this at the same time. Perhaps I'm just pessimistic ;)
For what it's worth, it's kind of always been like this.
Alas, Magepack appears to be abandoned at this point. It hasn't seen development in what is fast approaching a full year. My team tried it out recently on a v2.4.2 build and found it had significant issues preventing us from using it. The approach @integer-net came up with is way more fiddly (you have to manually browse with a Chrome extension) but works at least. I really, really wish Baler was still seeing development. |
New Adobe commerce with old outdated ORM, deprecated zend1 ,Knockout js,requirejs etc. Adobe need to think to create new software with same Magento commerce features. |
Keep in mind that "old" is not necessarily a justification to change things. If we want Adobe to make substantial architecture changes, we'd want to show what benefit would come from it. Implementing a better JS loading system that can bundle on the server-side would mean vastly improved P90 load times. Require JS' lazyloading means that slow devices experience incommensurately worse performance.* Meanwhile, replacing Knockout with {insert library here} would definitely mean better DX. Knockout's documentation is woeful – and there's very little left of its community that can still answer questions online. Only a dozen KO questions were posted on StackOverflow in August, for example, and nearly half of them got no responses (and none of them more than 1). We're not setting devs up for success here. * This is a problem of the platform that is rarely talked about online. FE performance on Luma can be good, but adding almost any sizable module will cause your Lighthouse (or P85 test) performance scores to fall off a cliff. That's because of chained JS dependencies (A requires B requires C), which have to be downloaded not just serially, but after execution. On fast devices, it's negligible since JS downloads and executes quickly. But on slower devices, which I've seen correlated to worse networks, those one-after-another downloads cause your TTI scores and responsiveness to explode. That has knock-on effects for CLS and LCP (which can be addressed by moving your JS to the footer, but don't do that until you've lazily loaded all below-the-fold assets). That's why implementing things like Magepack or Baler hugely improves your P85/P90 scores – while at the same time not impacting the overall performance of median/P50 users all that much. /rant |
seem we still struggle to improve js stack of magento after near 6 years . So reduce chained JS dependencies is only hope for us |
Can't replace jQuery, sadly. jQuery UI is everywhere on the frontend and a drop-in replacement doesn't exist. The big rewrite in v2.3.3 to use modules is about as optimized as you're gonna get there. I'd advocate to keep the focus of this issue strictly on RequireJS since there's so much surface area on the frontend. |
I think you have to rewrite Magento 3 from scratch using laravel and vue.js and get rid of all this rubbish. I just ended a project on Magento 2 and onestly it was a nightmare. The way could be to focus the development on GraphQL and use Vue storefront as frontend. |
I believe the response to this question will be the following: The last time I saw any updates on this topic was 2018. Maybe @antonkril or @ishakhsuvarov can add more details on it? |
Well I had to fight with very old guns for my last Magento 2 project: JQuery, RequireJS, Kknockout js (!!!). |
@RiccardoRoscilli yes, and they even use a very old version of jQuery. |
@Eddcapone in latest magento versions it's already upgraded to 3.x |
Before trying to explore alternatives I decided to measure PWA venia as well. The results have plummeted to a score of 25 on mobile that's even worse than luma. The slow start is really a no-go here. The frontend needs a major overhaul and pwa studio is not that |
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/requirejs |
@ioweb-gr Sorry to be self-promotional here, but I gave up on Luma and built Hyvä exactly for that reason. Luma is done and PWA is not the solution for largest part of the market. |
@wigman I understand and I've seen the metrics on Hyva however there are some practical reasons not to prefer it.
While it may be good for your needs, it doesn't mean it's the solution. Granted, Hyva is fast. But fast is not all that a shop owner needs to choose your theme over other themes. |
Summary (*)
RequireJS has been in End of Life status for months (maybe even years), as confirmed by its status at the OpenJS Foundation or by the maintainer itself: requirejs/requirejs#1816
Its archaic design makes executing script after it unreliable and unpredictable (see requirejs/requirejs#947 but also the thousand of discussions about this problem here and on Magento 2 community message boards) and it polutes the global scope so it is a very good thing that it is at last abandoned for good.
But it puts Magento 2 in a very delicate situation: the fundamental JavaScript base of all the Magento 2 modules provided by the core and the community is heavily tied to RequireJS, both at the frontend and the adminhtml scopes, and it makes Magento 2 tied to its weaknesses as well.
I'm sure you have been planning the migration from RequireJS to another JavaScript "loader" technology for months (note that I'm convinced it should have been part of Magento 2 to begin with) and we need to know your plans about it.
Proposed solution
Please share your plan to get rid of RequireJS. Professional users need to know where you are headed and at what pace. It's even more important because you propose some paid flavors and our clients shouldn't have to pay for something that is based on an archaic technology that creates issues right now and may fail totally in the near future.
The text was updated successfully, but these errors were encountered: