[wp-trac] [WordPress Trac] #44987: Try including WordPress packages: Shortcode

WordPress Trac noreply at wordpress.org
Mon Sep 24 20:17:27 UTC 2018


#44987: Try including WordPress packages: Shortcode
-------------------------+-------------------------
 Reporter:  youknowriad  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.0
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  javascript
-------------------------+-------------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review => 5.0


Old description:

> In this issue, I'm trying to use The @wordpress/shortcode package in
> WordPress instead of the built-in shortcode.js file.
>
> This is meant to prove how we can include WordPress packages in WordPress
> Core and ultimately merge Gutenberg into Core.
>
>  - Small refactoring to webpack configs to avoid duplication between dev
> and prod
>  - Adding `wp-polyfill` and `lodash` scripts (new vendors used by
> Gutenberg scripts)
>  - I'm including the `@wordpress/shortcode` package in an enqueue script
> like that: `window.wp.shortcode = require( '@wordpress/shortcode' );`
> mainly because using the `library` webpack config to generate the globals
> is not working reliably because of the other bundled scripts in Core that
> are not packages (it could be revisited later once we have more
> packages).
>  - Unfortunately, the `jshint` config is a bit outdated and doesn't match
> what we discussed in #core-js meeting yet, I wasn't able to use `const`
> or `import` in the enqueue script (we should address the jshint => eslint
> replacement in a separate ticket)
>
> 🎉The first bit of JavaScript from Gutenberg is making its way into
> WordPress :)

New description:

 In this issue, I'm trying to use The @wordpress/shortcode package in
 WordPress instead of the built-in shortcode.js file.

 This is meant to prove how we can include WordPress packages in WordPress
 Core and ultimately merge Gutenberg into Core.

  - Small refactoring to webpack configs to avoid duplication between dev
 and prod
  - Adding `wp-polyfill` and `lodash` scripts (new vendors used by
 Gutenberg scripts)
  - I'm including the `@wordpress/shortcode` package in an enqueue script
 like that: `window.wp.shortcode = require( '@wordpress/shortcode' );`
 mainly because using the `library` webpack config to generate the globals
 is not working reliably because of the other bundled scripts in Core that
 are not packages (it could be revisited later once we have more packages).
  - Unfortunately, the `jshint` config is a bit outdated and doesn't match
 what we discussed in #core-js meeting yet, I wasn't able to use `const` or
 `import` in the enqueue script (we should address the jshint => eslint
 replacement in a separate ticket)

 The first bit of JavaScript from Gutenberg is making its way into
 WordPress :)

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44987#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list