Magento2: What are your plan to replace RequireJS that has reached End Of Life

Created on 23 Oct 2020  路  8Comments  路  Source: magento/magento2

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: https://github.com/requirejs/requirejs/issues/1816

Its archaic design makes executing script _after_ it unreliable and unpredictable (see https://github.com/requirejs/requirejs/issues/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.

ready for confirmation Dev.Experience

All 8 comments

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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


  • Join Magento Community Engineering Slack and ask your questions in #github channel.

    :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

: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

@krzksz ideas? :-)

IMO there are not going to be any major changes to Luma. RequireJS EOL or not.
These are the several factors I'm basing my statement:

  1. All the attention is concentrated on PWA and Venia.
  2. All partner extensions depend on the current implementation of Luma.
  3. There are several instances of Magento2 many of which just invested a ton of money to migrate to M2 from M1.
    Telling them they need to change all their frontend customizations is simply not a viable option.

@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
From frontend This is my thought
the are plenty way and always have room for improve or decoupling depend on requireJS

1 you can build storefront theme from blank (or even luma) but need a lot effort for maintain and make your site fast. Try to minimal as much js request as possible

2 another option throw away unneccessary parts like Hyva theme did (No RequireJs KnockoutJS No Jquery No Less styles use native css by tailwind) No theme extend inherritance from core. Only reused javascript modules or core js modules from magento @wigman will know this best

(Note hyva just born in few months current in early stage. Still missing some part need a lot of work and update)

3 you can start storefront with pwa like pwastudio did

4 none of above way

build storefront from scratch no-depending no-bullshit-heavily-load

Hope you guys have a great day
Happy coding!

IMO there are not going to be any major changes to Luma. RequireJS EOL or not.
These are the several factors I'm basing my statement:

  1. All the attention is concentrated on PWA and Venia.
  2. All partner extensions depend on the current implementation of Luma.
  3. There are several instances of Magento2 many of which just invested a ton of money to migrate to M2 from M1.
    Telling them they need to change all their frontend customizations is simply not a viable option.
  1. They could leave the requirejs technology still there for backwards compatibility, implement the new technology and then completly remove it in Magento 3

From @maghamed in Slack in the #appdesign channel:

Dev Guild will consider this question in the upcoming future and get back with results

Was this page helpful?
0 / 5 - 0 ratings