-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent re-bundling WordPress packages #1781
Conversation
@westonruter Couldn't we bundle the |
@felixarntz this is ready to go! |
We should rely on ESLint alone for JS linting now. This is a follow-up to f955432
70f4400
to
d5dbf32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor questions, otherwise good to go.
sourcesPointer(); | ||
} ); | ||
// Run at DOM ready. | ||
jQuery( sourcesPointer ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might miss something, but shouldn't this use wp.domReady
somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use wp.domReady
but this script is already depending on jQuery so we can use jQuery ready instead which does the same thing.
8b6c0be
to
8e2090e
Compare
Ok, issues have been addressed. |
@wordpress/dom-ready
and@wordpress/i18n
to instead rely on existing bundles if available. Ensure both are marked asdevDependencies
.@wordpress/dom-ready
and@wordpress/i18n
if not available (e.g. in WordPress 4.9 without Gutenberg).The@wordpress/dom-ready
package is bundled with both WordPress 5.0 and Gutenberg aswp-dom-ready
, so we should use it.Also,@wordpress/i18n
is not even used in the project anymore, so we don't need it at all.Problem: If on 4.9 and Gutenberg is not installed, then we need to polyfillwp-dom-ready
withjQuery.ready()
. Nevertheless, we are currently depending onwp-i18n
even though it may not be available either. So we might need to make the plugin require WordPress 5.0 or WordPress 4.9 with Gutenberg as the minimum version. Or perhaps in that case we should still bundle those dependencies as separate scripts that we register? If we want to support 4.9 without Gutenberg, then I suppose this is what we'd have to do. @felixarntz thoughts?Closes #1763.