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

Enable an optional namespace parameter for hasAction & hasFilter #15362

Merged
merged 18 commits into from Aug 26, 2019

Conversation

@adamsilverstein
Copy link
Contributor

commented May 1, 2019

Description

Core originally in from WordPress/packages#106
Fixes #7819

How has this been tested?

  • Add a hook with its required namespace.
  • Call matching hasfilter/hasAction and verify results correctly.
  • testing calling without namespace continues to work as expected.
  • See test files for various tests.

Types of changes

  • Add an optional namespace parameter for hasfilter & hasAction
  • Bdetter match core php functionshas_action has_filter which include this second parameter

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
@aduth
aduth approved these changes May 22, 2019
packages/hooks/src/createHasHook.js Show resolved Hide resolved
@aduth

This comment has been minimized.

Copy link
Member

commented May 22, 2019

There's a merge conflict to be resolved as well.

@aduth

This comment has been minimized.

Copy link
Member

commented May 22, 2019

Can we include a CHANGELOG.md note? I assume it should be publicly documented as well in README.md.

Separately, it would be good to see what it would take to automate the documentation using docgen like in other packages, so we don't need to maintain this documentation manually (tracked at #14227).

@adamsilverstein adamsilverstein changed the title Enable optional namespace parameter for hasAction & hasFilter Enable an optional namespace parameter for hasAction & hasFilter Aug 12, 2019
@adamsilverstein

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2019

@gziolo This could use a review if you have time. I'm not sure why there are failing checks.

@gziolo
gziolo approved these changes Aug 13, 2019
Copy link
Member

left a comment

I left only nitpicks :)

It looks good and I think we should also update API Usage section in README file:
https://github.com/WordPress/gutenberg/tree/master/packages/hooks#api-usage

packages/hooks/CHANGELOG.md Outdated Show resolved Hide resolved
packages/hooks/src/test/index.test.js Outdated Show resolved Hide resolved
packages/hooks/src/test/index.test.js Outdated Show resolved Hide resolved
packages/hooks/src/test/index.test.js Show resolved Hide resolved
Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>
@adamsilverstein

This comment has been minimized.

Copy link
Contributor Author

commented Aug 15, 2019

@gziolo Thanks for the review. I will work on your feedback and update API Usage section in README.

@adamsilverstein

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2019

@gziolo I addressed your feedback and this should be ready for a merge once all tests pass.

packages/hooks/README.md Outdated Show resolved Hide resolved
packages/hooks/README.md Outdated Show resolved Hide resolved
Co-Authored-By: Daniel Richards <daniel.richards@automattic.com>
@gziolo

This comment has been minimized.

Copy link
Member

commented Aug 26, 2019

Let's get this PR in, @adamsilverstein thanks for all iterations applied.

@gziolo gziolo merged commit 8eb5007 into master Aug 26, 2019
1 of 4 checks passed
1 of 4 checks passed
Filter opened
Details
Filter opened
Details
Milestone It
Details
Travis CI - Pull Request Build Passed
Details
@gziolo gziolo deleted the fix-7601 branch Aug 26, 2019
@gziolo gziolo added this to the Gutenberg 6.4 milestone Aug 26, 2019
donmhico added a commit to donmhico/gutenberg that referenced this pull request Aug 27, 2019
…dPress#15362)

* from https://github.com/WordPress/packages/pull/106/files

* Update packages/hooks/src/createHasHook.js

Co-Authored-By: Pascal Birchler <pascal.birchler@gmail.com>

* clean up docblock spacing

* add changelog entry for new namespace parameter for hasAction & hasFilter

* Update packages/hooks/CHANGELOG.md

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* break out tests

* update readme

* Apply suggestions from code review

Co-Authored-By: Daniel Richards <daniel.richards@automattic.com>

* Update CHANGELOG.md
dratwas added a commit to callstack/gutenberg that referenced this pull request Aug 28, 2019
…dPress#15362)

* from https://github.com/WordPress/packages/pull/106/files

* Update packages/hooks/src/createHasHook.js

Co-Authored-By: Pascal Birchler <pascal.birchler@gmail.com>

* clean up docblock spacing

* add changelog entry for new namespace parameter for hasAction & hasFilter

* Update packages/hooks/CHANGELOG.md

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* break out tests

* update readme

* Apply suggestions from code review

Co-Authored-By: Daniel Richards <daniel.richards@automattic.com>

* Update CHANGELOG.md
gziolo added a commit that referenced this pull request Aug 29, 2019
)

* from https://github.com/WordPress/packages/pull/106/files

* Update packages/hooks/src/createHasHook.js

Co-Authored-By: Pascal Birchler <pascal.birchler@gmail.com>

* clean up docblock spacing

* add changelog entry for new namespace parameter for hasAction & hasFilter

* Update packages/hooks/CHANGELOG.md

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* break out tests

* update readme

* Apply suggestions from code review

Co-Authored-By: Daniel Richards <daniel.richards@automattic.com>

* Update CHANGELOG.md
gziolo added a commit that referenced this pull request Aug 29, 2019
)

* from https://github.com/WordPress/packages/pull/106/files

* Update packages/hooks/src/createHasHook.js

Co-Authored-By: Pascal Birchler <pascal.birchler@gmail.com>

* clean up docblock spacing

* add changelog entry for new namespace parameter for hasAction & hasFilter

* Update packages/hooks/CHANGELOG.md

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* break out tests

* update readme

* Apply suggestions from code review

Co-Authored-By: Daniel Richards <daniel.richards@automattic.com>

* Update CHANGELOG.md
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
…dPress#15362)

* from https://github.com/WordPress/packages/pull/106/files

* Update packages/hooks/src/createHasHook.js

Co-Authored-By: Pascal Birchler <pascal.birchler@gmail.com>

* clean up docblock spacing

* add changelog entry for new namespace parameter for hasAction & hasFilter

* Update packages/hooks/CHANGELOG.md

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* break out tests

* update readme

* Apply suggestions from code review

Co-Authored-By: Daniel Richards <daniel.richards@automattic.com>

* Update CHANGELOG.md
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.