Skip to content

Deprecate '@wordpress/nux' package - #18981

Merged
noisysocks merged 1 commit into
masterfrom
update/deprecate-nux
Dec 19, 2019
Merged

noisysocks merged 1 commit into
masterfrom
update/deprecate-nux

Conversation

@noisysocks

Copy link
Copy Markdown
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

gziolo commented Dec 9, 2019

Copy link
Copy Markdown
Member

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

@youknowriad youknowriad left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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