Reaction: Remove the `matb33:collection-hooks` Meteor package

Created on 23 Jan 2018  路  2Comments  路  Source: reactioncommerce/reaction

Goal

To remove the matb33:collection-hooks Meteor package

Why?

  1. Because we need to remove Meteor dependencies to eventually improve development experience
  2. Because "magic" hooks in general make it harder to develop the app and debug

Work

Wait until all linked blocker issues are merged. At this point, there should be no more collection hooks. Do some searches to verify that this is true. If so, remove the matb33:collection-hooks Meteor package and make sure everything still works / tests pass.

Here is a list of current hooks, which may be incomplete:

/imports/plugins/core/orders/server/startup.js - Orders hooks
/imports/plugins/core/revisions/server/hooks.js - Products and Media hooks
/imports/plugins/included/inventory/server/hooks/hooks.js - Cart, Products, and Orders hooks
/server/startup/packages.js - Products hook
/imports/plugins/core/discounts/server/hooks/cart.js - Carts hooks
/imports/plugins/core/revisions/server/hooks.js - Revisions hooks
/imports/plugins/core/taxes/server/hooks/taxes.js - Cart hooks
/imports/plugins/included/connectors-shopify/server/hooks/orders.js - Orders hooks
/imports/plugins/included/search-mongo/server/hooks/search.js - Accounts, Orders, and Products hooks

epic

Most helpful comment

@aldeed Couldn't/Shouldn't we be doing this with Event.Hooks? A lot of people use these hooks in their plugin code and modifying core to add them is not an option. I feel like this approach re-couples something that's _sort_ of decoupled now?

All 2 comments

@aldeed Couldn't/Shouldn't we be doing this with Event.Hooks? A lot of people use these hooks in their plugin code and modifying core to add them is not an option. I feel like this approach re-couples something that's _sort_ of decoupled now?

I've reduced the scope of this issue to just removing the package, and I created and linked 4 individual issues for migrating the hooks per collection.

Was this page helpful?
0 / 5 - 0 ratings