#44987 closed enhancement (duplicate)
Try including WordPress packages: Shortcode
Reported by: | youknowriad | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description (last modified by )
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
andlodash
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 thelibrary
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 useconst
orimport
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 :)
Attachments (2)
Change History (12)
This ticket was mentioned in Slack in #core-js by adamsilverstein. View the logs.
6 years ago
This ticket was mentioned in Slack in #core-editor by youknowriad. View the logs.
6 years ago
This ticket was mentioned in Slack in #core by matias. View the logs.
6 years ago
This ticket was mentioned in Slack in #core-js by netweb. View the logs.
6 years ago
#9
@
6 years ago
- Milestone 5.0 deleted
- Resolution set to duplicate
- Status changed from new to closed
This served its purpose as a baseline for #45065 which just landed. We can close this ticket now.
Oh btw, the memize dependency is temporary and should be removed after this gutenberg PR lands https://github.com/WordPress/gutenberg/pull/10140