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

noisysocks commented Dec 6, 2019

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 #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 #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.

@gziolo

This comment has been minimized.

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 Dec 12, 2019
@noisysocks noisysocks force-pushed the update/deprecate-nux branch from 8b2899a to 7e75038 Dec 12, 2019
Copy link
Contributor

youknowriad left a comment

LGTM 👍

@noisysocks noisysocks merged commit 4c178b8 into master Dec 19, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@noisysocks noisysocks deleted the update/deprecate-nux branch Dec 19, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.