Skip to content

React Dashboard: Fix focusTrap import#17935

Merged
kraftbj merged 1 commit intomasterfrom
fix/focus-trap-import
Dec 1, 2020
Merged

React Dashboard: Fix focusTrap import#17935
kraftbj merged 1 commit intomasterfrom
fix/focus-trap-import

Conversation

@ockham
Copy link
Copy Markdown
Contributor

@ockham ockham commented Dec 1, 2020

Changes proposed in this Pull Request:

One of the build errors when attempting to upgrade the @automattic/calypso-build dependency to v6.3.0 (#16845) is that the focus-trap npm module doesn't have a default export symbol. (This is confirmed by its docs.)

I assume that we're relying on a Babel plugin to add those default exports (mostly for CommonJS backwards compatibility), and the new calypso-build version would drop it. However, it even seems like focus-trap's API has long changed, so the current approach probably doesn't really work anyway (and just fails silently, since it's wrapped in try...catch calls).

Some more context:

Jetpack product discussion

N/A

Does this pull request change what data or activity we track or use?

Nah.

Testing instructions:

I don't really know what this does 😬

Proposed changelog entry for your changes:

React Dashboard: Fix focusTrap import.

@ockham ockham added [Status] Needs Review This PR is ready for review. Admin Page React-powered dashboard under the Jetpack menu labels Dec 1, 2020
@ockham ockham self-assigned this Dec 1, 2020
@ockham ockham requested review from a team, anomiex, brbrr, jeherve and kraftbj December 1, 2020 13:36
@jetpackbot
Copy link
Copy Markdown
Collaborator

Scheduled Jetpack release: January 12, 2021.
Scheduled code freeze: January 4, 2021

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Generated by 🚫 dangerJS against 2edf130

Copy link
Copy Markdown
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This seems to test well for me. Good catch!

I don't really know what this does 😬

I tested this by going to Jetpack > Dashboard on a connected site, clicking on the link to manage the connection in the Connection section, and once the modal was opened I tried to click into the wp-admin navigation menu on the left. As long as the trap is active, your clicks there won't do anything.

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Dec 1, 2020
@jeherve jeherve added this to the 9.3 milestone Dec 1, 2020
@kraftbj kraftbj merged commit a4175da into master Dec 1, 2020
@kraftbj kraftbj deleted the fix/focus-trap-import branch December 1, 2020 16:36
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Dec 1, 2020
@ockham
Copy link
Copy Markdown
Contributor Author

ockham commented Dec 1, 2020

Thanks @kraftbj for merging! I wasn't able to do so earlier b/c the PHP 8.0 lint (which is clearly unrelated) blocked it for me 😅

@kraftbj
Copy link
Copy Markdown
Contributor

kraftbj commented Dec 1, 2020

All good. PHP 8 shouldn't have been a blocking check, but in either case, we should have some more PHP 8 joy landed pretty soon (the prod code is fine, we think, but the testing infra needed a bit to work).

@anomiex
Copy link
Copy Markdown
Contributor

anomiex commented Dec 1, 2020

The PHP 8 linting should be blocking, IMO, since we're currently passing it and we don't want to regress. The problem wasn't actually in PHP 8 anyway, it's what we were discussing earlier at p1606835667387400-slack-CBG1CP4EN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants