[wp-trac] [WordPress Trac] #45065: Include Gutenberg packages in WordPress core.

WordPress Trac noreply at wordpress.org
Mon Oct 15 00:27:07 UTC 2018

#45065: Include Gutenberg packages in WordPress core.
 Reporter:  omarreiss    |       Owner:  omarreiss
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  5.0
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  javascript
Changes (by pento):

 * status:  closed => reopened
 * resolution:  fixed =>


 Thank you for getting this done so quickly, @atimmer!

 There are a few changes that we need to make here. Nothing major, just a
 bit of shuffling. 🙂

 Instead of calling `wp_default_packages_vendor()`,
 `wp_default_packages_scripts()`, and
 `wp_default_packages_inline_scripts()` inside `wp_default_scripts()`, they
 should be attached to the `wp_default_scripts` action.
 `wp_register_tinymce_scripts()` should be attached to that action, too.

 Is there any particular reason for `wp_default_packages_vendor()` and
 `wp_default_packages_scripts()` to be different functions? We don't
 differentiate between third party and WordPress scripts in
 `wp_default_scripts()`. They could be combined into a new
 `wp_default_packages()` function.

 Similarly, `wp_register_tinymce_scripts()` could either be merged

 `wp_default_packages_inline_scripts()` should be merged into
 `wp_default_packages()`, in the same style as inline scripts are added in

 There are several filters being run in
 `wp_default_packages_inline_scripts()` that don't have docblocks.

 `wp_register_tinymce_scripts()` is a partial duplication of
 `_WP_Editors::print_tinymce_scripts()`: these need to be combined as much
 as possible, I suspect `wp_register_tinymce_scripts()` could really be
 merged into `wp_default_packages()` or `wp_default_scripts()`, too.

 `wp-tinymce-lists` is trying to load `index.js`, it should be `plugin.js`.

 All of the URL strings should be in the form `"foo/bar/baz$suffix.js"`,
 rather than `'foo/bar/baz' . $suffix . '.js'` or

 I get where you were going with `wp_default_packages_scripts()` and
 `wp_default_packages_vendor()` being arrays of scripts that you then loop
 over to register, but this is probably going to cause maintenance
 headaches down the road. You can see in `wp_default_scripts()` how there
 are weird little variations in how scripts are loaded, a future version of
 WordPress will likely need to break these scripts out of the array, so we
 can do the same thing. Let's just do it the same way as

 Let's leave `$script` being accepted as a reference for now: it will
 probably go away as part of #44979, but that issue needs further

Ticket URL: <https://core.trac.wordpress.org/ticket/45065#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list