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

upkeep: add TS support for useIsPluginActive hook #297

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

Sidsector9
Copy link
Member

Description of the Change

Converts the useIsPluginActive hook to TypeScript.

Closes #

How to test the Change

Changelog Entry

Changed - Add TypeScript support to useIsPluginActive

Credits

Props @fabiankaegy @Sidsector9

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link

github-actions bot commented Mar 1, 2024

Size Change: -7 B (0%)

Total Size: 65.7 kB

Filename Size Change
dist/index.js 65.7 kB -7 B (0%)

compressed-size-action

hooks/use-is-plugin-active/index.ts Outdated Show resolved Hide resolved

const isPluginActive: boolean = ACTIVE_STATUSES.includes(plugin?.status);

return [isPluginActive, hasResolvedPlugins] as [boolean, boolean];
Copy link
Member

Choose a reason for hiding this comment

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

Why is the as required here? Shouldn't it already know that due yo the earlier types?

Copy link
Member

Choose a reason for hiding this comment

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

Ahh that is because you manually typed the return of the function. We can leave that off. It can get inferred :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I've still moved that logic here 7c5ee73 for clarity.

Copy link

cypress bot commented Mar 1, 2024

1 failed test on run #758 ↗︎

1 5 0 0 Flakiness 0

Details:

remove return type
Project: 10up Block Components Commit: c66af52060
Status: Failed Duration: 01:18 💡
Started: Mar 3, 2024 2:34 PM Ended: Mar 3, 2024 2:35 PM
Failed  cypress/e2e/IconPicker.spec.js • 1 failed test

View Output

Test Artifacts
IconPicker > allows the user to use the post picker to change an icon and displays it Test Replay Screenshots

Review all test suite changes for PR #297 ↗︎

@Sidsector9 Sidsector9 changed the title move useIsPluginActive to TS upkeep: add TS support for useIsPluginActive hook Mar 3, 2024
@fabiankaegy fabiankaegy merged commit 78c2ca4 into develop Mar 5, 2024
5 of 8 checks passed
@fabiankaegy fabiankaegy deleted the upkeep/use-is-plugin-active branch March 5, 2024 08:34
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.

None yet

2 participants