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

Deprecate '@wordpress/nux' package #18981

Merged
merged 1 commit into from
Dec 19, 2019
Merged

Deprecate '@wordpress/nux' package #18981

merged 1 commit into from
Dec 19, 2019

Conversation

noisysocks
Copy link
Member

What this does:

  • Replaces the areTipsEnabled preference in the core/nux store with features.welcomeGuide in the core/edit-post store.
    • Adds code which will migrate this preference so that users who have dismissed tips will not see the guide when upgrading.
  • Add a deprecation notice to @wordpress/nux.
  • Removes @wordpress/nux as a dependency from other packages in Gutenberg. (It is no longer needed as of Implement welcome guide modal #18041).

How to test:

  1. Clear your browser's persisted state by running localStorage.clear() in DevTools

  2. Build and run a version of Gutenberg that does not have Implement welcome guide modal #18041 merged in:

    git checkout release/7.0
    npm i; npm run dev
    
  3. Open the block editor

  4. Dismiss tips

  5. Close the document inspector

  6. Build and run this branch:

    git checkout update/deprecate-nux
    npm i; npm run dev
    
  7. Reload the block editor

The welcome guide should not appear and the sidebar should still be closed.

@noisysocks noisysocks added [Feature] NUX Anything that impacts the new user experience [Type] Code Quality Issues or PRs that relate to code quality [Package] NUX labels Dec 6, 2019
@gziolo
Copy link
Member

gziolo commented Dec 9, 2019

At some point, we will have to archive @wordpress/nux package on npm. We did it in the past for @wordpress/api-request.

@noisysocks noisysocks force-pushed the update/deprecate-nux branch 2 times, most recently from b1fe7b3 to 8b2899a Compare December 12, 2019 09:42
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@noisysocks noisysocks merged commit 4c178b8 into master Dec 19, 2019
@noisysocks noisysocks deleted the update/deprecate-nux branch December 19, 2019 09:49
mmtr added a commit to Automattic/wp-calypso that referenced this pull request Dec 30, 2019
SPT is currently dispatching a `disableTips` action for disabling the welcome guide when the page layout selector is displayed, but `@wordpress/nux` will be deprecated and not imported by default in Gutenberg 7.2.0 (WordPress/gutenberg#18981). That means that `disableTips` will not be available and will break the editor:

This PR handles that deprecation by hiding the welcome guide using `isFeatureActive( 'welcomeGuide' )`/`toggleFeature( 'welcomeGuide' )` (available since Gutenberg 7.1.0) and defers to `disableTips` only when the action is available (Gutenberg 7.0.0 and below).
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
@jorgefilipecosta
Copy link
Member

Hi @noisysocks, does this change needs to be backported in WordPress core?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] NUX Anything that impacts the new user experience [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants