Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

Add the WordPress hook library from 21170-core #13

Merged
merged 98 commits into from
Sep 22, 2017

Commits on Jul 18, 2017

  1. add wp-hooks, first pass

    Adam Silverstein committed Jul 18, 2017
    Configuration menu
    Copy the full SHA
    6bca9da View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2017

  1. updates from ticket, flesh out removeAll, cleanup

    Adam Silverstein committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    85c73be View commit details
    Browse the repository at this point in the history
  2. inline docs cleanup

    Adam Silverstein committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    dc71cd1 View commit details
    Browse the repository at this point in the history
  3. remove some commented code

    Adam Silverstein committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    4013c9a View commit details
    Browse the repository at this point in the history
  4. downgrade initial version

    Adam Silverstein committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    ff65810 View commit details
    Browse the repository at this point in the history
  5. clean up imports for (empty) tests file

    Adam Silverstein committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    be62409 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2017

  1. Configuration menu
    Copy the full SHA
    45d70c3 View commit details
    Browse the repository at this point in the history
  2. First pass, jest tests

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    632c98a View commit details
    Browse the repository at this point in the history
  3. add remainder of tests

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    77c9906 View commit details
    Browse the repository at this point in the history
  4. Docs refinements

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    b4b713d View commit details
    Browse the repository at this point in the history
  5. Break out code into one file per funciton

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    9d24e77 View commit details
    Browse the repository at this point in the history
  6. Centralize all run logic into createRunHook

    Also fixes a bug that `doingAction` would remain true after its action
    was completed.  Effectively it would always be true.
    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    57f6038 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1901b43 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'add-wp-hooks' of github.com:adamsilverstein/packages in…

    …to add-wp-hooks
    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    b05f488 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f6c2b45 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f50aadb View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    bee29d7 View commit details
    Browse the repository at this point in the history
  12. Merge branch 'add-wp-hooks' of github.com:adamsilverstein/packages in…

    …to add-wp-hooks
    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    f8e129d View commit details
    Browse the repository at this point in the history
  13. Several fixes to hook removal behavior

    - Calling `removeAction` and `removeFilter` without a callback should
      not remove all hooks.  This operation should be explicitly requested.
    - Calling `removeAllActions` and `removeAllFilters` should not reset
      `didAction` and `didFilter` counts.
    
    Also correctly reset state (clear all hooks and all hook call counts)
    before each test.
    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    b02296c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    aeca7df View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    678f790 View commit details
    Browse the repository at this point in the history
  16. Naming and documentation cleanup

    - `hooks`: A hooks object, keyed by hook name
    - `hookName`: A hook name
    - `handlers`: The handlers for a single hook
    - All top-level and inner (returned) functions have names.
    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    78acfe1 View commit details
    Browse the repository at this point in the history
  17. Make hasAction and hasFilter return the number of registered hooks

    This is different than PHP, because the existing PHP API that these
    functions accept a callback and return its priority won't work well in
    JavaScript.  Instead, when we implement namespaced hooks, these
    functions should work the same way:  return the number of handlers
    registered under the given hook and namespace.
    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    637af4d View commit details
    Browse the repository at this point in the history
  18. Remove unnecessary describe/it pairs

    Just replace them with `test` instead, per the Jest examples.
    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    b7b30f4 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    b351db4 View commit details
    Browse the repository at this point in the history
  20. Use ES6 object shorthand

    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    498e15b View commit details
    Browse the repository at this point in the history
  21. Add explicit error reporting

    nylen committed Jul 20, 2017
    2 Configuration menu
    Copy the full SHA
    e3392c3 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    53294fd View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    07b61a0 View commit details
    Browse the repository at this point in the history
  24. Remove remaining var statements

    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    ee303e6 View commit details
    Browse the repository at this point in the history
  25. Remove remaining per-test cleanup logic

    This is all handled in `beforeEach` now.
    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    b1251e3 View commit details
    Browse the repository at this point in the history
  26. Merge branch 'add-wp-hooks' of github.com:adamsilverstein/packages in…

    …to add-wp-hooks
    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    93998e1 View commit details
    Browse the repository at this point in the history
  27. Add webpack and build wp-hooks for core

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    7eda5e2 View commit details
    Browse the repository at this point in the history
  28. remove built file and adjust build path

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    0e9986a View commit details
    Browse the repository at this point in the history
  29. Remove unused dependencies

    nylen committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    c9890db View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    de6efd7 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    ad47998 View commit details
    Browse the repository at this point in the history
  32. Merge branch 'add-wp-hooks' of github.com:adamsilverstein/packages in…

    …to add-wp-hooks
    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    e217d7f View commit details
    Browse the repository at this point in the history
  33. Run core build JS thru babel

    Adam Silverstein committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    562cf37 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2017

  1. remove babel-loader for now

    Adam Silverstein committed Jul 21, 2017
    Configuration menu
    Copy the full SHA
    f882313 View commit details
    Browse the repository at this point in the history
  2. rename ‘current’ => ‘__current’ and make it a stack

    Adam Silverstein committed Jul 21, 2017
    Configuration menu
    Copy the full SHA
    9eeb198 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fd0ccd3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fc48fbf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    566af31 View commit details
    Browse the repository at this point in the history
  6. prevent and test for (dingle level) hook recursion

    Adam Silverstein committed Jul 21, 2017
    Configuration menu
    Copy the full SHA
    6ce6268 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    83dffa4 View commit details
    Browse the repository at this point in the history
  8. Failing recursive test: remove one hook in a callback before adding a…

    …nother
    Adam Silverstein committed Jul 21, 2017
    Configuration menu
    Copy the full SHA
    2a60b9f View commit details
    Browse the repository at this point in the history
  9. Add babel-loader for core build

    Adam Silverstein committed Jul 21, 2017
    Configuration menu
    Copy the full SHA
    79ef421 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2017

  1. Configuration menu
    Copy the full SHA
    742857a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bf69f89 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bd911d0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b802c1d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4e393d6 View commit details
    Browse the repository at this point in the history
  6. Fix currentFilter behavior

    nylen committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    5d0513c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c11003c View commit details
    Browse the repository at this point in the history
  8. Remove wp-hooks.js entry point

    This logic needs to be generated by Webpack instead.  Otherwise
    something like it will end up being duplicated and manually maintained
    for every module in this repo.
    nylen committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    ad09872 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a19fa3b View commit details
    Browse the repository at this point in the history
  10. Prevent hook names from starting with __

    This would break some of the library's internal functionality.
    nylen committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    0498ee8 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5b8c5f3 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    6327a54 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    dd10eab View commit details
    Browse the repository at this point in the history
  14. Ensure that hook callbacks to remove are functions

    This will need to change later, but for now we should still make sure we
    validate our expected inputs strictly.
    nylen committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    8be21e5 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    70b3ebc View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    a3b4901 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6653227 View commit details
    Browse the repository at this point in the history
  18. First attempt at handling adding/removing callbacks during execution

    Also allows recursion.
    nylen committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    2e9b96e View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    54f70c1 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    afa92ea View commit details
    Browse the repository at this point in the history
  21. Add missing tests

    nylen committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    0919ab9 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2017

  1. Merge branch 'add-wp-hooks' of github.com:adamsilverstein/packages in…

    …to add-wp-hooks
    Adam Silverstein committed Jul 25, 2017
    Configuration menu
    Copy the full SHA
    d319b9d View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2017

  1. Add a centralized webpack folder based build for packages

    Adam Silverstein committed Aug 1, 2017
    Configuration menu
    Copy the full SHA
    90942a7 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2017

  1. Add check: the hook name can only contain numbers, letters and unders…

    …cores
    Adam Silverstein committed Aug 8, 2017
    Configuration menu
    Copy the full SHA
    e2547d9 View commit details
    Browse the repository at this point in the history
  2. use yoda conditional as per wp coding standards

    Adam Silverstein committed Aug 8, 2017
    Configuration menu
    Copy the full SHA
    cefc79a View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2017

  1. removeHook - accept a namespace parameter and use it to identify item…

    … for removal
    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    ca95500 View commit details
    Browse the repository at this point in the history
  2. addHook - The hook name can only contain numbers, letters and undersc…

    …ores
    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    cc8b852 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    06ddd95 View commit details
    Browse the repository at this point in the history
  4. Use some Yoda conditionals

    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    edd46d0 View commit details
    Browse the repository at this point in the history
  5. Ensure the passed namespace is a string of the form `my-plugin-slug/f…

    …unctionDescription
    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    77be5ed View commit details
    Browse the repository at this point in the history
  6. Add a build-modules command to run webpack

    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    2c62cdc View commit details
    Browse the repository at this point in the history
  7. Add a validateNamespace helper, centralizing namespace checks

    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    581e715 View commit details
    Browse the repository at this point in the history
  8. Add a validateHookName helper, centralizing hookName validation

    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    4c7f252 View commit details
    Browse the repository at this point in the history
  9. Use new hookName and namespace validation helpers throughout generato…

    …rs for each hookName/namespace use
    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    ef06958 View commit details
    Browse the repository at this point in the history
  10. Update tests to use namespaces

    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    319a023 View commit details
    Browse the repository at this point in the history
  11. Update readme with new hook/namespace signature

    Adam Silverstein committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    4ece207 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2017

  1. Improve validateNamespace and validateHookName inline docs

    Adam Silverstein committed Aug 12, 2017
    Configuration menu
    Copy the full SHA
    aa709ac View commit details
    Browse the repository at this point in the history
  2. require a non-empty string when validating namespace/hookName

    Adam Silverstein committed Aug 12, 2017
    Configuration menu
    Copy the full SHA
    a8628a0 View commit details
    Browse the repository at this point in the history
  3. Adjust expected error language in tests.

    Adam Silverstein committed Aug 12, 2017
    Configuration menu
    Copy the full SHA
    242f351 View commit details
    Browse the repository at this point in the history
  4. Improved regexes for hookName and namespace validation

    Adam Silverstein committed Aug 12, 2017
    Configuration menu
    Copy the full SHA
    d8af28f View commit details
    Browse the repository at this point in the history
  5. Add more tests around hookName and namespace validation

    Adam Silverstein committed Aug 12, 2017
    Configuration menu
    Copy the full SHA
    650e9e2 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2017

  1. Configuration menu
    Copy the full SHA
    a617214 View commit details
    Browse the repository at this point in the history
  2. Update tests with new namespace format

    Adam Silverstein committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    30e5e82 View commit details
    Browse the repository at this point in the history
  3. update readme with new namespace format

    Adam Silverstein committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    3a13768 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2017

  1. remove module build from branch

    Adam Silverstein committed Aug 17, 2017
    Configuration menu
    Copy the full SHA
    7c1fc29 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2017

  1. Correct namespace strings in docblocks

    Adam Silverstein committed Sep 4, 2017
    Configuration menu
    Copy the full SHA
    45747e5 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2017

  1. Add args to applyFilters docs in readme

    Adam Silverstein committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    a24847b View commit details
    Browse the repository at this point in the history
  2. camelCase for readme variable names

    Adam Silverstein committed Sep 7, 2017
    Configuration menu
    Copy the full SHA
    9f4cefc View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2017

  1. update hook and vendor/plugin/function wording, removing Name

    Adam Silverstein committed Sep 12, 2017
    Configuration menu
    Copy the full SHA
    73744fa View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2017

  1. complte namespace shortening to vendor/plugin/function

    Adam Silverstein committed Sep 13, 2017
    Configuration menu
    Copy the full SHA
    7465667 View commit details
    Browse the repository at this point in the history