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

WordPress Trac noreply at wordpress.org
Mon Sep 24 16:52:14 UTC 2018


#44987: Try including WordPress packages: Shortcode
--------------------------+-----------------------------
 Reporter:  youknowriad   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:  has-patch
  Focuses:  javascript    |
--------------------------+-----------------------------
 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>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list