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

SPT: Handle NUX deprecation #38611

Merged
merged 3 commits into from
Dec 30, 2019
Merged

SPT: Handle NUX deprecation #38611

merged 3 commits into from
Dec 30, 2019

Conversation

mmtr
Copy link
Member

@mmtr mmtr commented Dec 30, 2019

Changes proposed in this Pull Request

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:

Screenshot 2019-12-30 at 11 18 49

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

Testing instructions

  • Generate a new build of the FSE plugin and upload it to a WP.org test site.
  • Make sure you're running a custom build of the Gutenberg plugin based on master (so the NUX package is deprecated).
  • Clear your browser's persisted state by running localStorage.clear() in DevTools.
  • Go to Pages > Add New.
  • Verify the page layout selector is displayed without the welcome guide.
  • Deactivate the Gutenberg plugin (so WP loads the block editor bundled in core where the NUX package is not deprecated yet).
  • Clear your browser's persisted state by running localStorage.clear() in DevTools.
  • Go to Pages > Add New.
  • Verify the page layout selector is displayed without the welcome guide.

@mmtr mmtr added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 30, 2019
@mmtr mmtr requested review from a team December 30, 2019 11:59
@mmtr mmtr self-assigned this Dec 30, 2019
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@Copons
Copy link
Contributor

Copons commented Dec 30, 2019

@mmtr Once fixed #38611 (comment), this is good to go! 🕺
Thanks for the catch and the fix!

@mmtr mmtr merged commit 4d28c24 into master Dec 30, 2019
@mmtr mmtr deleted the fix/spt-nux-deprecated branch December 30, 2019 14:26
@mmtr
Copy link
Member Author

mmtr commented Dec 30, 2019

Thanks for the review @Copons!

@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 30, 2019
@Copons Copons mentioned this pull request Dec 30, 2019
mmtr pushed a commit that referenced this pull request Jan 2, 2020
Bump FSE to 0.18.2, which introduces the changes added in #38611.
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