Make WordPress Core

Opened 4 months ago

Closed 3 months ago

#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 SergeyBiryukov)

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 :)

Attachments (2)

shortcode-package.patch (31.2 KB) - added by youknowriad 4 months ago.
shortcode-package.2.patch (30.7 KB) - added by youknowriad 4 months ago.
Remove unused function

Download all attachments as: .zip

Change History (11)

#1 @youknowriad
4 months ago

Oh btw, the memize dependency is temporary and should be removed after this gutenberg PR lands https://github.com/WordPress/gutenberg/pull/10140

4 months ago

Remove unused function

#2 @youknowriad
4 months ago

  • Type changed from defect (bug) to enhancement

#3 @SergeyBiryukov
4 months ago

  • Description modified (diff)
  • Milestone changed from Awaiting Review to 5.0

#4 @SergeyBiryukov
4 months ago

Didn't mean to edit the description, not sure what happened here :)

This ticket was mentioned in Slack in #core-js by adamsilverstein. View the logs.

4 months ago

This ticket was mentioned in Slack in #core-editor by youknowriad. View the logs.

4 months ago

This ticket was mentioned in Slack in #core by matias. View the logs.

4 months ago

This ticket was mentioned in Slack in #core-js by netweb. View the logs.

4 months ago

#9 @youknowriad
3 months 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.

Note: See TracTickets for help on using tickets.