Open codebymikey opened 3 years ago
The updated list should be
const externals = [
'a11y',
'annotations',
'api-fetch',
'autop',
'blob',
'block-directory',
'block-editor',
'block-library',
'block-serialization-default-parser',
'blocks',
'components',
'compose',
'core-data',
'data',
'data-controls',
'date',
'deprecated',
'dom',
'dom-ready',
'edit-post',
'editor',
'element',
'escape-html',
'format-library',
'hooks',
'html-entities',
'i18n',
'is-shallow-equal',
'keyboard-shortcuts',
'keycodes',
'media',
'media-utils',
'notices',
'plugins',
'primitives',
'priority-queue',
'redux-routine',
'rich-text',
'server-side-render',
'shortcode',
'token-list',
'url',
'viewport',
'warning',
'wordcount',
]
And can be generated from running the following on the https://wordpress.org/gutenberg/ console:
\n\t\'' + Object
.keys( wp )
.filter( k => !['Uploader','apiRequest','receiveEmbedMessage','template'].includes(k) && (wp[k].__esModule || typeof wp[k] === 'function') )
.map( ( k ) => k.replace( /([a-z])([A-Z])/g, ( match ) => match[ 0 ] + '-' + match[ 1 ].toLowerCase() ) )
.sort()
.join( '\',\n\t\'' ) + '\',\n';
I've just hit this with the compose component.
I'm new to this so don't know how to add this dependence on an in progress plugin, to I need to instead clone the repo but then how do I use it ?
Some basic documentation on this would be most helpful and appreciated.
Bug Report
The list of externals the
externals.js
is not up to date is missing various components that might be used. https://github.com/ahmadawais/create-guten-block/blob/b8fbdbcf2f1b9db4918eb933d630777027ed3de8/packages/cgb-scripts/config/externals.js#L20-L34 e.g.Imports the
Path
andSVG
objects from the node_modules (if it exists) rather than replacing it withwp.primitives
.Expected Behavior
The import should be replaced with
wp.primitives
in the exported output.Proposed solution(s)
Object.keys(wp)
on https://wordpress.org/gutenberg/, or list of folders here.