Skip to content
Browse files

Script loader: Register @WordPress scripts.

This allows the packages to be consumed by plugins and core itself.
The code has been based on the work done in the Gutenberg plugin.

We've added an array with all the packages and the vendor packages to
loop through. This sets a convention so all packages will be
registered in the same way. This array can eventually be generated by
a webpack plugin.

We need to register TinyMCE explicitly. Previously TinyMCE was used
by inserting custom `<script>` tags into the relevant admin pages.
This is not suitable for the new editor, so we need to explicitly
register TinyMCE. We could, in the future, refactor the custom
`<script>` tags to use the registered TinyMCE script instead.

Polyfills are inserted into the page only when necessary using

Props omarreiss, herregroen, youknowriad, gziolo.
Fixes #45065.

git-svn-id: 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
atimmer committed Oct 12, 2018
1 parent d8fc849 commit 647fa41636f1ece5dd5f467c13398dc85702656d
Showing with 542 additions and 2 deletions.
  1. +540 −0 src/wp-includes/script-loader.php
  2. +2 −2 tools/webpack/packages.js

0 comments on commit 647fa41

Please sign in to comment.
You can’t perform that action at this time.