Skip to content
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

Editor: Remove obsolete @wordpress/nux dependency #4702

Closed

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Jun 26, 2023

Running npm run sync-gutenberg-packages -- --dist-tag=wp-6.3 currently results in the following error:

Running "wp-packages:update" task
Updating WordPress packages (--dist-tag=wp-6.3)
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @wordpress/nux@wp-6.3.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

after which script execution resumed, thus typically hiding the error behind a lot of other output.

However, this results in package.json not being updated with the expected version bumps to @wordpress/* packages.

This PR seeks to remediate the issue by removing the dependency on @wordpress/nux. There seems to be some related discussion on @wordpress/nux deprecation in https://core.trac.wordpress.org/ticket/57643.

Testing instructions

  • On trunk, run npm run sync-gutenberg-packages -- --dist-tag=wp-6.3. Scroll up near the start of the resulting output and verify that the above warning is present. Furthermore, verify that package.json doesn't contain any changes to @wordpress/ packages.
  • Switch to this branch, and re-run that command. Verify that the warning doesn't appear this time around, and that @wordpress/ package versions in package.json are now indeed updated.

Trac ticket: https://core.trac.wordpress.org/ticket/58633


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ockham ockham self-assigned this Jun 26, 2023
@ockham ockham marked this pull request as ready for review June 26, 2023 15:59
@ockham
Copy link
Contributor Author

ockham commented Jun 26, 2023

cc/ @ramonjd

@youknowriad
Copy link
Contributor

For what it's worth I tried removing this dependency before (See #3775 ) and @peterwilsoncc had disagreed about it because of backward compatibility concerns. So we might want to check that again, main the additional release make this feasible now.

It's also worth clarifying that this is going to create issue for us every time we try to do a package update.

@ockham
Copy link
Contributor Author

ockham commented Jun 26, 2023

Thank you @youknowriad!

I guess one workaround -- to unblock the sync script -- would be to add the wp-6.3 dist tag to the latest existing @wordpress/nux package; but I'm not sure if that's possible for a deprecated npm 🤔

Otherwise, I guess we'll have to remove the dependency before running the sync script, and then add it back afterwards 😕

@youknowriad
Copy link
Contributor

Otherwise, I guess we'll have to remove the dependency before running the sync script, and then add it back afterwards

That's what I did the last time to generate the lock. It's a bit painful though.

@peterwilsoncc
Copy link
Contributor

Would this work in wp-dev without the need to change wp-scripts?

diff --git a/tools/release/sync-gutenberg-packages.js b/tools/release/sync-gutenberg-packages.js
index f5c8fbcdf7..c5c12b140f 100644
--- a/tools/release/sync-gutenberg-packages.js
+++ b/tools/release/sync-gutenberg-packages.js
@@ -10,6 +10,9 @@ const { zip, uniq, identity, groupBy } = require( 'lodash' );
  * Constants
  */
 const WORDPRESS_PACKAGES_PREFIX = '@wordpress/';
+const WORDPRESS_PACKAGES_DEPRECATED = [
+	'@wordpress/nux',
+];
 const { getArgFromCLI } = require( `../../node_modules/@wordpress/scripts/utils` );
 const distTag = getArgFromCLI( '--dist-tag' ) || 'latest';
 
@@ -167,6 +170,10 @@ function getWordPressPackages( { dependencies = {} } ) {
  * @return {boolean} Is it a @wodpress package?
  */
 function isWordPressPackage( packageName ) {
+	// Ignore @wordpress packages no longer receiving updates.
+	if ( WORDPRESS_PACKAGES_DEPRECATED.includes( packageName ) ) {
+		return false;
+	}
 	return packageName.startsWith( WORDPRESS_PACKAGES_PREFIX );
 }
 

@ockham
Copy link
Contributor Author

ockham commented Jul 18, 2023

Closing. As Riad mentioned, there's #3775; plus the dependency was removed from Gutenberg in WordPress/gutenberg#46110, which is now being discussed to be reverted in WordPress/gutenberg#52444.

@ockham ockham closed this Jul 18, 2023
@ockham ockham deleted the remove/wordpress-nux-dependency branch July 18, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants