Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45626 closed enhancement (duplicate)

AMD (Asynchronous Module Definition) for core

Reported by: nextendweb's profile nextendweb Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Script Loader Keywords:
Focuses: javascript Cc:

Description

I'm sure it was requested in the past, but I haven't found that ticket. It would be great in the future if WordPress would include AMD officially. https://github.com/amdjs/amdjs-api/blob/master/AMD.md

There are several different plugins in the directory which can place scripts into the footer or make them async on the fly. Currently if a shortcode outputs a script tag into the post which depends on jQuery, but another plugin pushed jQuery into the footer or made async, then the script will fail and developer must create workarounds to solve this issue.

If there would be an official module loader, then developers could inject their JavaScript codes with dependencies into the source code and there would be no failure even in very rare cases.

Change History (1)

#1 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @nextendweb, welcome to WordPress Trac!

Thanks for the ticket, we're already tracking this in #23285.

Note: See TracTickets for help on using tickets.